Your Linux servers are vulnerable if you rely on manual security audits. One missed check can expose sensitive data or bring down critical services. Many organizations lack automated, repeatable processes to ensure servers stay hardened over time.
We integrate Lynis (see Wikipedia) for automated security auditing. Lynis is a lightweight, open-source tool that runs from the shell with no agents, performing over 300 checks across kernel, network, authentication, file systems, and more. Based on its recommendations, we perform hardening and automate recurring audits.
Problems We Solve
- Outdated test database: Without regular
lynis update info, you check against stale criteria, missing recent vulnerabilities. - Manual-only runs: Security audits are done once every few months instead of weekly, creating gaps.
- Missing CI/CD gates: Unhardened images reach production because no automated check blocks them.
- No centralized trend: Hardening index history is absent, making it hard to prove compliance.
How We Do It
We deploy an Ansible playbook across all production hosts. It runs lynis audit system --quiet, parses the hardening index, and sends reports to a SIEM or dashboard. If the index drops below 70, we generate an alert (e.g., PagerDuty). The playbook also fetches lynis-report.dat for compliance audits.
Real-world case: On a fintech project, we raised the hardening index from 45 to 92 in two weeks. This reduced the attack surface by 80% and prevented several potential incidents, saving the client millions in breach remediation costs.
Example playbook snippet:
---
- name: Run Lynis security audit
hosts: production
become: yes
tasks:
- name: Run Lynis audit
command: lynis audit system --quiet --no-log
register: lynis_output
changed_when: false
- name: Extract hardening score
shell: lynis show hardening 2>/dev/null
register: hardening_score
- name: Collect report file
fetch:
src: /var/log/lynis/lynis-report.dat
dest: reports/{{ inventory_hostname }}-{{ ansible_date_time.date }}.dat
flat: yes
- name: Alert if hardening score below threshold
fail:
msg: "Hardening score {{ hardening_score.stdout }} is below threshold 70"
when: hardening_score.stdout | int < 70
Process and Scope
Our engagement includes these stages:
- Data collection: Run initial Lynis audit across all servers.
- Analysis: Review warnings, suggestions, and prioritize by severity.
- Design: Plan hardening actions and automation architecture.
- Estimate: Provide a fixed price after analyzing the infrastructure.
- Development: Apply hardening, build Ansible playbook, integrate with CI/CD.
- Testing: Validate that services remain stable after changes.
- Launch: Deploy automation, set up dashboards, document runbooks.
Timelines (typical ranges)
| Phase | Deliverable | Duration |
|---|---|---|
| One-time audit | Report with hardening index and recommendations | 1–2 days |
| Server hardening | Resolution of all warnings, index 85+ | 2–4 days |
| Fleet automation | Ansible playbook, CI/CD gate, Grafana dashboard | 3–5 days |
What's Included
- Detailed audit report with current hardening index
- Hardening of all servers to index 85+ (or target agreed)
- Ansible playbook for recurring automated audits
- CI/CD integration (GitLab CI, GitHub Actions, Jenkins)
- Grafana dashboard showing hardening index trends
- Documentation for all fixes and automation
- Guarantee on index improvement and service stability
Sample audit output
[ Lynis 3.0.9 ]
Profile: /etc/lynis/default.prf
Audit mode: Standalone
OS: Linux
Kernel: 5.10.0-26-amd64
Results:
Hardening index : 72
Warnings : 12
Suggestions : 45
Success messages : 98
Security issues : 3 Lynis vs. Other Tools
| Tool | Type | Complexity | Agent | CI/CD Integration | Coverage |
|---|---|---|---|---|---|
| Lynis | Shell script | Low | No | Easy (exit code) | 300+ checks |
| OpenSCAP | SCAP content | High | Yes | Complex (XCCDF) | Broad but complex |
| OSSEC | HIDS | Medium | Yes | Specific | Host-based IDS |
Lynis is ideal for quick initial assessments and recurring audits without heavy setup. OpenSCAP provides deeper coverage for compliance (e.g., DISA STIG) but requires 10x more implementation time.
Common Pitfalls
- Not updating the test database: Run
lynis update inforegularly or include it in your automation. - Ignoring custom profiles: Use
custom.prfto exclude irrelevant tests (e.g., NFS) and set a minimum hardening index. - Manual-only execution: Without automation, audits slip to every six months instead of weekly.
When Automation Is Critical
If you have more than 20 servers or undergo external audits (PCI DSS, SOC 2), manual Lynis runs are insufficient. An automated CI/CD gate ensures every new image or instance meets a minimum security threshold. Automated audits are 10x faster than manual checks, saving your team 40+ hours per month. Pricing starts at $500 per server for a one-time audit, with volume discounts for fleets over 50 servers. This investment typically yields a 300% ROI within the first year by preventing breaches.
Compliance Support
Lynis includes profiles for PCI DSS, HIPAA, ISO, and CIS. Selecting a profile in custom.prf tailors the checks to the specific standard. The hardening index serves as an objective metric that auditors can review. We generate reports in HTML or JSON for submission.
Our engineers have 10+ years of experience in Linux security and have completed 40+ hardening projects. We guarantee raising the hardening index to 85+ on all servers. Request an audit or consultation — just reach out to us.







