Sub topic 2
Choosing a benchmark and profile for your server
This chapter assumes you can use the Linux command line, know basic systemd and package management, and have root or sudo access to a test server. You do not need to have run a compliance scan yet. The next chapters cover that.
Why the choice matters
A CIS Benchmark is a long list of recommendations for one specific product and version. Two decisions control how much work you take on and how likely you are to break something:
- Which benchmark you follow (which operating system and version).
- Which profile inside that benchmark you target (how strict, and for what kind of machine).
Pick the wrong benchmark and many checks will not apply or will give wrong results. Pick a profile that is too strict for the workload and you can disable services the application needs. Pick one that is too loose and you leave real gaps.
Step 1: Match the benchmark to the operating system
CIS publishes a separate benchmark for each major distribution and release. Examples include Red Hat Enterprise Linux 9, Ubuntu 22.04 LTS, Debian 12, and SUSE Linux Enterprise Server 15. Rebuilds such as AlmaLinux and Rocky Linux usually follow the RHEL benchmark closely, but check what your scanner content supports.
Rules for choosing:
- Use the benchmark for your exact major release. A RHEL 8 benchmark does not fit a RHEL 9 host, because paths, defaults, and tools (for example the crypto policy system and the default firewall tooling) differ.
- Use the benchmark version your scanner content was built from. Benchmarks are revised over time, and recommendation numbers change between versions. When you cite "5.1.7", also record the benchmark version.
- If your distribution has no benchmark, use the closest parent distribution and document that choice as an assumption.
You can check the host before you decide:
cat /etc/os-release
ls /usr/share/xml/scap/ssg/content/ 2>/dev/nullThe first command shows the distribution and version. The second lists the SCAP content files installed by the SCAP Security Guide package, if present. The file names include the distribution, such as ssg-rhel9-ds.xml.
Step 2: Understand levels
Each benchmark divides its recommendations into levels.
| Level | Intent | Typical cost |
|---|---|---|
| Level 1 | Practical, broadly applicable settings that give clear security value with little impact on function | Low. Suitable as the default for most servers |
| Level 2 | Defense in depth for high-security environments. May reduce functionality or need more planning | Higher. Needs testing against the workload |
Level 2 includes everything in Level 1 and adds stricter items. An example is a recommendation that disables a feature many applications would normally use. Level 2 does not mean "better" for every server. It means "stricter, with a larger chance of side effects."
Step 3: Understand server and workstation profiles
Benchmarks for general-purpose operating systems also split by role:
- Server profiles assume a machine without a graphical desktop. They expect that you do not run a display server, desktop services, or similar packages.
- Workstation profiles assume an interactive desktop. They allow items a server would remove.
A profile name combines both ideas, such as "Level 1 - Server" or "Level 2 - Workstation". For a typical remote Linux server, the starting point is Level 1 - Server.
Some benchmarks use other profile families, for example those aligned with STIG content, or Level 1 and Level 2 variants for specific components. Read the profile list in the benchmark document and in your scanner content rather than assuming the names.
Step 4: Know the recommendation types
Inside a profile, every recommendation is labelled as one of two types:
- Automated: a tool can check the setting and decide pass or fail. Scanners such as OpenSCAP can evaluate these.
- Manual: a person must judge it. Examples are reviewing which software is installed or deciding whether a partition layout fits the system.
Manual items do not appear as clear pass or fail results in many scanner reports. They may show as "not checked", "informational", or be absent. Keep a list of them and review them by hand, or your compliance score will look better than your real state.
Step 5: Choose using the server's role and risk
Start from the machine, not from the benchmark. Answer these questions:
- What does the server do? A web front end, a database, a build host, and a bastion have different needs.
- What does it store or reach? Regulated data or access to other networks raises the case for Level 2.
- What is the cost of downtime during testing and after a mistake?
- Is there a compliance requirement that names a level or profile? If so, follow it as the minimum.
- Can you test on an identical non-production copy?
A practical decision path:
For most teams, the sound path is to reach Level 1 first, then add Level 2 items one group at a time. This keeps changes small, so when something breaks you know which change caused it.
Step 6: Confirm the profile exists in your scanner content
Benchmark documents and scanner content are published by different groups, and the scanner may not carry every profile in the benchmark. List what your content provides:
oscap info /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xmlIn the output, look at the "Profiles" section. Each entry has an ID such as xccdf_org.ssgproject.content_profile_cis_server_l1. The words cis_server_l1 map to Level 1 - Server, and cis alone often maps to Level 2 - Server in this content. Compare IDs to titles in the output, because naming differs between content versions.
You pass the ID to the scanner when you run an evaluation:
sudo oscap xccdf eval \
--profile xccdf_org.ssgproject.content_profile_cis_server_l1 \
--results results.xml \
--report report.html \
/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xmlIf the profile ID is not found, oscap reports an error. Re-run oscap info and copy the ID exactly.
Common mistakes
- Mixing versions. Following a benchmark PDF for one release while the scanner uses content for another gives mismatched rule numbers. Record both versions.
- Starting with Level 2 on production. Level 2 changes can disable features without warning. Test first.
- Using a Workstation profile on a server to avoid breakage. This leaves server-relevant checks unevaluated.
- Treating the score as the goal. A high percentage hides skipped manual items and any exceptions you accepted.
- Not recording the choice. Write down the benchmark name, version, level, profile ID, and date. Later chapters on drift detection and exceptions depend on this record.
A short selection record
Keep a small file with the decision, stored with your configuration management:
benchmark: CIS Red Hat Enterprise Linux 9 Benchmark
benchmark_version: <version you downloaded>
profile: Level 1 - Server
scanner_profile_id: xccdf_org.ssgproject.content_profile_cis_server_l1
scanner_content: ssg-rhel9-ds.xml
rationale: General-purpose internal web server, no regulated data
reviewed_by: <name>
date: <YYYY-MM-DD>Exercise
A team runs a database server on Ubuntu 22.04 that holds customer payment data. A colleague proposes the "Level 1 - Workstation" profile because it is least likely to break the database. What would you recommend, and why?
Show answer
Use the CIS Ubuntu 22.04 benchmark with a Server profile, not Workstation, because the host has no desktop and the Workstation profile leaves server-relevant checks unevaluated. Because the server holds payment data, target Level 2 - Server if policy or risk calls for it. Reach Level 1 - Server first, then add Level 2 items in small groups on a non-production copy. Record any item that conflicts with the database as a documented exception.
Exercise
Your scan report shows 100% of checks passed under Level 1 - Server. Why might the server still not fully meet the benchmark?
Show answer
Manual recommendations are not automatically checked and may be missing from the pass or fail count. Also, the scanner content version may differ from the benchmark version, and accepted exceptions or skipped rules can raise the score without improving security. Review the manual items by hand and confirm the versions.