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§
- Audit
Logger - The main audit logger.
- Closure
Handler - Handler that calls a closure.
- InMemory
Event Store - In-memory event store for testing and debugging.
- Security
Event - A security audit event.
- Stdout
Handler - Simple logging handler that prints to stdout.
Enums§
- Security
Event Severity - Severity level of security events.
- Security
Event Type - Security event types for audit logging.
Traits§
- Security
Event Handler - 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.