MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / apply

Function apply

crates/openshell-supervisor-process/src/sandbox/linux/seccomp.rs:72–81  ·  view source on GitHub ↗
(policy: &SandboxPolicy)

Source from the content-addressed store, hash-verified

70}
71
72pub fn apply(policy: &SandboxPolicy) -> Result<()> {
73 let allow_inet = matches!(policy.network.mode, NetworkMode::Proxy | NetworkMode::Allow);
74 let main_filter = build_filter(allow_inet)?;
75 let clone3_filter = build_clone3_filter()?;
76
77 set_no_new_privs()?;
78 apply_runtime_filters(&main_filter, &clone3_filter)?;
79
80 Ok(())
81}
82
83fn build_filter(allow_inet: bool) -> Result<seccompiler::BpfProgram> {
84 let rules = build_filter_rules(allow_inet)?;

Callers

nothing calls this directly

Calls 4

build_filterFunction · 0.85
build_clone3_filterFunction · 0.85
set_no_new_privsFunction · 0.85
apply_runtime_filtersFunction · 0.85

Tested by

no test coverage detected