pub enum PolicyParseError {
Yaml(String),
InvalidCapability {
raw: String,
reason: String,
},
InvalidSyscall {
raw: String,
reason: String,
},
UnknownKey {
path: String,
key: String,
},
EmptyDocument,
NoEnforcementSection,
}Expand description
Errors that can occur while parsing a PolicyDocument.
Variants§
Yaml(String)
The YAML could not be deserialized.
InvalidCapability
A capability token was not recognised.
InvalidSyscall
A syscall name in the syscalls.allow list was not recognised.
UnknownKey
A structural key was not part of the known policy schema.
Raised when a security-relevant section or field is misspelled (e.g.
dney: for deny:, allow_list: for allowlist:). Such typos would
otherwise be silently dropped by #[serde(flatten)] — yielding an empty,
permissive policy that parses successfully. Surfacing them keeps policy
parsing fail-closed (AAASM-3874).
Fields
EmptyDocument
The document was empty or null.
An empty / null / {} policy deserializes to an all-None document,
which is fully permissive (no capability denials, no allowlist, no tool
gating). A policy must positively declare its posture, so a blank
document is rejected rather than silently defaulting open (AAASM-3997).
NoEnforcementSection
The document parsed but declared no enforcement dimension.
A metadata-only document (e.g. just apiVersion/kind/metadata, with
no network, capabilities, tools, or syscalls) deserializes to a
fully-permissive policy exactly like an empty one. It is rejected so a
policy cannot become open by omission rather than by declaration
(AAASM-4020, extending the AAASM-3997 empty/null floor).
Trait Implementations§
Source§impl Clone for PolicyParseError
impl Clone for PolicyParseError
Source§fn clone(&self) -> PolicyParseError
fn clone(&self) -> PolicyParseError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PolicyParseError
impl Debug for PolicyParseError
Source§impl Display for PolicyParseError
impl Display for PolicyParseError
impl Eq for PolicyParseError
Source§impl Error for PolicyParseError
impl Error for PolicyParseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for PolicyParseError
impl PartialEq for PolicyParseError
Source§fn eq(&self, other: &PolicyParseError) -> bool
fn eq(&self, other: &PolicyParseError) -> bool
self and other values to be equal, and is used by ==.