#[non_exhaustive]pub enum AuditEventType {
ConnectionEstablished,
ConnectionClosed,
AuthenticationAttempt,
AuthorizationCheck,
MethodInvocation,
ErrorOccurred,
SecurityViolation,
ConfigurationChange,
AdminAction,
Diagnostic,
}Expand description
Types of recorded events.
Every variant except Diagnostic is security-relevant
and is always admitted to the audit chain regardless of level filtering; see
is_security_relevant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ConnectionEstablished
Connection established
ConnectionClosed
Connection closed
AuthenticationAttempt
Authentication attempt (login, certificate validation, etc.)
AuthorizationCheck
Authorization check (access control decision)
MethodInvocation
RPC method invocation
ErrorOccurred
Error occurred during processing
SecurityViolation
Security policy violation (rate limit, size limit, banned IP, etc.)
ConfigurationChange
Configuration change (admin action)
AdminAction
System administrative action
Diagnostic
A diagnostic or operational log record carrying a human-readable message rather than a security decision.
Unlike every other variant, this one is not security-relevant, so it is subject to level filtering and may legitimately be dropped. Use it for application logging; use a specific variant for anything that belongs in the compliance record.
Implementations§
Source§impl AuditEventType
impl AuditEventType
Sourcepub const fn is_security_relevant(self) -> bool
pub const fn is_security_relevant(self) -> bool
Whether this event type is security-relevant and must therefore always reach the audit chain, regardless of any level filtering.
This is the admission policy for the crate’s two tiers: security events are recorded unconditionally, so an operational log level cannot shrink the compliance record, while diagnostic events are subject to the configured minimum level.
The match below is deliberately exhaustive with no wildcard arm: a new
variant will fail to compile until its tier is stated explicitly, rather
than silently defaulting into one.
assert!(AuditEventType::SecurityViolation.is_security_relevant());