pub enum CallSelector {
Tool(String),
Matching {
tool: String,
args_match: BTreeMap<String, String>,
},
}Expand description
Which calls in a trace a rule step refers to.
Sequence rules used to name a tool and nothing else, so the correlation class that motivated
ADR-047 could not be written: “credential read followed by egress” is not a statement about two
tool names, it is a statement about two calls, one of which is identified by what it was given
(#2124). Both halves of that pair are ordinary bash in the trace that prompted it.
Untagged, so a bare string keeps meaning exactly what it meant before, including alias resolution through the policy. Every existing config parses unchanged; the object form is the new capability rather than a migration.
- type: never_after
trigger: { tool: bash, args_match: { command: "\\.aws/credentials" } }
forbidden: { tool: bash, args_match: { command: "^curl .*-d" } }args_match is a conjunction: every named argument must be present and its value must match
the regex. Values are matched against their JSON rendering, so a non-string argument is
matchable without a separate syntax, and a missing argument fails the match rather than being
skipped, because a rule that silently stops constraining is the failure this whole area exists
to prevent.
Variants§
Tool(String)
A tool name, resolved through policy aliases. The shape every pre-5.0.0 config uses.
Matching
A tool name plus a constraint on the call’s arguments.
Implementations§
Trait Implementations§
Source§impl Clone for CallSelector
impl Clone for CallSelector
Source§fn clone(&self) -> CallSelector
fn clone(&self) -> CallSelector
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 CallSelector
impl Debug for CallSelector
Source§impl<'de> Deserialize<'de> for CallSelector
impl<'de> Deserialize<'de> for CallSelector
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for CallSelector
impl Display for CallSelector
Source§impl From<&str> for CallSelector
impl From<&str> for CallSelector
Source§impl PartialEq for CallSelector
impl PartialEq for CallSelector
Source§impl Serialize for CallSelector
impl Serialize for CallSelector
impl StructuralPartialEq for CallSelector
Auto Trait Implementations§
impl Freeze for CallSelector
impl RefUnwindSafe for CallSelector
impl Send for CallSelector
impl Sync for CallSelector
impl Unpin for CallSelector
impl UnsafeUnpin for CallSelector
impl UnwindSafe for CallSelector
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.