CIS Fluentd Benchmark
Security configuration benchmark for Fluentd log aggregation
v1.0.0 03-2025Overview
▶This benchmark provides prescriptive guidance for establishing a secure configuration posture for Fluentd. It covers input source TLS, output encryption, secure buffering, sensitive data filtering, internal logging, monitoring endpoint restrictions, resource limits, plugin auditing, secrets management, and configuration validation.
| Section | Area | Focus |
|---|---|---|
| 1 | Installation & Identity | Version management, dedicated user |
| 2 | Input & Output Security | TLS, client cert auth, shared keys |
| 3 | Data Processing | File buffering, sensitive data filtering |
| 4 | Logging & Monitoring | Internal logs, monitoring endpoint |
| 5 | Resource & Error Management | Workers, error labels, secondary outputs |
| 6 | Plugins & Secrets | Plugin audit, environment variables |
| 7 | Maintenance & Hardening | Config validation, file permissions |
Profile Definitions
▶| Profile | Description | Intended Use |
|---|---|---|
| L1 | Level 1 — Standard | Essential security for all Fluentd deployments; minimal performance impact. |
| L2 | Level 2 — Hardened | Advanced hardening for PCI-DSS, HIPAA, or high-security environments. |
1 — Installation & Identity
▶1.1 Version & Process Security
▶This recommendation verifies that Fluentd is running the latest stable version on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Verify Fluentd version fluentd --version td-agent --version 2>/dev/null
# Install latest Fluentd curl -fsSL https://toolbelt.treasuredata.com/sh/install-ubuntu-noble-fluent-package5-lts.sh | sh # Or via gem: gem install fluentd --no-document
This recommendation verifies that Fluentd runs as a dedicated non-root user on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check Fluentd runs as dedicated user ps -eo user,pid,comm | grep -E 'fluentd|td-agent' grep -E '^User|^Group' /etc/systemd/system/fluentd.service 2>/dev/null
# Run as dedicated non-root user useradd -r -s /usr/sbin/nologin fluentd chown -R fluentd:fluentd /etc/fluentd/ chown -R fluentd:fluentd /var/log/fluentd/
2 — Input & Output Security
▶2.1 TLS & Authentication
▶This recommendation verifies that input sources use TLS with client certificate auth on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check input source configuration grep -E '<source>|@type|bind|port' /etc/fluentd/fluent.conf | head -20
# Secure input sources
<source>
@type forward
port 24224
bind 127.0.0.1
<transport tls>
cert_path /etc/fluentd/ssl/cert.pem
private_key_path /etc/fluentd/ssl/key.pem
ca_path /etc/fluentd/ssl/ca.pem
client_cert_auth true
</transport>
<security>
self_hostname fluentd-server
shared_key s3cureK3y
</security>
</source>This recommendation verifies that output destinations use TLS with hostname verification on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check output destination TLS grep -E '<match|<store|tls|ssl' /etc/fluentd/fluent.conf | head -20
# Configure TLS for outputs
<match **>
@type forward
<server>
host aggregator.example.com
port 24224
</server>
<security>
self_hostname fluentd-client
shared_key s3cureK3y
</security>
transport tls
tls_cert_path /etc/fluentd/ssl/ca.pem
tls_verify_hostname true
</match>3 — Data Processing
▶3.1 Buffering & Filtering
▶This recommendation verifies that file-based buffering with size limits is configured on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check buffer configuration grep -A10 '<buffer>' /etc/fluentd/fluent.conf
# Configure secure buffering <buffer> @type file path /var/log/fluentd/buffer/ flush_interval 5s flush_thread_count 2 retry_max_times 10 retry_wait 1s chunk_limit_size 8m total_limit_size 512m overflow_action drop_oldest_chunk </buffer>
This recommendation verifies that sensitive data is filtered from log streams on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check filtering for sensitive data grep -E '<filter|record_transformer|grep' /etc/fluentd/fluent.conf
# Filter sensitive data from logs
<filter **>
@type record_transformer
remove_keys password,secret,token,authorization,cookie
</filter>
<filter **>
@type grep
<exclude>
key message
pattern /password|credit_card|ssn/i
</exclude>
</filter>4 — Logging & Monitoring
▶4.1 Internal Logs & Metrics
▶This recommendation verifies that structured internal logging is configured on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check Fluentd internal logging grep -E 'log_level|<system>' /etc/fluentd/fluent.conf
# Configure internal logging
<system>
log_level info
suppress_repeated_stacktrace true
emit_error_log_interval 30s
<log>
format json
time_format %Y-%m-%dT%H:%M:%S%z
</log>
</system>This setting ensures that monitoring endpoint is restricted to localhost on the Fluentd log aggregation framework. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.
Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Fluentd log aggregation framework is essential for defense in depth.
# Check monitoring endpoint grep -E 'monitor_agent|prometheus' /etc/fluentd/fluent.conf
# Configure monitoring endpoint (restricted) <source> @type monitor_agent bind 127.0.0.1 port 24220 </source> # Or use Prometheus plugin: <source> @type prometheus bind 127.0.0.1 port 24231 metrics_path /metrics </source>
5 — Resource & Error Management
▶5.1 Limits & Error Handling
▶This recommendation verifies that system resource limits are configured on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check system resource limits grep -E 'workers|root_dir' /etc/fluentd/fluent.conf ulimit -n
# Configure system resource limits <system> workers 4 root_dir /var/log/fluentd </system> # In systemd unit or limits.conf: # LimitNOFILE=65536 # Set appropriate process limits
This recommendation verifies that error handling with secondary outputs is configured on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check error handling grep -E 'error_label|secondary' /etc/fluentd/fluent.conf
# Configure error handling with secondary output
<label @ERROR>
<match **>
@type file
path /var/log/fluentd/error/
append true
<buffer>
flush_interval 10s
</buffer>
</match>
</label>
# Add secondary output to critical matches:
<match important.**>
@type forward
<secondary>
@type file
path /var/log/fluentd/secondary/
</secondary>
</match>6 — Plugins & Secrets
▶6.1 Plugin Audit & Configuration
▶This recommendation ensures that only required plugins are installed with pinned versions on the Fluentd log aggregation framework. Enforcing this requirement establishes a minimum security standard and prevents insecure configurations.
Without this enforcement, the Fluentd log aggregation framework may accept insecure configurations that weaken overall security posture. Mandating this control ensures consistent protection against common attack vectors.
# Check plugin list fluent-gem list | head -30
# Audit and restrict plugins fluent-gem list # Remove unused plugins: fluent-gem uninstall fluent-plugin-unused # Only install plugins from trusted sources # Pin plugin versions: fluent-gem install fluent-plugin-elasticsearch -v 5.4.3
This recommendation verifies that secrets are not stored in plaintext configuration on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check for plaintext secrets in config grep -rn 'password\|secret\|key' /etc/fluentd/ | grep -v '#'
# Use environment variables or key management
# In fluent.conf:
# shared_key "#{ENV['FLUENTD_SHARED_KEY']}"
# Or use Fluentd's secret management:
# In systemd EnvironmentFile:
# EnvironmentFile=/etc/fluentd/fluentd.env
chmod 600 /etc/fluentd/fluentd.env7 — Maintenance & Hardening
▶7.1 Validation & Permissions
▶This recommendation verifies that configuration is validated before reload on the Fluentd log aggregation framework. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.
Failure to implement this control may leave the Fluentd log aggregation framework vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.
# Check configuration validity fluentd --dry-run -c /etc/fluentd/fluent.conf
# Validate config before reload
fluentd --dry-run -c /etc/fluentd/fluent.conf
if [ $? -eq 0 ]; then
systemctl reload fluentd
fiThis setting ensures that configuration file permissions are restricted on the Fluentd log aggregation framework. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.
Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Fluentd log aggregation framework is essential for defense in depth.
# Check file permissions
stat -c '%a %U %G' /etc/fluentd/fluent.conf
find /etc/fluentd -type f -exec stat -c '%a %n' {} \;# Restrict file permissions chmod 640 /etc/fluentd/fluent.conf chown root:fluentd /etc/fluentd/fluent.conf chmod 750 /etc/fluentd/ chmod 750 /var/log/fluentd/