Join our Newsletter — 33% off our NHI Course
Home› Guides› OpenSCAP and Linux Compliance Scanning Guide: Apply CIS…
Guide Endpoint Security

OpenSCAP and Linux Compliance Scanning Guide: Apply CIS and STIG Profiles at Scale

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 14 min read
On this page

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 or usg generate-tailoring, and the base content stays untouched.
  • Generate fixes, review them, then apply. oscap xccdf generate fix builds 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).

ComponentWhat it isWhere you meet it
OpenSCAP oscapNIST validated SCAP scanner; evaluates XCCDF and OVAL, writes reports and remediationPackage 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 guidesPackage scap-security-guide; playbooks under /usr/share/scap-security-guide/ansible/
ComplianceAsCodeUpstream project writing rules in YAML with OVAL checks, Ansible and Bash fixes, and CEL content for Kubernetes and OpenShift compliance-operatorCovers 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.04usg audit, usg fix, usg generate-tailoring; reports in /var/lib/usg/
SCAP WorkbenchGraphical front end for scanning, tailoring and remediation, with less functionality than oscapPackage scap-workbench
autotailorCommand line tool that writes a tailoring file extending a base profileShipped with OpenSCAP
CIS-CAT Pro and LiteCIS's own assessor for CIS Benchmarks; Pro needs CIS SecureSuite membership, Lite is free for select technologiesUsed 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 suffixTitle (upstream)Typical use
cis_server_l1CIS RHEL 9 Benchmark for Level 1 - ServerDefault baseline for most servers
cisCIS RHEL 9 Benchmark for Level 2 - ServerHigher assurance servers; more breakage risk
cis_workstation_l1, cis_workstation_l2CIS RHEL 9 Level 1 and Level 2 - WorkstationDesktop builds
stig, stig_guiDISA STIG for RHEL 9 (V2R9 upstream), with and without GUIUS Department of Defense and contractors; strict baseline elsewhere
pci-dssPCI-DSS v4.0.1 Control Baseline for RHEL 9Cardholder data environments
osppProtection Profile for General Purpose Operating SystemsCommon Criteria aligned deployments
anssi_bp28_high (and lower levels)ANSSI-BP-028French public sector guidance
e8ACSC Essential EightAustralian organisations
hipaaHIPAAUS healthcare; technical safeguards only
Ubuntu: cis_level1_server, cis_level2_server, cis_level1_workstation, cis_level2_workstation, STIGCIS 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 oscap with ComplianceAsCode content suits mixed estates that want one toolchain.
  • Small vs large estates: a small team can scan with oscap-ssh from 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 older oscap-docker mounts 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 run oscap 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-rule help when debugging a single failed check.
  • Remote content: some data streams reference remote resources such as OVAL feeds. --fetch-remote-resources downloads them, and the manual advises using it only when you trust the content; on air gapped hosts use --local-files with 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.

  1. Generate the tailoring file: on RHEL family systems use autotailor with the data stream and base profile, for example selecting or unselecting rules with -s/-u, changing values with -v VAR=VALUE and naming the result with -p; on Ubuntu run usg generate-tailoring cis_level1_server tailor.xml.
  2. Edit values and selections: in USG files, change a set-value (Canonical's example sets the faillock deny count) or flip selected="true" to "false" on an xccdf:select line.
  3. 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.
  4. 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.xml and usg fix --tailoring-file tailor.xml.
  5. 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.

MethodCommandBest forRisk
Scan time remediationoscap xccdf eval --profile <id> --remediate <ds>Fresh images and lab buildsHighest: changes apply immediately with no review
Prebuilt profile playbookansible-playbook ... /usr/share/scap-security-guide/ansible/rhel9-playbook-<id>.ymlImage pipelines and new hostsApplies the whole profile, including rules you may have tailored out
Results based Ansibleoscap xccdf generate fix --fix-type ansible --result-id <id> --output fix.yml results.xmlExisting serversLower: only failed rules; review before running
Results based Bashsame with --fix-type bash; Ubuntu: usg generate-fix <profile> --output fix.shHosts without AnsibleScripts are harder to make idempotent and to review
USG fixusg fix <profile> or with --tailoring-fileUbuntu hosts in a pilot ringModifies the system directly

Phased rollout

  1. Baseline scan only: scan a representative sample per role with the chosen profile and save ARF. No changes.
  2. Triage failures: group failed rules into "fix", "tailor out with reason" and "manual check". Rules marked notchecked need a documented manual procedure.
  3. 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.
  4. 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.
  5. Widen in rings: expand by role and environment, rescanning after each ring.
  6. 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.
  7. 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

FrameworkReferenceHow scanning supports it
NIST SP 800-53 Rev. 5CM-2 Baseline Configuration; CM-6 Configuration Settings; CM-6(1) Automated Management, Application, and VerificationProfiles as the documented baseline; oscap as automated verification
NIST SP 800-53 Rev. 5CA-7 Continuous Monitoring; CA-2 Control Assessments; RA-5 Vulnerability Monitoring and ScanningScheduled compliance scans, ARF evidence, OVAL vulnerability scans
NIST CSF 2.0PR.PS-01; ID.RA-01; ID.IM-01Configuration management, vulnerability identification, improvement from assessment
CIS Controls v8.1Control 4 Secure Configuration; Control 7 Continuous Vulnerability ManagementBenchmark based configuration and recurring assessment; see the CIS Control 4 Secure Configuration of Enterprise Assets and Software Guide
ISO/IEC 27001:2022Annex A 8.9 Configuration management; 8.8 Management of technical vulnerabilitiesDefined baselines, monitoring of configuration and vulnerabilities

Common failure patterns

  • Running --remediate on 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-guide package 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-scanner and scap-security-guide (or USG on Ubuntu) through configuration management.
  • Run a baseline scan with --results-arf and --report before 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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.