Sub topic 1
What the CIS Benchmarks are and how they are organized
Prerequisites
This chapter assumes you can work on the Linux command line and edit files as root or with sudo. You should know basic systemd usage (systemctl, journalctl), file permissions, users and groups, and ports and firewalls. A test server or virtual machine is useful for the later chapters. This chapter needs only a shell.
What the CIS Benchmarks are
The Center for Internet Security (CIS) is a non-profit organization. It publishes the CIS Benchmarks, which are configuration guides for specific products such as RHEL 9, Ubuntu 22.04 LTS, Debian 12, or AWS. Volunteers from vendors, government, consultancies, and user organizations write each benchmark and review it by consensus. This differs from a vendor's own hardening guide, because no single vendor controls the result.
A benchmark is a list of recommendations. Each recommendation names one setting, explains why it matters, and gives the commands to check it and to change it. The Linux benchmarks have several hundred recommendations each. They are not a certification, and they are not a guarantee of security. They are a baseline that auditors, scanners, and security teams widely recognize.
Benchmarks are specific to a distribution and version
A benchmark targets one distribution and one major release. Paths, package names, default services, and tools such as nftables, firewalld, SELinux, and AppArmor differ between distributions. The recommendation text is therefore written for that exact platform.
Choose the benchmark by checking the OS on your server:
# Print the distribution name and version that decide which benchmark applies
. /etc/os-release
echo "$PRETTY_NAME (ID=$ID, VERSION_ID=$VERSION_ID)"Benchmarks are also versioned on their own schedule, for example "v2.0.0". Two details cause common errors:
- A scanner's content must match both the OS release and a benchmark version. Running RHEL 8 content on a RHEL 9 host produces failures that mean nothing.
- A newer benchmark version can add, remove, or renumber recommendations. When you compare scan results over time, record which version you used.
How a benchmark is organized
Every benchmark follows the same layout. The document is split into numbered sections, and recommendations inside them carry hierarchical IDs. The sections in a typical Linux benchmark map to the chapters of this tutorial:
| Section area | Typical contents |
|---|---|
| Initial setup | Filesystem modules and mount options, package updates, mandatory access control, bootloader, warning banners |
| Services | Unneeded server and client packages, time synchronization |
| Network | Kernel network parameters, unused protocols, host firewall |
| Access and authentication | SSH server, PAM, password policy, sudo, user accounts |
| Logging and auditing | journald, rsyslog, auditd, file integrity monitoring |
| System maintenance | File permissions, user and group settings |
The exact numbering varies between benchmarks. A recommendation ID such as 1.1.1.1 identifies a position in one benchmark version, not a permanent identifier.
Anatomy of a recommendation
Each recommendation uses the same fields. This is a condensed example in the benchmark's own style:
1.1.1.1 Ensure cramfs kernel module is not available (Automated)
Profile Applicability: Level 1 - Server, Level 1 - Workstation
Description: The cramfs filesystem type is a compressed read-only
Linux filesystem for embedded systems.
Rationale: Removing support for unneeded filesystem types reduces
the local attack surface of the system.
Impact: (what may stop working if you apply it)
Audit: (commands that show the current state)
Remediation: (commands or file edits that fix it)
Default Value: (the distribution's out-of-the-box setting)Read these fields as a working checklist:
- Rationale tells you the threat. Use it to decide whether the recommendation matters on your server.
- Impact is the field to read before you apply anything. It lists what may break, such as a service that needs a module or a mount option.
- Audit and Remediation are shell procedures. Scanners automate the audit step. You should still read it, because it shows exactly what a "pass" means.
- Default Value shows whether a failure is a missing change or a setting that the distribution already ships correctly.
Automated and Manual recommendations
Each recommendation has an assessment status.
- Automated means a tool can check the setting and decide pass or fail without a person. Most recommendations are Automated, and these are what OpenSCAP and CIS-CAT report on.
- Manual means the check needs human judgment. Examples are reviewing whether each installed package is justified, or confirming that a network design matches policy. Scanners usually report these as "not checked" or leave them out of the score.
A high automated score does not cover the Manual items. Keep a list of the Manual recommendations that apply to your server, and review them yourself.
Profiles at a glance
Each recommendation lists which profiles it belongs to. A profile is a subset of the benchmark that you can apply as a unit. Linux benchmarks usually define two levels, Level 1 and Level 2, and two target roles, Server and Workstation. Level 1 aims to be practical with limited impact on service. Level 2 is for environments that need stronger protection and accepts more loss of function. The next chapter covers choosing between them. For now, note that you do not apply a benchmark as a whole. You apply a profile.
Where the benchmarks fit
- CIS Controls are a separate, higher-level list of security practices. Recommendations reference the controls they support.
- STIGs are the US Department of Defense's equivalent guides. They overlap heavily with CIS but differ in detail, so do not treat a pass on one as a pass on the other.
- SCAP content is a machine-readable form of benchmark logic. OpenSCAP reads it. Several distributions ship profiles in their
scap-security-guidepackage that follow CIS guidance, and CIS also publishes its own tooling (CIS-CAT).
The PDF benchmarks are free to download after registration. Terms for commercial use of the tooling and pre-built content vary, so check the current CIS license before you build compliance reporting on them.
Common mistakes
- Using a benchmark for the wrong OS release or a different distribution.
- Applying every recommendation on a production server without reading the Impact field.
- Treating the percentage score as the goal instead of the list of failures and why each fails.
- Ignoring Manual recommendations.
Exercise
A scan reports 94% pass on your server. A colleague says the server is fully CIS compliant. Name two reasons that conclusion may be wrong, based on how benchmarks are organized.
Show answer
First, the score usually covers only Automated recommendations, so Manual recommendations were not evaluated. Second, the score applies to one profile and one benchmark version. If the scan used the wrong profile (for example Level 1 when policy requires Level 2) or content for a different OS release, the percentage does not show compliance with the benchmark you need. A third valid reason is that failures may have been waived without a documented exception.
Exercise
Which field of a recommendation should you read before applying its remediation to a production server, and why?
Show answer
The Impact field. It lists what may stop working after the change, so you can check the change against your workload before you apply it.