Skip to main content

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 lynis on 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

Run the full system audit

Run Lynis audit
Lynis runs all tests interactively and prints results to stdout. The full report is saved to /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

Finding: Lynis warns that root login is permitted or password authentication is enabled.
Harden SSH
Finding: ASLR disabled, IP forwarding enabled unnecessarily, or core dumps allowed.
Apply kernel hardening via sysctl
Finding: auditd not installed or not running — system activity is not being logged.
Install and enable auditd
Add basic audit rules
Finding: Files or directories are world-writable, creating privilege escalation risk.
Find world-writable files
Finding: Build tools (gcc, cc) present on a production node — unnecessary attack surface.
Remove compilers from production hosts

Hardening Index Targets

Run Lynis immediately after provisioning a new node and again after applying the hardening guide. Use the score delta to confirm controls are applied correctly.

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