pub enum ChildNetworkPolicy {
LandlockOnly,
DenyDirect,
}Expand description
How a confined child’s direct network-socket authority is enforced, beyond
the caveat-driven Landlock TCP rule. A mechanism knob (it rides
SandboxPolicy), never authority (Caveats): the caller states the
required floor and the backend owns the enforcement (ADR 0017).
Variants§
LandlockOnly
Historical behavior: rely on the caveat-driven Landlock net rule alone.
An empty net scope kernel-denies TCP connect/bind on an ABI-v4
kernel, but Landlock cannot filter UDP, DNS, raw or packet sockets — a
child under net: none can still create them. Backward-compatible
default, so existing configs and callers are unchanged.
DenyDirect
Additionally install a seccomp socket()-family deny (AF_INET / AF_INET6
/ AF_PACKET → EACCES) on the confining thread immediately before spawn,
so the child and every fork/exec descendant cannot create ANY off-box
socket regardless of protocol — closing the UDP/DNS/raw leg Landlock
misses. AF_UNIX is deliberately still allowed (a path-named unix socket
is already governed by the fs fence; abstract-namespace unix sockets are a
bounded residual). Takes effect only when the net caveat is already
deny-all (net: none); a granted net scope leaves it inert (the caller
asked for egress). Requires the linux-landlock backend (which pulls the
safe seccompiler install path); on other platforms it is inert, so a
caller that requires it must fail closed via backends.require_landlock.
Trait Implementations§
Source§impl Clone for ChildNetworkPolicy
impl Clone for ChildNetworkPolicy
Source§fn clone(&self) -> ChildNetworkPolicy
fn clone(&self) -> ChildNetworkPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ChildNetworkPolicy
Source§impl Debug for ChildNetworkPolicy
impl Debug for ChildNetworkPolicy
Source§impl Default for ChildNetworkPolicy
impl Default for ChildNetworkPolicy
Source§fn default() -> ChildNetworkPolicy
fn default() -> ChildNetworkPolicy
Source§impl<'de> Deserialize<'de> for ChildNetworkPolicy
impl<'de> Deserialize<'de> for ChildNetworkPolicy
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChildNetworkPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChildNetworkPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ChildNetworkPolicy
Source§impl PartialEq for ChildNetworkPolicy
impl PartialEq for ChildNetworkPolicy
Source§impl Serialize for ChildNetworkPolicy
impl Serialize for ChildNetworkPolicy
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ChildNetworkPolicy
Auto Trait Implementations§
impl Freeze for ChildNetworkPolicy
impl RefUnwindSafe for ChildNetworkPolicy
impl Send for ChildNetworkPolicy
impl Sync for ChildNetworkPolicy
impl Unpin for ChildNetworkPolicy
impl UnsafeUnpin for ChildNetworkPolicy
impl UnwindSafe for ChildNetworkPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
Source§fn convert_into(self) -> T
fn convert_into(self) -> T
Self to a value of type T.Source§impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
Source§impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
Source§type Error = <T as ConvertTryFrom<F>>::Error
type Error = <T as ConvertTryFrom<F>>::Error
Source§fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
Self to a value of type T.impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more