mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 15:55:49 +00:00
refactor pvf security module (#3047)
resolve https://github.com/paritytech/polkadot-sdk/issues/2321 - [x] refactor `security` module into a conditionally compiled - [x] rename `amd64` into x86-64 for consistency with conditional compilation guards and remove reference to a particular vendor - [x] run unit tests and zombienet --------- Co-authored-by: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
This commit is contained in:
@@ -35,6 +35,8 @@ sp-tracing = { path = "../../../../../substrate/primitives/tracing" }
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
landlock = "0.3.0"
|
||||
nix = { version = "0.27.1", features = ["sched"] }
|
||||
|
||||
[target.'cfg(all(target_os = "linux", target_arch = "x86_64"))'.dependencies]
|
||||
seccompiler = "0.4.0"
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -86,3 +86,33 @@ pub fn framed_recv_blocking(r: &mut (impl Read + Unpin)) -> io::Result<Vec<u8>>
|
||||
r.read_exact(&mut buf)?;
|
||||
Ok(buf)
|
||||
}
|
||||
|
||||
#[cfg(all(test, not(feature = "test-utils")))]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn default_secure_status() {
|
||||
let status = SecurityStatus::default();
|
||||
assert!(
|
||||
!status.secure_validator_mode,
|
||||
"secure_validator_mode is false for default security status"
|
||||
);
|
||||
assert!(
|
||||
!status.can_enable_landlock,
|
||||
"can_enable_landlock is false for default security status"
|
||||
);
|
||||
assert!(
|
||||
!status.can_enable_seccomp,
|
||||
"can_enable_seccomp is false for default security status"
|
||||
);
|
||||
assert!(
|
||||
!status.can_unshare_user_namespace_and_change_root,
|
||||
"can_unshare_user_namespace_and_change_root is false for default security status"
|
||||
);
|
||||
assert!(
|
||||
!status.can_do_secure_clone,
|
||||
"can_do_secure_clone is false for default security status"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user