Overview
Lynis is an open-source security auditing tool that performs in-depth system scans directly on Linux hosts — no agent required. It checks over 300 security controls covering kernel hardening, authentication configuration, filesystem permissions, network services, software patches, and logging posture. Each scan produces a hardening index score and a prioritized list of remediation suggestions. Xloud bundles Lynis in XOS and makes it available via the XDeploy automation pipeline for both individual node audits and fleet-wide compliance sweeps.Xloud-Developed — Lynis is one of three independent scanners in Xloud SIEM — Wazuh, Lynis, and OpenSCAP run in parallel across all nodes for layered compliance coverage. Results are aggregated on the Security Posture page in Monitor Center.
Prerequisites
- SSH access to the target host (or run directly on the node)
- Lynis installed (pre-installed on XOS nodes; install via
apt install lynison guest VMs) - Root or sudo access on the target system
How Lynis Works
Lynis runs as a shell script directly on the host. It does not require a daemon, network connection, or external service. It tests the live system state — not a snapshot — and reports findings immediately.Run a Security Audit
- Single Host
- Non-Interactive (CI/CD)
- Fleet Audit (Ansible)
Run the full system audit
Run Lynis audit
/var/log/lynis.log and the report data to /var/log/lynis-report.dat.Review the hardening index
At the end of the scan output, Lynis shows:Scores above 80 indicate a well-hardened system. Scores below 60 indicate significant gaps.
Review warnings and suggestions
Filter warnings from the log
Filter suggestions
Common Findings and Fixes
SSH configuration weaknesses
SSH configuration weaknesses
Finding: Lynis warns that root login is permitted or password authentication is enabled.
Harden SSH
Kernel parameters not hardened
Kernel parameters not hardened
Finding: ASLR disabled, IP forwarding enabled unnecessarily, or core dumps allowed.
Apply kernel hardening via sysctl
Audit daemon not running
Audit daemon not running
Finding:
auditd not installed or not running — system activity is not being logged.Install and enable auditd
Add basic audit rules
World-writable files detected
World-writable files detected
Finding: Files or directories are world-writable, creating privilege escalation risk.
Find world-writable files
Compiler available on production host
Compiler available on production host
Finding: Build tools (
gcc, cc) present on a production node — unnecessary attack surface.Remove compilers from production hosts
Hardening Index Targets
Scheduled Audits
Run Lynis on a schedule to detect configuration drift:/etc/cron.weekly/lynis-audit
Next Steps
Xloud SIEM Overview
Back to the unified Xloud SIEM hub — Security Posture and Alerts dashboards
Wazuh HIDS
Add real-time intrusion detection and file integrity monitoring on top of periodic Lynis audits
OpenSCAP
Perform SCAP-based compliance scans against CIS, STIG, and PCI-DSS profiles
Compliance
Map Lynis findings to SOC 2, ISO 27001, and HIPAA compliance requirements