(policy: &SandboxPolicy)
| 70 | } |
| 71 | |
| 72 | pub 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 | |
| 83 | fn build_filter(allow_inet: bool) -> Result<seccompiler::BpfProgram> { |
| 84 | let rules = build_filter_rules(allow_inet)?; |
nothing calls this directly
no test coverage detected