diff --git a/src/builtins/danger_zone.rs b/src/builtins/danger_zone.rs index 582e19f..a89fa91 100644 --- a/src/builtins/danger_zone.rs +++ b/src/builtins/danger_zone.rs @@ -125,3 +125,25 @@ impl RuleSet for ForkAndExec { "ForkAndExec" } } + +/// [`Pipes`] is in the danger zone because it can be used create a pipe for IPC. +/// +/// # Security Considerations +/// You can, for example, create the pipe, fork the process, and then the parent +/// and the child both have the pipe but even if you apply seccomp to the parent, +/// it doesn't apply to the already-forked child +/// (unless you use [`apply_to_all_threads`] of course) +pub struct Pipes; +impl RuleSet for Pipes { + fn simple_rules(&self) -> Vec { + vec![Sysno::pipe, Sysno::pipe2] + } + + fn conditional_rules(&self) -> HashMap> { + HashMap::new() + } + + fn name(&self) -> &'static str { + "Pipes" + } +}