pub struct SpawnEnvelope {
pub network_allow: Vec<String>,
pub unix_sockets_allowed: bool,
pub peer_fetch_allow: Vec<String>,
pub shell_allow: Vec<String>,
pub spawn_allow: Vec<String>,
pub env_allow: Vec<String>,
pub filesystem_scope: Option<String>,
pub workdir_exec_allowed: bool,
pub state_stores: BTreeSet<String>,
pub containment_floor: ContainmentClass,
}Expand description
One capsule’s declared capability surface, in the shape the spawn comparison needs.
Narrower than crate::types::CapabilityPolicy on most axes, and wider on one. Narrower:
limits, resources and the shell_strip_env/baseline_env/interpreter_runtime grants are
bounds and plumbing rather than reach, so a child that sets them differently is not
escalating. Wider: Self::state_stores is per artifact, so it is not on the capsule-wide
policy at all, and a child whose artifacts open a store the parent’s do not is reaching durable
state outside every workdir that its parent cannot see.
Fields§
§network_allow: Vec<String>capabilities.network.allow, unparsed. Held as declared so a refusal quotes the operator’s
own line; parsing happens inside Self::contains, where an unparseable entry is
uncovered rather than an error (validate_capability_policy refuses it again, with the
parse error, if a spawn ever gets as far as staging).
unix_sockets_allowed: bool§peer_fetch_allow: Vec<String>§shell_allow: Vec<String>§spawn_allow: Vec<String>capabilities.spawn.allow. Compared as an axis like any other — a child that can spawn a
name its parent cannot has widened the delegation graph, not just its own reach. This is a
different question from the name check mur-roost runs first, which asks whether this
child is a name the parent may spawn at all.
env_allow: Vec<String>§filesystem_scope: Option<String>§workdir_exec_allowed: bool§state_stores: BTreeSet<String>Every store name this capsule’s artifacts would open, with the capsule-name default already
applied by [crate::state_store::resolve_store_name] — so two capsules that both declare a
bare capabilities.state compare as the different directories they actually open.
A set rather than a list: the axis is “which stores are opened”, and an artifact list that names one store twice is not a wider grant.
containment_floor: ContainmentClasscapabilities.containment. The one axis where more is safer, so it is the one axis
compared with >= rather than by containment of a set — see Self::contains.
Implementations§
Source§impl SpawnEnvelope
impl SpawnEnvelope
Sourcepub fn from_runtime_manifest(manifest: &RuntimeManifest) -> Self
pub fn from_runtime_manifest(manifest: &RuntimeManifest) -> Self
Lower a capsule’s manifest into the envelope it both holds and imposes.
Every capsule-wide axis is read off crate::types::capability_policy_from_runtime_manifest
rather than off the manifest again, so the envelope compared here and the
crate::types::CapabilityPolicy the session is actually staged with cannot read the same
manifest two different ways.
Sourcepub fn contains(&self, child: &Self) -> Result<(), EnvelopeViolation>
pub fn contains(&self, child: &Self) -> Result<(), EnvelopeViolation>
Ok(()) when child holds no more capability than self on any axis, otherwise the first
axis it exceeded.
Containment is the exception to “the child must be a subset”: a floor is a requirement
rather than a grant, so a child may only ever raise it. ContainmentClass lists its
variants weakest-first and derives Ord for exactly this comparison.
Axis order is the order a refusal reports in, and matters only when a child exceeds on more than one: it is the table order in the reference docs, so the page and the daemon agree about which refusal an operator sees first.
Trait Implementations§
Source§impl Clone for SpawnEnvelope
impl Clone for SpawnEnvelope
Source§impl Debug for SpawnEnvelope
impl Debug for SpawnEnvelope
Source§impl Default for SpawnEnvelope
impl Default for SpawnEnvelope
impl Eq for SpawnEnvelope
Source§impl PartialEq for SpawnEnvelope
impl PartialEq for SpawnEnvelope
impl StructuralPartialEq for SpawnEnvelope
Auto Trait Implementations§
impl Freeze for SpawnEnvelope
impl RefUnwindSafe for SpawnEnvelope
impl Send for SpawnEnvelope
impl Sync for SpawnEnvelope
impl Unpin for SpawnEnvelope
impl UnsafeUnpin for SpawnEnvelope
impl UnwindSafe for SpawnEnvelope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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