Lab 18: Enterprise Audit & Reporting

Time: 45 minutes | Level: Architect | Docker: docker run -it --rm --privileged ubuntu:22.04 bash

Overview

Enterprise environments require tamper-evident, searchable audit trails. This lab covers advanced auditd rules using 64-bit syscall filtering, structured report generation with aureport, centralised log forwarding via audisp-remote, and file integrity monitoring with AIDE. You will build a complete audit-to-report pipeline suitable for SOC, PCI-DSS, and ISO 27001 compliance.


Step 1 — Install auditd and AIDE

apt-get update -qq && apt-get install -y -qq auditd audispd-plugins aide 2>/dev/null

# Verify
auditd --version 2>/dev/null || dpkg -l auditd | tail -1
aide --version 2>&1 | head -2

📸 Verified Output:

ii  auditd  1:3.0.7-1.1  amd64  User space components of the Linux Auditing System

Aide 0.17.4

Compiled with the following options:

WITH_MHASH
WITH_CURL

Step 2 — Advanced auditd Rules (64-bit Syscall Filtering)

CIS and PCI-DSS require auditing specific privileged operations. The arch=b64 filter ensures rules apply to 64-bit syscalls (and arch=b32 for 32-bit compatibility on x86_64).

📸 Verified Output:

💡 Tip: The -k key labels (e.g., identity, logins, perm_mod) are critical — they let you filter ausearch and aureport to specific event categories.


Step 3 — Load Rules and Verify

📸 Verified Output:


Step 4 — aureport: Generate Structured Audit Reports

📸 Verified Output:

📸 Verified Output:


Step 5 — Centralised Audit Log Forwarding (audisp-remote)

📸 Verified Output:

💡 Tip: For high-volume environments, use mode = forward with a queue to avoid dropped events. Consider Elasticsearch+Filebeat as an alternative centralisation layer (covered in Lab 14).


Step 6 — AIDE File Integrity Monitoring

AIDE (Advanced Intrusion Detection Environment) detects unauthorized changes to files.

📸 Verified Output:


Step 7 — AIDE Integrity Check & Scheduled Monitoring

📸 Verified Output:

📸 Verified Output:


Step 8 — Capstone: Complete Audit Reporting Pipeline

Build a daily audit report script combining auditd events + AIDE integrity findings:

📸 Verified Output:


Summary

Component
Purpose
Key Command

auditd rules

Capture system events

/etc/audit/rules.d/*.rules

arch=b64 filtering

64-bit syscall coverage

-a always,exit -F arch=b64 -S ...

Key labels (-k)

Event categorisation

ausearch --key perm_mod

aureport --auth

Authentication analysis

Logins, failed attempts

aureport --executable

Privileged command tracking

sudo/su usage

audisp-remote

Centralised log shipping

/etc/audisp/audisp-remote.conf

AIDE database init

Baseline snapshot

aideinit --yes --force

AIDE integrity check

Change detection

aide --check

Cron scheduling

Automated daily checks

/etc/cron.d/aide-integrity

Last updated