Skip to main content

Module security

Module security 

Source
Expand description

Structured security event logging following OWASP Logging Vocabulary.

All security events are emitted with target: "security" so operators can route them separately via RUST_LOG=security=info or a dedicated tracing Layer with per-layer filtering.

§Example

use hyperi_rustlib::logger::security::{SecurityEvent, SecurityOutcome, auth_failure};
use std::net::{IpAddr, Ipv4Addr};

// Builder pattern for full control
SecurityEvent::new("auth.failure", "bearer_validate", SecurityOutcome::Failure)
    .actor("svc-collector")
    .source_ip(IpAddr::V4(Ipv4Addr::new(10, 0, 0, 1)))
    .reason("expired_token")
    .emit();

// Convenience function for common cases
auth_failure("bearer_validate", "expired_token", Some(IpAddr::V4(Ipv4Addr::new(10, 0, 0, 1))));

Structs§

SecurityEvent
Standard security event types following OWASP Logging Vocabulary.

Enums§

SecurityOutcome
Outcome of a security event.

Functions§

access_denied
Log an access denial.
auth_failure
Log an authentication failure.
auth_success
Log an authentication success.
config_changed
Log a configuration change.
data_quality_alert
Log a data quality event — validation rejection rate threshold exceeded.
input_validation_failure
Log an input validation failure (potential attack indicator per OWASP).
rate_limit_triggered
Log a rate limit trigger.
record_dlq
Log a data quality event — record routed to DLQ.
tls_event
Log a TLS/certificate event.
token_rotated
Log a token rotation event.