48 Auditing und Protokollierung mit AWX/Tower

48.1 Tower/AWX Logging-Konfiguration

AWX und Ansible Tower bieten umfassende Audit-Funktionen für Compliance und Sicherheitsüberwachung.

48.1.1 Aktivierung von Audit-Logging

Zentrale Log-Konfiguration in AWX:

48.1.2 Wichtige Audit-Metriken

Benutzeraktivitäten:

Projektänderungen:

Systemereignisse:

48.1.3 Log-Retention und zentrale Speicherung

Konfiguration für externe Log-Systeme:

# AWX Settings für Syslog
LOGGING:
  handlers:
    syslog:
      class: 'logging.handlers.SysLogHandler'
      address: ['logserver.example.com', 514]
      facility: 'local0'
      formatter: 'simple'

Empfohlene Retention-Zeiten:

48.1.4 Event-Benachrichtigung und Monitoring

Automatische Benachrichtigungen konfigurieren:

Beispiel-Notification-Template:

# AWX Notification für kritische Events
- name: "Security Alert"
  notification_type: "slack"
  webhook_url: "{{ slack_webhook_url }}"
  channel: "#security-alerts"
  conditions:
    - failed_job_with_elevated_privileges
    - multiple_failed_logins
    - unauthorized_inventory_changes

48.1.5 Log-Review und Compliance

Regelmäßige Review-Prozesse:

Automatisierte Compliance-Reports:

# Export von Audit-Daten für Compliance
awx-cli activity_stream list --format json \
  --created__gte="2024-01-01" \
  --created__lte="2024-12-31" > annual_audit_report.json

48.2 Integration in SIEM-Systeme

Vorbereitung für SIEM-Integration:

Beispiel für strukturierte Logs:

{
  "timestamp": "2024-06-20T10:30:00Z",
  "event_type": "playbook_execution",
  "user": "admin@example.com",
  "project": "web-deployment",
  "inventory": "production",
  "success": true,
  "duration": "120s",
  "affected_hosts": ["web01", "web02", "web03"]
}