In Part 1 of this trilogy, we covered how to generate meaningful security telemetry from the Linux kernel — auditd for syscall auditing, Falco for runtime threat detection, and Tetragon for eBPF-based observability and enforcement. We now have audit sources producing high-quality security events.
None of that matters if the logs stay on the host.
An attacker who gains root on a system can trivially tamper with local log files. They can truncate /var/log/audit/audit.log, stop the auditd daemon, or simply wipe the entire /var/log directory. If your security telemetry only exists locally, you lose visibility at the exact moment you need it most. This article covers how to build a centralized log collection pipeline that ensures your security data survives even when individual hosts don’t.
Why Centralized Collection Is Non-Negotiable
The argument for centralized logging isn’t about convenience — it’s about survivability. Consider the attack timeline:
| Phase | What the Attacker Does | What Happens to Local Logs |
|---|---|---|
| Initial access | Exploits a vulnerability | Logs are still intact |
| Privilege escalation | Gains root | Attacker can now modify logs |
| Defense evasion | Clears/tampers with audit trail | Local evidence is destroyed |
| Lateral movement | Pivots to other hosts | Each compromised host loses logs |
| Impact | Achieves objective | Forensics has nothing to work with |
The window between initial access and log tampering can be minutes. If your logs are forwarded to a central collector in near real-time, the attacker’s actions are already recorded off-host before they can cover their tracks.
Centralized logging turns a host compromise from a blind spot into an observable event.
Beyond incident response, centralized collection enables:
- Cross-host correlation — detecting lateral movement requires seeing events from multiple hosts together
- Long-term retention — individual hosts rarely have the storage for months of audit data
- Compliance — PCI-DSS, HIPAA, and SOC2 all require centralized, tamper-evident log storage
- Detection engineering — SIEM rules need a unified data source to correlate against
The Pipeline Architecture
Before diving into individual tools, let’s establish the full architecture. A production log pipeline has five stages:
┌─────────────────────────────────────────────────────────────────────────┐
│ LOG PIPELINE ARCHITECTURE │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌───────────┐ ┌─────────────────┐ │
│ │ SOURCE │───▶│ AGENT │───▶│ TRANSPORT │───▶│ STORAGE + INDEX │ │
│ └──────────┘ └──────────┘ └───────────┘ └─────────────────┘ │
│ │
│ auditd Wazuh agent rsyslog OpenSearch / │
│ Falco journald Wazuh API Elasticsearch │
│ Tetragon rsyslog TCP/TLS Wazuh indexer │
│ kernel logs Filebeat HTTPS Kibana / Dashboards│
│ syslog │
│ │
└─────────────────────────────────────────────────────────────────────────┘
Detail flow for a single host:
┌────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ auditd │────▶│ journald │────▶│ rsyslog │────▶│ Wazuh │
│ kernel │ │ (local │ │ (forward │ │ Manager │
│ Falco │ │ broker) │ │ + TLS) │ │ │
│Tetragon│ └──────────┘ └──────────┘ └────┬─────┘
└────────┘ │ │
│ ┌──────────┐ │
└─────────▶│ Wazuh │───────────┘
│ Agent │
│ (local) │
└──────────┘
│
▼
┌───────────┐
│ OpenSearch │
│ (index + │
│ search) │
└───────────┘
Each component has a specific job. Let’s walk through them.
Stage 1: journald — The Local Log Broker
systemd-journald is the first stop for most log data on modern Linux systems. It collects messages from the kernel ring buffer, systemd services, and syslog-compatible applications into a structured binary journal.
For our purposes, journald serves as the local aggregation point. It captures:
- Kernel messages (
kmsg) - auditd events (via the audit subsystem)
- Service stdout/stderr (from systemd units)
- Syslog messages forwarded to the journal
Configuring journald for Security Use
The default journald configuration is not suitable for security logging. Adjust /etc/systemd/journald.conf:
| |
RateLimitIntervalSec=0) is necessary for security logging but can cause disk exhaustion under log flooding attacks. Monitor journal disk usage and set SystemMaxUse accordingly. In environments where DoS via log flooding is a concern, keep rate limiting enabled and whitelist critical units.The Seal=yes option enables Forward Secure Sealing (FSS), which cryptographically seals the journal at regular intervals. This makes it detectable if an attacker modifies journal entries after the fact — though it doesn’t prevent deletion.
Verifying Journal Integrity
| |
Store the verification key offline. If the host is compromised, you can use it to verify whether journal entries were tampered with before the attacker gained access.
Stage 2: rsyslog — Log Forwarding and Transformation
rsyslog is the workhorse for log forwarding. While journald handles local aggregation, rsyslog handles reliable delivery to remote collectors with features like TLS encryption, message transformation, and queue-based buffering.
Basic Forwarding Configuration
| |
TLS Configuration for Secure Transport
Never forward security logs in plaintext. Configure rsyslog with mutual TLS:
| |
Filtering and Enrichment
rsyslog can enrich logs before forwarding — adding context that aids correlation downstream:
| |
Stage 3: Wazuh — SIEM/XDR Agent for Collection and Normalization
While rsyslog handles raw log forwarding, Wazuh operates at a higher level — it’s a full SIEM/XDR platform that provides agent-based collection, log normalization, rule-based detection, and compliance monitoring. In 2025-2026, Wazuh has emerged as the dominant open-source SIEM/XDR option, eliminating vendor lock-in while providing capabilities that rival commercial alternatives.
Wazuh Architecture
┌────────────────────────────────────────┐
│ MONITORED HOSTS │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────┐ │
│ │ Wazuh │ │ Wazuh │ │Wazuh │ │
│ │ Agent │ │ Agent │ │Agent │ │
│ │ (host-1) │ │ (host-2) │ │(k8s) │ │
│ └────┬─────┘ └────┬─────┘ └──┬───┘ │
└───────┼──────────────┼──────────┼──────┘
│ encrypted │ (1514) │
▼ ▼ ▼
┌──────────────────────────────────────┐
│ WAZUH MANAGER │
│ ┌────────────┐ ┌───────────────┐ │
│ │ Analysis │ │ Rule Engine │ │
│ │ Engine │ │ (Decoders + │ │
│ │ │ │ Detection) │ │
│ └─────┬──────┘ └───────┬───────┘ │
└────────┼──────────────────┼──────────┘
│ │
▼ ▼
┌──────────────────────────────────────┐
│ WAZUH INDEXER │
│ (OpenSearch-based) │
│ │
│ Index, search, dashboards, alerts │
└──────────────────────────────────────┘
Wazuh Agent Configuration
The Wazuh agent runs on every monitored host and reads from multiple local sources. Here’s a production configuration:
| |
Connecting Part 1’s Sources to Wazuh
This is where the trilogy comes together. Each audit source from Part 1 has a specific integration path:
| Source | Log Location | Wazuh Format | What It Provides |
|---|---|---|---|
| auditd | /var/log/audit/audit.log | audit | Syscall-level events, file access, privilege escalation |
| Falco | /var/log/falco/falco.json | json | Runtime threat detection alerts (container escape, shell in container) |
| Tetragon | /var/log/tetragon/tetragon.log | json | eBPF-based process, file, and network events with enforcement actions |
| journald | Via syslog forwarding | syslog | Kernel messages, service logs, authentication events |
| kernel | /var/log/kern.log | syslog | Module loads, OOM kills, hardware errors |
Custom Wazuh Decoders for Falco Events
Wazuh needs decoders to parse non-standard log formats. Here’s a custom decoder for Falco JSON output:
| |
And a matching detection rule:
| |
Stage 4: Storage and Search — OpenSearch / ELK
The final stage is where logs land for long-term storage, indexing, and search. Wazuh ships with its own indexer based on OpenSearch, but you can also use Elasticsearch or a standalone OpenSearch cluster.
Wazuh Indexer (OpenSearch) Deployment
For a production setup with the Wazuh all-in-one stack:
| |
Index Lifecycle Management
OpenSearch supports Index Lifecycle Management (ILM) policies that automate index rotation, retention, and deletion:
| |
Log Retention Strategy
Retention is where policy meets engineering. Your retention periods should be driven by three factors:
| Driver | Typical Requirement | Impact on Storage |
|---|---|---|
| Compliance (PCI-DSS) | 1 year minimum | High — plan for ~1-5 GB/host/month |
| Compliance (HIPAA) | 6 years | Very high — consider tiered storage |
| Incident response | 90 days hot, 1 year warm | Moderate — hot storage is expensive |
| Threat hunting | 30-90 days searchable | Moderate — needs fast indexing |
| Legal hold | Indefinite when triggered | Unpredictable — needs immutable storage |
Tiered Retention Architecture
Hot tier (0-7 days) Fast NVMe, full replicas → Active investigation
Warm tier (7-30 days) Standard SSD, reduced replicas → Recent threat hunting
Cold tier (30-365 days) HDD / object storage, read-only → Compliance, forensics
Archive (1-6 years) S3/MinIO, compressed snapshots → Long-term compliance
Calculating Storage Requirements
A rough formula for planning:
Daily volume = (hosts x avg_events_per_second x 86400 x avg_event_size_bytes)
Example:
50 hosts x 20 EPS x 86400 seconds x 500 bytes = ~43 GB/day raw
With indexing overhead (~1.5x): ~65 GB/day
90-day hot+warm retention: ~5.8 TB
365-day total retention: ~23.7 TB
These numbers grow fast. This is why tiered storage and index lifecycle management aren’t optional — they’re the difference between a sustainable pipeline and one that collapses under its own weight.
Putting It All Together: End-to-End Example
Here’s the complete flow from a security event on a host to a searchable alert in your SIEM:
- auditd detects a suspicious
execve— a user runscurlto download a script from an external IP - The event is written to
/var/log/audit/audit.login auditd’s native format - Wazuh agent reads the audit log and sends the event to the Wazuh manager over encrypted TCP (port 1514)
- Simultaneously, rsyslog forwards the raw syslog to the central collector as a backup path
- Wazuh manager decodes the event — the auditd decoder parses the raw audit format into structured fields
- Wazuh rule engine evaluates the event — rule 80792 fires: “Auditd: Command executed by user” with enriched MITRE ATT&CK mapping
- The alert is indexed in OpenSearch under
wazuh-alerts-*with full metadata - A dashboard query or alert rule picks it up for analyst review
| |
Common Pitfalls
After deploying dozens of these pipelines, these are the mistakes that cost the most time:
1. Forwarding logs without TLS. Every log message in transit is readable and modifiable by anyone on the network path. This includes credentials, session tokens, and command-line arguments captured by auditd.
2. No disk queue on the forwarder. When the central collector goes down (and it will), rsyslog without a disk queue drops messages silently. The queue.type="LinkedList" and queue.saveonshutdown="on" settings from the rsyslog config above are essential.
3. Ignoring timezone consistency. If your hosts are in different timezones and your logs don’t use UTC, event correlation becomes a nightmare. Force UTC everywhere:
| |
4. Running out of storage silently. OpenSearch will go into read-only mode when disk usage hits 85% (the flood stage watermark). Set up monitoring for disk usage on your indexer nodes — an unresponsive SIEM during an incident is worse than no SIEM at all.
5. Not testing the pipeline regularly. A log pipeline that silently breaks provides false confidence. Schedule monthly end-to-end tests: generate a known event, verify it appears in the SIEM within your SLA window.
What Comes Next: Part 3
With Part 1 covering how to generate security telemetry (auditd, Falco, Tetragon) and this article covering how to collect and store it, the trilogy’s final piece is about what to do with it. Part 3 will cover detection engineering and incident response — writing SIEM detection rules mapped to MITRE ATT&CK, building automated response playbooks, and turning raw telemetry into actionable security outcomes.
Conclusion
A centralized log collection pipeline is the backbone of any Linux security operation. Without it, the audit sources from Part 1 are forensically useless the moment an attacker gains root access.
The pipeline is straightforward: journald aggregates locally, rsyslog forwards reliably over TLS, the Wazuh agent normalizes and enriches, and OpenSearch indexes for search and retention. Each layer has a specific job, and each layer fails gracefully when the next one is unavailable.
The key decisions are not technical — they’re operational: What are your retention requirements? Where do you store your immutable archive? How do you test that the pipeline is functioning? How fast must events travel from source to searchable index?
Get the plumbing right first. Detection and response are only as good as the data they operate on.
This is Part 2 of the Linux Kernel Security trilogy. See Part 1: Linux Kernel Security Auditing for generating security telemetry, and Part 3 (coming soon) for detection engineering and incident response.
References:
- Wazuh Documentation — Agent Configuration
- Wazuh Documentation — Custom Decoders and Rules
- rsyslog Documentation — Reliable Forwarding
- OpenSearch — Index State Management
- Falco Output Channels
- Tetragon — Exporting Events
- Red Hat — Configure Linux System Auditing with auditd
- Why Open Source SIEM/XDR Has Gained Popularity — Wazuh
- Neo23x0 — Best Practice auditd Configuration
