openscap icon indicating copy to clipboard operation
openscap copied to clipboard

Is Ubuntu 24.04 supported? Problem using `oscap xccdf generate`

Open brendanbeck62 opened this issue 2 years ago • 3 comments

Description of Problem:

There seems to be conflicting documentation about where/how to install on Ubuntu 24.04, and if it is even supported. I found that the name of the package changed from libopenscap8 to openscap-scanner here: https://github.com/OpenSCAP/openscap/blob/main/docs/manual/manual.adoc. But on the main website, it still states libopenscap8 is the package to install (https://www.open-scap.org/tools/openscap-base/#download).

I am looking into this because when attempting to generate a hardening script based on the new Ubuntu 24.04 benchamrks released by CISCAT, and getting FIX FOR THIS RULE <rule_name> IS MISSING! for every rule. Trying to figure out whether it's a bug in the benchmark files or in Oscap.

OpenSCAP Version:

OpenSCAP command line tool (oscap) 1.3.9
Copyright 2009--2023 Red Hat Inc., Durham, North Carolina.

==== Supported specifications ====
SCAP Version: 1.3
XCCDF Version: 1.2
OVAL Version: 5.11.1
CPE Version: 2.3
CVSS Version: 2.0
CVE Version: 2.0
Asset Identification Version: 1.1
Asset Reporting Format Version: 1.1
CVRF Version: 1.1

Operating System & Version:

Ubuntu 24.04

Steps to Reproduce:

$ sudo apt install openscap-scanner
$ oscap xccdf generate --verbose DEVEL --verbose-log-file out.out --profile xccdf_org.cisecurity.benchmarks_profile_Level_1_-_Server fix --fix-type bash --output harden.sh Assessor/benchmarks/CIS_Ubuntu_Linux_20.04_LTS_Benchmark_v2.0.1-xccdf.xml

Actual Results:

script full of FIX FOR THIS RULE <rule_name> IS MISSING! for every rule

Expected Results:

a valid hardening script.

brendanbeck62 avatar Sep 05 '24 17:09 brendanbeck62

Based on my quick glance at the XCCDF file, OpenSCAP is correct there is no fix for the rule. There is fix text, which appears the bash remediation script formatted in HTML, but no actual fix that OpenSCAP can use to create a remediation script.

Mab879 avatar Sep 06 '24 21:09 Mab879

I don't understand the answer to the original question. @brendanbeck62 did you get it working?

janaka avatar Sep 17 '25 23:09 janaka

Hi @janaka — following up since this stayed unanswered.

The original symptom (FIX FOR THIS RULE ... IS MISSING! for every rule) isn't a packaging or installation problem — @Mab879 diagnosed it above: the CIS benchmark XCCDF file has fix text (HTML-formatted remediation notes for humans) but no machine-readable <fix> element OpenSCAP can turn into a script. That's a limitation of that particular benchmark file, not a bug in oscap or in how it's installed.

Separately, on the packaging question that kicked this off: docs/manual/manual.adoc has since been corrected and now correctly documents the split —

# apt install openscap-scanner   (Debian 12 / Ubuntu 24.04+)
# apt install libopenscap8       (older Debian/Ubuntu)

However, the download page on open-scap.org (https://www.open-scap.org/tools/openscap-base/#download) still says unconditionally apt-get install libopenscap8 for "Debian and Ubuntu" with no version split. To be explicit about why that's a real problem and not just a style nit: on current Debian 12 / Ubuntu 24.04, libopenscap8 ships no /usr/bin files at all — it's the shared library only. The oscap binary lives exclusively in openscap-scanner on those releases (verified against the actual package contents on packages.debian.org / packages.ubuntu.com). So installing libopenscap8 alone on a current Debian/Ubuntu system does not give you a working oscap command — that's almost certainly what's still causing this exact confusion for anyone landing on the website first. I've opened OpenSCAP/website#216 to get that page corrected to match the manual.

Hope that closes the loop — happy to help further if either of you are still stuck on something specific.

rrskris avatar Jul 05 '26 16:07 rrskris