OpenSCAP is an open-source implementation of the Security Content Automation Protocol (SCAP) that evaluates a system against machine-readable security policies and reports which rules pass or fail. In Linux security, it is the standard tool for automated compliance auditing against baselines such as the CIS Benchmarks, DISA STIGs and PCI DSS profiles, and it can also generate remediation scripts for the failures it finds.
The project provides the oscap command-line scanner, the libopenscap library, a graphical front end called SCAP Workbench and integrations with configuration management. Its policies usually come from the SCAP Security Guide project, which ships ready-made content for Red Hat Enterprise Linux, Fedora, Ubuntu, Debian, SUSE and other distributions.
How OpenSCAP evaluates a system
OpenSCAP works by loading a SCAP data stream, selecting a profile and evaluating each rule’s checks on the target host. A rule describes one requirement, such as a minimum password length; its check is written in OVAL, a language that tests file contents, package versions, kernel parameters or service states.
The scanner collects the needed system facts, compares them with the expected values and assigns each rule a result such as pass, fail, notapplicable or error. It writes results in the XCCDF and ARF formats and can render a human-readable HTML report with an overall score. The table shows the main SCAP components it understands.
| Component | Purpose | Example content |
|---|---|---|
| XCCDF | Benchmarks, profiles and rule structure | CIS Level 1 server profile |
| OVAL | Machine checks of system state | Is sshd PermitRootLogin set to no |
| CPE | Identifies platforms and products | cpe:/o:redhat:enterprise_linux:9 |
| CCE | Identifiers for configuration items | Password length setting |
| CVE | Identifiers for known vulnerabilities | OVAL patch definitions |
| ARF | Standard result packaging | Results for a central dashboard |
Profiles and security baselines
A profile is a named selection of rules with tuned values inside a SCAP data stream. Choosing the profile decides what compliance means for a scan, so the same host can pass one baseline and fail another. Administrators list available profiles with oscap info before scanning.
Profiles can be tailored: rules can be disabled or values changed in a separate tailoring file, without editing the vendor content. This keeps local exceptions documented and auditable. Common profiles include the following.
| Profile | Origin | Typical audience |
|---|---|---|
| CIS Benchmark | Center for Internet Security | General hardening, Level 1 or 2 |
| DISA STIG | US Department of Defense | Government and defense systems |
| PCI DSS | Payment card industry | Systems handling card data |
| ANSSI BP-028 | French national security agency | European public sector |
| OSPP | Common Criteria protection profile | Certified product deployments |
OpenSCAP compared with other Linux audit tools
OpenSCAP differs from many audit tools because it is standards-based and policy-driven rather than heuristic. Its output maps directly to control identifiers, which auditors accept as formal compliance evidence. Tools such as Lynis offer quicker, more advisory checks, while AIDE and rkhunter address integrity and rootkit detection rather than configuration policy.
| Tool | Main focus | Output style |
|---|---|---|
| OpenSCAP | Policy compliance and vulnerability checks | XCCDF and ARF results, HTML report |
| Lynis | Hardening suggestions | Hardening index and advice |
| AIDE | File integrity monitoring | Changed file list |
| rkhunter | Rootkit detection | Warnings per test |
| auditd | Runtime event logging | Kernel audit records |
In practice, these tools are complementary. A hardened host is often scanned with OpenSCAP for compliance, monitored by auditd at runtime and checked with AIDE for unexpected file changes.
Running scans and remediation in practice
A typical scan uses oscap xccdf eval with a profile ID, a results file, a report file and the data stream path. Scans can run locally, against a remote host over SSH with the oscap-ssh wrapper, or against container images with oscap-podman.
OpenSCAP can generate fixes for failed rules as Bash scripts, Ansible playbooks or Kickstart snippets. Some installers apply a profile during installation, so a machine boots already hardened. The table maps common goals to commands.
| Goal | Command or method | Note |
|---|---|---|
| List profiles | oscap info on the data stream | Shows profile IDs |
| Scan the local host | oscap xccdf eval with a profile | Run as root for full coverage |
| Fix failures directly | Add the remediate option | Test first on staging hosts |
| Produce an Ansible playbook | oscap xccdf generate fix | Review before applying |
| Scan a container image | oscap-podman | No running container required |
Automatic remediation should never be applied blindly to production. Some rules, such as restricting kernel modules or enforcing strict mount options, can disable required functionality if the host has an unusual role.
Limitations and common misunderstandings
OpenSCAP reports conformance to a written policy, not actual security. A host can score 100 percent and still run a vulnerable application, because the scan only checks what the content describes.
- Outdated content produces misleading results, so the SCAP Security Guide package must match the distribution release.
- Notapplicable results are often misread as passes, although the rule simply did not apply.
- Scores are not comparable across profiles, because rule weights and counts differ.
- Manual rules cannot be automated and still require a human review.
- Running without root hides many checks and inflates error counts.
Vulnerability scanning with OpenSCAP also depends on vendor OVAL feeds. These feeds describe fixed package versions, so a scan detects missing patches only for software shipped by the distribution. Applications installed from source, language package managers or containers built elsewhere fall outside that coverage and need a separate vulnerability scanner to close the gap.
The simple explanation
OpenSCAP is like an inspector with an official checklist. The checklist says how a secure computer should be set up: which settings must be on, which must be off, and which software must be updated. The inspector goes through the computer line by line and writes a report that shows what is correct and what needs fixing.
It can even hand over a repair plan for the problems it found. The checklist itself comes from respected security organizations, so the report means something to auditors.
How it is used in practice
A hospital IT team manages 120 Red Hat Enterprise Linux servers and must prove to auditors that they follow the CIS Level 1 server baseline. Each night, a scheduled job runs OpenSCAP on every server with the CIS profile and a tailoring file that documents two approved exceptions, then collects the ARF results centrally.
The first scan shows an average score of about 71 percent, mostly due to weak password aging and unused services. The team generates an Ansible playbook from the results, tests it on staging and rolls it out over two weeks. Follow-up scans reach above 95 percent, and the HTML reports become the evidence package for the annual audit.