pub enum AuditEvent {
Authentication {
outcome: AuditOutcome,
mechanism: String,
principal: AuditPrincipal,
source: AuditEndpoint,
reason: Option<String>,
time_ms: i64,
},
AuthorizationDenied {
principal: AuditPrincipal,
source: AuditEndpoint,
resource_type: String,
resource_name: String,
operation: String,
time_ms: i64,
},
AdminOperation {
outcome: AuditOutcome,
principal: AuditPrincipal,
source: AuditEndpoint,
operation: String,
resources: Vec<AuditResource>,
time_ms: i64,
},
PrivilegedAction {Show 15 fields
outcome: AuditOutcome,
phase: PrivilegedPhase,
action: String,
target: String,
proposal_id: String,
principal: AuditPrincipal,
counterparties: Vec<AuditPrincipal>,
approver_set_fingerprint: String,
key_id: String,
signature: Vec<u8>,
signature_verified: bool,
signed_at_ms: i64,
source: AuditEndpoint,
reason: String,
time_ms: i64,
},
Lifecycle {
kind: LifecycleKind,
node_id: i64,
time_ms: i64,
},
}Expand description
A single auditable security event.
The caller supplies the times as epoch-millis, so the crate stays pure and deterministically testable.
Variants§
Authentication
AuthorizationDenied
AdminOperation
Fields
outcome: AuditOutcomeprincipal: AuditPrincipalsource: AuditEndpointresources: Vec<AuditResource>PrivilegedAction
A privileged action, with the evidence that authorised it.
A topic freeze, a thaw, an unclean leader election, and every other action behind the two-person rule write this variant. It is not named for break-glass, because a freeze is not a break-glass act and still carries the same evidence.
The record keeps the detached signature itself, not only
signature_verified. The audit log is hash-chained and its checkpoints
are Ed25519-signed, so an auditor who trusts the audit chain and holds
the operator public keys can re-verify who set every freeze from the
audit topic alone, with no broker and no raft log. That is a second,
independent copy of the proof.
proposal_id is empty when the action needed no proposal, such as a
freeze. counterparties holds the approvers and is empty for the same
case. key_id and signature are empty when the action was unsigned.
approver_set_fingerprint is the SHA-256 hex of the sorted configured
approver list, evaluated at approval time, so a later divergence of
that list is visible after the fact.
Fields
outcome: AuditOutcomephase: PrivilegedPhaseprincipal: AuditPrincipalcounterparties: Vec<AuditPrincipal>signed_at_ms: i64The timestamp that the operator’s detached signature covers.
For a topic freeze this is the record’s set_at_ms, which sits
inside the signed preimage. It is carried here because time_ms is
taken when the event is emitted, which is a different instant: an
auditor rebuilding the preimage from this record needs the stamp the
operator signed, not the one the broker logged.
0 where the event carries no signature over a timestamp, which is
every unsigned action and every break-glass act – a break-glass
approval signs the proposal’s created_at_ms and expires_at_ms
instead, and neither is a single stamp this field could hold.
source: AuditEndpointLifecycle
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn class(&self) -> AuditEventClass
pub fn class(&self) -> AuditEventClass
The OCSF class this event maps to.
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Source§fn clone(&self) -> AuditEvent
fn clone(&self) -> AuditEvent
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 AuditEvent
impl Debug for AuditEvent
impl Eq for AuditEvent
Source§impl PartialEq for AuditEvent
impl PartialEq for AuditEvent
impl StructuralPartialEq for AuditEvent
Auto Trait Implementations§
impl Freeze for AuditEvent
impl RefUnwindSafe for AuditEvent
impl Send for AuditEvent
impl Sync for AuditEvent
impl Unpin for AuditEvent
impl UnsafeUnpin for AuditEvent
impl UnwindSafe for AuditEvent
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<F> FnGhost for F
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);