pub struct SecurityAlert {Show 16 fields
pub schema: String,
pub ts_ms: i64,
pub sequence_id: u64,
pub extension_id: String,
pub category: SecurityAlertCategory,
pub severity: SecurityAlertSeverity,
pub capability: String,
pub method: String,
pub reason_codes: Vec<String>,
pub summary: String,
pub policy_source: String,
pub action: SecurityAlertAction,
pub remediation: String,
pub risk_score: f64,
pub risk_state: Option<RuntimeRiskStateLabelValue>,
pub context_hash: String,
}Expand description
A structured security alert with who/what/why/action fields.
Designed for both interactive display and downstream integrations (RPC, SIEM, structured logging).
Fields§
§schema: StringSchema version tag for stable deserialization.
ts_ms: i64Unix epoch milliseconds when the alert was generated.
sequence_id: u64Monotonically increasing alert sequence number.
extension_id: StringExtension that triggered the alert (empty for global events).
category: SecurityAlertCategoryAlert category for quick classification.
severity: SecurityAlertSeveritySeverity level.
capability: StringCapability involved (e.g. “exec”, “env”, “http”).
method: StringMethod or sub-operation (e.g. “spawn”, “get”, “set”).
reason_codes: Vec<String>Structured reason codes (machine-readable).
summary: StringHuman-readable summary of why the alert was raised.
policy_source: StringPolicy source that caused the decision (e.g. “deny_caps”, “exec_mediation”, “risk_scorer”, “quota”).
action: SecurityAlertActionEnforcement action taken.
remediation: StringSuggested remediation for the user.
risk_score: f64Risk score at the time of the alert (0.0 if not applicable).
risk_state: Option<RuntimeRiskStateLabelValue>Derived risk state label (if from risk scorer).
context_hash: StringHash of the related command or params (redacted).
Implementations§
Source§impl SecurityAlert
impl SecurityAlert
Sourcepub fn from_policy_denial(
extension_id: &str,
capability: &str,
method: &str,
reason: &str,
policy_source: &str,
) -> Self
pub fn from_policy_denial( extension_id: &str, capability: &str, method: &str, reason: &str, policy_source: &str, ) -> Self
Create a policy-denial alert.
Sourcepub fn from_exec_mediation(
extension_id: &str,
command: &str,
class_label: Option<&str>,
reason: &str,
) -> Self
pub fn from_exec_mediation( extension_id: &str, command: &str, class_label: Option<&str>, reason: &str, ) -> Self
Create an exec-mediation alert.
Sourcepub fn from_secret_redaction(extension_id: &str, var_name: &str) -> Self
pub fn from_secret_redaction(extension_id: &str, var_name: &str) -> Self
Create a secret-broker redaction alert.
Sourcepub fn from_anomaly_detection(
extension_id: &str,
capability: &str,
method: &str,
risk_score: f64,
risk_state: RuntimeRiskStateLabelValue,
enforcement_action: SecurityAlertAction,
reason_codes: Vec<String>,
summary: String,
) -> Self
pub fn from_anomaly_detection( extension_id: &str, capability: &str, method: &str, risk_score: f64, risk_state: RuntimeRiskStateLabelValue, enforcement_action: SecurityAlertAction, reason_codes: Vec<String>, summary: String, ) -> Self
Create a risk-scorer anomaly alert.
Sourcepub fn from_quarantine(
extension_id: &str,
reason: &str,
risk_score: f64,
) -> Self
pub fn from_quarantine( extension_id: &str, reason: &str, risk_score: f64, ) -> Self
Create a quarantine alert.
Sourcepub fn from_enforcement_transition(
extension_id: &str,
transition: &EnforcementTransition,
) -> Self
pub fn from_enforcement_transition( extension_id: &str, transition: &EnforcementTransition, ) -> Self
Create an enforcement state transition alert.
Trait Implementations§
Source§impl Clone for SecurityAlert
impl Clone for SecurityAlert
Source§fn clone(&self) -> SecurityAlert
fn clone(&self) -> SecurityAlert
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityAlert
impl Debug for SecurityAlert
Source§impl<'de> Deserialize<'de> for SecurityAlert
impl<'de> Deserialize<'de> for SecurityAlert
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 PartialEq for SecurityAlert
impl PartialEq for SecurityAlert
Source§impl Serialize for SecurityAlert
impl Serialize for SecurityAlert
impl StructuralPartialEq for SecurityAlert
Auto Trait Implementations§
impl Freeze for SecurityAlert
impl RefUnwindSafe for SecurityAlert
impl Send for SecurityAlert
impl Sync for SecurityAlert
impl Unpin for SecurityAlert
impl UnsafeUnpin for SecurityAlert
impl UnwindSafe for SecurityAlert
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
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