Raxol.Audit.Logger (Raxol v2.0.1)

View Source

Centralized audit logging system for compliance and security tracking.

This module provides a comprehensive audit trail for all security-relevant actions in the system. It integrates with the event sourcing infrastructure to ensure durability and supports various compliance frameworks.

Features

  • Automatic event correlation and enrichment
  • Configurable retention policies
  • Real-time alerting for critical events
  • Export capabilities for compliance reports
  • Integration with external SIEM systems
  • Tamper-proof event storage using cryptographic signatures

Summary

Types

config()

@type config() :: %{
  enabled: boolean(),
  log_level: :debug | :info | :warning | :error | :critical,
  buffer_size: pos_integer(),
  flush_interval_ms: pos_integer(),
  retention_days: pos_integer(),
  encrypt_events: boolean(),
  sign_events: boolean(),
  alert_on_critical: boolean(),
  export_enabled: boolean(),
  siem_integration: map() | nil
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

debug(message)

Logs a debug message.

export_logs(format, filters \\ %{}, opts \\ [])

Exports audit logs for compliance reporting.

get_statistics(time_range \\ :last_24_hours)

Gets audit statistics.

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

log_authentication(username, method, outcome, opts \\ [])

Logs an authentication attempt.

log_authorization(user_id, resource, action, outcome, opts \\ [])

Logs an authorization decision.

log_compliance(framework, requirement, activity, status, opts \\ [])

Logs a compliance-related activity.

log_configuration_change(user_id, component, setting, old_value, new_value, opts \\ [])

Logs a configuration change.

log_data_access(user_id, operation, resource_type, opts \\ [])

Logs a data access operation.

log_privacy_request(data_subject_id, request_type, status, opts \\ [])

Logs a data privacy request (GDPR).

log_security_event(event_type, severity, description, opts \\ [])

Logs a security event.

log_terminal_operation(user_id, terminal_id, action, opts \\ [])

Logs a terminal operation.

query_logs(filters \\ %{}, opts \\ [])

Queries audit logs with filters.

start_link(init_opts \\ [])

verify_integrity(start_time, end_time)

Verifies the integrity of audit logs.