Skip to content
defneo

LIVE

Best practices

Linux server hardening in 2026: the CIS checklist explained

The 20 CIS controls that really matter, how to verify them automatically and what evidence to keep for audit.

Published · Updated · 5 min read

Key takeaways

  • CIS Benchmarks are consensus-based configuration guides with a Level 1 profile (baseline, low impact) and a Level 2 profile (defence in depth).
  • Around 20 controls — SSH, firewall, updates, logging, permissions, sysctl — cover most of the practical risk.
  • Verification has to be automated and repeated: a scan done once proves nothing six months later.
  • For audit, dated reports, justified exceptions and change records matter more than the score.
  • CIS hardening maps directly onto NIS2 Art. 21(2) and ISO 27001:2022 A.8.9 (configuration management).

What CIS Benchmarks are and what Level 1 vs. Level 2 means

CIS Benchmarks are secure configuration guides published by the Center for Internet Security and built by consensus among practitioners. There are separate benchmarks for Ubuntu, Debian, Red Hat Enterprise Linux and its derivatives (Rocky, AlmaLinux), each with hundreds of numbered recommendations, including the risk explanation, the audit command and the remediation command.

Recommendations are grouped into profiles. Level 1 is the baseline: low-impact controls that almost any server can apply. Level 2 adds defence in depth — for example separate partitions for logs or stricter audit rules — at the risk of affecting some applications. For most organisations the realistic target is full Level 1 on every server and Level 2 on exposed or critical ones.

Checklist: the 20 CIS controls that really matter

The list below does not replace the official benchmark for your distribution, but it gathers the controls that, in practice, shrink the attack surface the most:

#ControlWhy it matters
1/tmp on a separate partition mounted nodev,nosuid,noexecBlocks execution from the payloads' favourite directory
2Unused filesystems disabled (e.g. cramfs, udf)Less kernel code exposed
3Unused services stopped and removedEvery open port is a door
4Legacy clients removed: telnet, rsh, talkCleartext protocols with no justification today
5Automatic security updatesMost exploits target vulnerabilities that are already fixed
6SSH: PermitRootLogin noThe attacker must guess the user name too
7SSH: key authentication, PasswordAuthentication noEliminates password brute force
8Firewall with default-deny policyOnly what is explicitly allowed reaches services
9auditd running, with rules for identity, sudo and kernel modulesTraceability for investigations
10Time synchronisation (chrony or systemd-timesyncd)Without correct time, logs cannot be correlated
11Logs forwarded to a central serverAn attacker with root deletes local logs
12Strict permissions on /etc/passwd, /etc/shadow, /etc/groupProtects password hashes
13Logging of sudo commandsYou know who did what with privileges
14AppArmor or SELinux in enforcing modeLimits what a compromised process can do
15net.ipv4.conf.all.rp_filter = 1Drops packets with spoofed sources
16ICMP redirects disabled (accept_redirects = 0)Stops an on-network attacker from rerouting traffic
17net.ipv4.tcp_syncookies = 1Resilience against SYN floods
18Password and lockout policy via PAMLimits guessing of local passwords
19cron and at restricted to authorised usersPersistence via cron is a classic technique
20Unowned files and SUID/SGID binaries inventoriedPrivilege escalation often starts here

SSH, firewall and network: where most servers are lost

If you only have time for one thing today, start with remote access. A minimally hardened sshd_config contains PermitRootLogin no, PasswordAuthentication no, a low MaxAuthTries and, where possible, AllowGroups limited to an admin group. Validate the configuration with sshd -t before restarting and keep a session open while you test — a misconfigured SSH can lock you out.

The firewall should start from default deny inbound and explicitly allow only the ports you need, ideally with SSH reachable only from the management network. The sysctl parameters in the checklist (rp_filter, ICMP redirects, syncookies) belong in a file under /etc/sysctl.d/ so they survive a reboot.

Logging, auditd and time synchronisation

