CIS Benchmarks and DISA STIGs list hundreds of Linux settings each, and applying them by hand across a fleet produces drift, broken servers and audit evidence nobody trusts. OpenSCAP, the SCAP Security Guide content from the ComplianceAsCode project, and Canonical's Ubuntu Security Guide (USG) turn those benchmarks into machine readable checks and generated remediation. This guide explains how the pieces fit, which profiles exist, how to scan locally, remotely and in containers, how to tailor a profile without forking it, how to remediate safely given Red Hat's warning that remediation can make a system non-functional, and how to turn scan results into metrics and audit evidence. It is for Linux platform teams, compliance engineers and auditors. What the settings themselves do is covered in the Linux Server Hardening Guide.
Key takeaways
- Scan with the data stream, not a spreadsheet. The SCAP source data stream (for RHEL 9,
/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml) carries the checks, profiles and fixes in one file, so scans and remediation stay consistent. - Tailor instead of skipping rules ad hoc. A tailoring file records every deviation from CIS or STIG with its reason, produced by
autotailor, SCAP Workbench orusg generate-tailoring, and the base content stays untouched. - Generate fixes, review them, then apply.
oscap xccdf generate fixbuilds an Ansible playbook or Bash script for failed rules only; Red Hat provides no automated way to revert hardening changes. - Harden at build time. Applying a profile to a fresh image is far safer than remediating a long running server, which Red Hat supports only on systems in their default configuration.
- Keep ARF results as evidence. ARF output records the asset, benchmark, profile, timing and rule results with CCE identifiers, which is what auditors and dashboards need.
How the SCAP toolchain fits together
SCAP (Security Content Automation Protocol) is a NIST maintained suite of specifications for expressing and processing configuration and vulnerability data. NIST lists SCAP 1.3 as a released version with SCAP 1.4 in development. The components practitioners meet are XCCDF (the checklist: rules, groups, profiles and values), OVAL (the low level tests that inspect files, packages and settings), CPE (platform applicability), CCE (configuration identifiers) and ARF (the result format).
| Component | What it is | Where you meet it |
|---|---|---|
OpenSCAP oscap | NIST validated SCAP scanner; evaluates XCCDF and OVAL, writes reports and remediation | Package openscap-scanner on RHEL family; available on Debian, Ubuntu and SUSE |
| SCAP Security Guide (SSG) | Built content from the ComplianceAsCode project: data streams, Ansible playbooks, Bash fixes and HTML guides | Package scap-security-guide; playbooks under /usr/share/scap-security-guide/ansible/ |
| ComplianceAsCode | Upstream project writing rules in YAML with OVAL checks, Ansible and Bash fixes, and CEL content for Kubernetes and OpenShift compliance-operator | Covers RHEL, Fedora, Ubuntu, Debian, SLES and others |
| Ubuntu Security Guide (USG) | Canonical's tool for auditing and hardening Ubuntu against CIS and DISA STIG, introduced with Ubuntu 20.04 | usg audit, usg fix, usg generate-tailoring; reports in /var/lib/usg/ |
| SCAP Workbench | Graphical front end for scanning, tailoring and remediation, with less functionality than oscap | Package scap-workbench |
autotailor | Command line tool that writes a tailoring file extending a base profile | Shipped with OpenSCAP |
| CIS-CAT Pro and Lite | CIS's own assessor for CIS Benchmarks; Pro needs CIS SecureSuite membership, Lite is free for select technologies | Used where an assessment directly from CIS is required |
Aligned is not certified. The SSG CIS profile for RHEL 9 Level 1 Server states that it "aligns to" the Level 1 Server configuration of the CIS Red Hat Enterprise Linux 9 Benchmark v2.0.0 (released 2024-06-20). Version alignment matters: when CIS or DISA publish a new release, the SSG profile follows in a later content update, so record which benchmark version each scan claims. For background on the benchmarks themselves see the CIS Benchmarks Guide and the DISA STIG Guide.
Choosing a profile
List the profiles in a data stream with oscap info /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml and inspect one with oscap info --profile <id>. Profile IDs take the form xccdf_org.ssgproject.content_profile_<name>, and oscap accepts the suffix alone. The table shows profiles present in upstream ComplianceAsCode content as checked on 27 October 2026; the set shipped in your distribution package depends on its version.
| Profile ID suffix | Title (upstream) | Typical use |
|---|---|---|
cis_server_l1 | CIS RHEL 9 Benchmark for Level 1 - Server | Default baseline for most servers |
cis | CIS RHEL 9 Benchmark for Level 2 - Server | Higher assurance servers; more breakage risk |
cis_workstation_l1, cis_workstation_l2 | CIS RHEL 9 Level 1 and Level 2 - Workstation | Desktop builds |
stig, stig_gui | DISA STIG for RHEL 9 (V2R9 upstream), with and without GUI | US Department of Defense and contractors; strict baseline elsewhere |
pci-dss | PCI-DSS v4.0.1 Control Baseline for RHEL 9 | Cardholder data environments |
ospp | Protection Profile for General Purpose Operating Systems | Common Criteria aligned deployments |
anssi_bp28_high (and lower levels) | ANSSI-BP-028 | French public sector guidance |
e8 | ACSC Essential Eight | Australian organisations |
hipaa | HIPAA | US healthcare; technical safeguards only |
Ubuntu: cis_level1_server, cis_level2_server, cis_level1_workstation, cis_level2_workstation, STIG | CIS Ubuntu Linux 24.04 LTS Benchmark profiles; Canonical Ubuntu 24.04 LTS STIG (V1R6 upstream) | Ubuntu fleets via USG or oscap |
Decision guidance
- CIS Level 1 or Level 2: Level 1 is designed to be practical with limited service impact; Level 2 adds controls such as stricter audit and partitioning that need design work. Start every server at Level 1 and add Level 2 rules per role through tailoring.
- CIS or STIG: choose STIG when a contract or authorising official requires it (it produces findings that DISA STIG Viewer can import with
--stig-viewer). Otherwise CIS Level 1 plus selected STIG rules usually gives similar protection with less friction. - Regulatory profiles: PCI-DSS and HIPAA profiles cover only the operating system tier of those regimes. They are useful evidence, not proof of compliance with the whole standard.
- oscap or USG on Ubuntu: USG packages tested Canonical content with simpler commands and is aimed at Ubuntu Pro customers; plain
oscapwith ComplianceAsCode content suits mixed estates that want one toolchain. - Small vs large estates: a small team can scan with
oscap-sshfrom one host and fix through generated Ansible. A large estate should bake the profile into images, scan from configuration management or a management platform, and stream ARF results into a central store.
Running scans: local, remote and container
- Local compliance scan:
oscap xccdf eval --profile cis_server_l1 --results-arf arf.xml --report report.html /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml. Results per rule are pass, fail, notchecked (manual verification needed), notapplicable, notselected, error or unknown. - Remote scan:
oscap-ssh <user>@<host> 22 xccdf eval ...copies content to the target, runs the evaluation there and downloads results. OpenSCAP must be installed on the target. - Containers and images:
oscap-podman <image-or-container-id> xccdf eval --profile <id> --report report.html <ds.xml>runs as root on Fedora and RHEL 8 or later. The olderoscap-dockermounts the file system read only and changes nothing inside the container. - Vulnerability scan with OVAL: download Red Hat's OVAL feed (
https://www.redhat.com/security/data/oval/v2/RHEL9/rhel-9.oval.xml.bz2), decompress it and runoscap oval eval --report vulnerability.html rhel-9.oval.xml. Red Hat recommends its own OVAL definitions because its severity ratings do not map directly to CVSS. - Selective runs:
--rule(repeatable) and--skip-rulehelp when debugging a single failed check. - Remote content: some data streams reference remote resources such as OVAL feeds.
--fetch-remote-resourcesdownloads them, and the manual advises using it only when you trust the content; on air gapped hosts use--local-fileswith pre-downloaded copies.
Where identity fits: the scanning account
Compliance scanning needs root level read access to every host, and remediation needs root write access. The account that oscap-ssh, Ansible or a management agent uses is therefore one of the most privileged non-human identities in the Linux estate. Use a dedicated account per scanning system, SSH certificates or keys held in a vault rather than on a shared jump host, sudo rules limited to the scanner and remediation commands with logging, and separate credentials for read only scanning and remediation. Rotate them and alert on interactive use. See the Linux Service Accounts and Keytab Management Guide, the SSH Key Management Guide and the sudo and sudoers Security Guide.
Tailoring profiles without forking them
Every real estate deviates from the benchmark somewhere: a different password policy, a partition layout that cannot change, a service the business needs. Tailoring records those deviations in a separate XCCDF tailoring file that extends a base profile, so the vendor content can be updated without merging your edits. Red Hat notes tailoring can change rule parameters, exclude rules and include extra rules from the data stream, but cannot create new rules.
- Generate the tailoring file: on RHEL family systems use
autotailorwith the data stream and base profile, for example selecting or unselecting rules with-s/-u, changing values with-v VAR=VALUEand naming the result with-p; on Ubuntu runusg generate-tailoring cis_level1_server tailor.xml. - Edit values and selections: in USG files, change a
set-value(Canonical's example sets the faillock deny count) or flipselected="true"to"false"on anxccdf:selectline. - Document each deviation: keep a register entry per change with reason, risk owner and compensating control. The tailoring file says what changed; the register says why.
- Scan with it:
oscap xccdf eval --tailoring-file tailoring.xml --profile <tailored-profile-id> ..., passing the tailored profile ID, not the original. On Ubuntu,usg audit --tailoring-file tailor.xmlandusg fix --tailoring-file tailor.xml. - Version control and distribute: store tailoring files with the infrastructure code. SCAP Workbench can also package content as an RPM for hosts that cannot be scanned remotely.
Remediation without breaking production
Red Hat's documentation carries two warnings that should shape every remediation plan: remediation can make a system non-functional, and Red Hat provides no automated way to revert hardening changes. Remediation is supported only on systems in their default configuration, and may not reach compliance on systems altered after installation.
| Method | Command | Best for | Risk |
|---|---|---|---|
| Scan time remediation | oscap xccdf eval --profile <id> --remediate <ds> | Fresh images and lab builds | Highest: changes apply immediately with no review |
| Prebuilt profile playbook | ansible-playbook ... /usr/share/scap-security-guide/ansible/rhel9-playbook-<id>.yml | Image pipelines and new hosts | Applies the whole profile, including rules you may have tailored out |
| Results based Ansible | oscap xccdf generate fix --fix-type ansible --result-id <id> --output fix.yml results.xml | Existing servers | Lower: only failed rules; review before running |
| Results based Bash | same with --fix-type bash; Ubuntu: usg generate-fix <profile> --output fix.sh | Hosts without Ansible | Scripts are harder to make idempotent and to review |
| USG fix | usg fix <profile> or with --tailoring-file | Ubuntu hosts in a pilot ring | Modifies the system directly |
Phased rollout
- Baseline scan only: scan a representative sample per role with the chosen profile and save ARF. No changes.
- Triage failures: group failed rules into "fix", "tailor out with reason" and "manual check". Rules marked notchecked need a documented manual procedure.
- Build the golden image: apply the tailored profile in the image pipeline (Kickstart, Image Builder, Packer or cloud image build), then scan the image and any container base images with
oscap-podman. - Pilot ring on existing servers: generate results based fixes, review them, take a snapshot or backup, apply to a small ring and run application smoke tests. Rules touching SSH, PAM, sudo, audit, mount options, cryptographic policy and firewall settings cause most outages; review those first.
- Widen in rings: expand by role and environment, rescanning after each ring.
- Rollback: because there is no automated revert, rollback is your snapshot, image rebuild or the inverse configuration in your own configuration management. Keep console access for SSH and PAM changes.
- Continuous scanning: schedule scans (weekly at minimum, and after every patch cycle) and treat new failures as drift.
Reporting, metrics and audit evidence
An HTML report is for people; XCCDF results and ARF are for machines. ARF records the asset, the benchmark and profile, evaluation start and end times, platform CPEs and per-rule results with identifiers such as CCE, and oscap xccdf generate report arf.xml rebuilds an HTML report from it later. Store ARF centrally with the content version and tailoring file hash, so you can show exactly what was checked.
- Compliance score by role: percentage of selected rules passing per profile and server role, tracked over time.
- Critical rule failures: count of failed high severity rules (for example SSH root login, audit configuration, SELinux or AppArmor state) across the fleet, target zero.
- Scan coverage: percentage of Linux hosts and images with a scan in the last 7 days.
- Drift rate: number of rules that passed last scan and fail now, per week.
- Exception age: number of tailored-out rules without a review in the last 12 months.
- Mean time to remediate: days from first failure to pass for high severity rules.
Framework mapping
| Framework | Reference | How scanning supports it |
|---|---|---|
| NIST SP 800-53 Rev. 5 | CM-2 Baseline Configuration; CM-6 Configuration Settings; CM-6(1) Automated Management, Application, and Verification | Profiles as the documented baseline; oscap as automated verification |
| NIST SP 800-53 Rev. 5 | CA-7 Continuous Monitoring; CA-2 Control Assessments; RA-5 Vulnerability Monitoring and Scanning | Scheduled compliance scans, ARF evidence, OVAL vulnerability scans |
| NIST CSF 2.0 | PR.PS-01; ID.RA-01; ID.IM-01 | Configuration management, vulnerability identification, improvement from assessment |
| CIS Controls v8.1 | Control 4 Secure Configuration; Control 7 Continuous Vulnerability Management | Benchmark based configuration and recurring assessment; see the CIS Control 4 Secure Configuration of Enterprise Assets and Software Guide |
| ISO/IEC 27001:2022 | Annex A 8.9 Configuration management; 8.8 Management of technical vulnerabilities | Defined baselines, monitoring of configuration and vulnerabilities |
Common failure patterns
- Running
--remediateon production: a full profile applied to a long running server changes SSH, PAM and mount options at once, locking out administrators or stopping applications, with no automated revert. - Skipping rules instead of tailoring: teams edit the data stream or ignore failures in reports. Next content update overwrites the edits and the exceptions are undocumented.
- Treating the score as the goal: chasing 100% leads to disabling rules that are inconvenient rather than fixing them, while notchecked rules that need manual checks are never done.
- Stale content: scanning with an old
scap-security-guidepackage claims a benchmark version that has since been revised. Record content versions and update with the OS. - Over-privileged scanning credentials: a shared root SSH key for the scanner sits on a jump host, so whoever compromises that host can reach every server. Use per-system credentials with scoped sudo.
- Images not scanned: servers are hardened but container base images and cloud images are not, so every new workload starts non-compliant.
Practitioner checklist
- Pick one profile per role (usually CIS Level 1 Server) and record the benchmark and content versions.
- Install
openscap-scannerandscap-security-guide(or USG on Ubuntu) through configuration management. - Run a baseline scan with
--results-arfand--reportbefore changing anything. - Record every deviation in a tailoring file and a reasoned exception register.
- Apply the tailored profile in image pipelines and scan images and containers with
oscap-podman. - Remediate existing servers only with reviewed, results based Ansible or Bash, in pilot rings, with snapshots.
- Use dedicated, vaulted, sudo scoped credentials for scanning and separate ones for remediation.
- Schedule recurring scans and OVAL vulnerability scans, and stream ARF results to a central store.
- Report compliance by role, critical failures, coverage, drift and exception age.
Standards and references
- NIST: Security Content Automation Protocol (SCAP)
- Red Hat: Security hardening, Scanning the system for configuration compliance and vulnerabilities (RHEL 9)
- OpenSCAP: OpenSCAP User Manual (1.3)
- ComplianceAsCode: content repository
- Canonical: Ubuntu Security Guide documentation
- Canonical: USG CIS profile customization
- CIS: CIS-CAT Pro
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: CIS Benchmarks Guide · DISA STIG Guide · Red Hat Enterprise Linux Security Hardening Guide · Ubuntu Server Security Hardening Guide · Linux Kernel Hardening and sysctl Guide