Skip to main content

Module audit

Module audit 

Source
Expand description

Security Audit Logging system.

Provides comprehensive logging of security-related events for compliance, debugging, and threat detection.

§Spring Security Equivalent

Similar to Spring Security’s AuthenticationEventPublisher and ApplicationEventPublisher for security events.

§Example

use actix_security::http::security::audit::{AuditLogger, SecurityEvent};

// Create an audit logger
let audit_logger = AuditLogger::new()
    .with_handler(|event| {
        println!("[AUDIT] {:?}", event);
    });

// Log events
audit_logger.log(SecurityEvent::login_success("admin", "192.168.1.1"));

Structs§

AuditLogger
The main audit logger.
ClosureHandler
Handler that calls a closure.
InMemoryEventStore
In-memory event store for testing and debugging.
SecurityEvent
A security audit event.
StdoutHandler
Simple logging handler that prints to stdout.

Enums§

SecurityEventSeverity
Severity level of security events.
SecurityEventType
Security event types for audit logging.

Traits§

SecurityEventHandler
Trait for handling security events.

Functions§

audit_log
Log a security event using the global logger.
global_logger
Get the global audit logger.
init_global_logger
Initialize the global audit logger.