Hardening is not only prevention. When something gets through, the question becomes “what happened and when”, and the answer depends on three controls that look boring: auditd with rules for identity changes, sudo usage and kernel module loading; time synchronisation, without which you cannot correlate logs across servers; and log forwarding to a central system, where an attacker with root on one server can no longer delete them.

For organisations in NIS2 scope these logs are not optional: without them you cannot reconstruct an incident for the final report to the authority. See also the step-by-step DNSC notification.

How to verify automatically: CIS-CAT, OpenSCAP and Lynis

Applied by hand, a benchmark of several hundred recommendations degrades within months: a new package, a hurried admin, an old image. That is why verification has to be automated and scheduled. Three tools are widely used:

  • CIS-CAT — the CIS tool that assesses directly against the benchmark; there is a free Lite edition and a Pro edition for CIS SecureSuite members.
  • OpenSCAP with the SCAP Security Guide content — open source, with CIS-aligned profiles for several distributions. List the available profiles with oscap info on the content file and run the assessment with oscap xccdf eval, which produces an HTML report and XML results.
  • Lynis — a general security audit (lynis audit system), useful for a first picture and for suggestions, but not a formal CIS assessment.

Whatever the tool, run scans on a schedule (for example weekly and after every major change), keep the results and watch the trend: a control that flips from “pass” to “fail” is an event to investigate.

What evidence to keep for NIS2 and ISO 27001 audits

An auditor does not want to see a server, they want to see a process. Secure configuration maps onto NIS2 Art. 21(2) point (e) — security in the acquisition, development and maintenance of systems — and point (i) — access control and asset management — as well as ISO 27001:2022 control A.8.9 (configuration management). The minimum file:

  1. The declared standard: which benchmark, which version and which profile you apply, to which server categories.
  2. Dated scan reports for every server, kept for the period set in your retention policy.
  3. The exception register: every control not applied, with justification, residual risk, who approved it and when it is reviewed.
  4. Change records linking remediations to tickets or commits.
  5. The asset inventory, so you can show that scanning covers every server, not just the ones you remember.

For the full picture of the technical controls the directive requires, see NIS2 Art. 21: the technical controls.

Common mistakes when applying the benchmark

  • Applying Level 2 straight to production without testing. Controls such as noexec on certain partitions can break legitimate installers or applications.
  • Automatic remediation without review. Remediation scripts are useful, but they must run on a test environment first, for every server image.
  • Undocumented exceptions. A control disabled “temporarily” two years ago, with no justification, is an audit finding.
  • Hardening only at install time. Without periodic scanning, configuration drift is guaranteed.

Frequently asked questions

+What is the difference between CIS Level 1 and Level 2?

Level 1 contains baseline controls with low impact on functionality, suitable for almost any server. Level 2 adds stricter defence-in-depth measures that may affect some applications and is usually applied to critical or exposed systems.

+Is a CIS Benchmark mandatory for NIS2?

NIS2 does not mandate a specific configuration standard; it requires appropriate risk-management measures. CIS Benchmarks are a recognised, easy-to-demonstrate reference, which is why they are often chosen as the internal standard.

+Which free tool can I use for verification?

OpenSCAP with the SCAP Security Guide provides CIS-aligned profiles for several distributions, and CIS-CAT Lite is the free edition of the CIS tool. Lynis is useful for a general audit but is not a formal CIS assessment.

+How often should servers be scanned?

There is no mandated frequency. In practice, a scheduled weekly scan plus one after every major change catches configuration drift quickly enough and produces continuous audit evidence.

+Can I reach 100% CIS compliance?

It rarely makes sense. Some controls conflict with your applications. What matters is that every deviation is a documented, approved exception that is reviewed periodically.

Official sources

Want to see how this looks in the platform?

Defneo collects NIS2 and AI Act evidence from the systems already running. Start with the free Community Edition or ask for a demo.

This article is for information only and is not legal advice.