I installed all OpenSCAP packages on RHEL 9.2 VM and then remotely evaluated & remediated the CIS level 1 Server profile benchmarks without any issues. The issue only occurs when I try to use a custom profile that I created using the autotailor command. Below is the error I ran into.
The reason for customizing the profile is there are some benchmarks that we need to exclude from the default Level 1 Server profile.
All commands I am using are from the OpenSCAP user manual (https://static.open-scap.org/openscap-1.3/oscap_user_manual.html#_creating_tailoring_files)
[root@localhost openscap]# oscap-ssh root@44.x.x.xx 22 xccdf eval --remediate --profile xccdf_org.ssgproject.content_profile_ssg-ubuntu2204-ds-1.2-custom --results ssg-ubuntu2204-ds-1.2-remediation-custom-results.xml --results-arf ssg-ubuntu2204-ds-1.2-arf-custom-results.xml ssg-ubuntu2204-ds-1.2-tailoring_1.xmlConnecting to 'root@44.6.0.154' on port '22'...root@44.x.x.xx's password: Connected!Copying input file 'ssg-ubuntu2204-ds-1.2-tailoring_1.xml' to remote working directory '/tmp/tmp.8KTqEvg4Pj'...ssg-ubuntu2204-ds-1.2-tailoring_1.xml 100% 656 1.2MB/s 00:00 Starting the evaluation...OpenSCAP Error: Unable to open file: '/tmp/tmp.8KTqEvg4Pj/file:///usr/share/openscap/ssg-ubuntu2204-ds-1.2.xml' [../../../src/source/oscap_source.c:284]Unable to open file: '/tmp/tmp.8KTqEvg4Pj/file:///usr/share/openscap/ssg-ubuntu2204-ds-1.2.xml' [../../../src/source/oscap_source.c:284]Unable to open file: '/tmp/tmp.8KTqEvg4Pj/file:///usr/share/openscap/ssg-ubuntu2204-ds-1.2.xml' [../../../src/source/oscap_source.c:284]Unable to open file: '/tmp/tmp.8KTqEvg4Pj/file:///usr/share/openscap/ssg-ubuntu2204-ds-1.2.xml' [../../../src/source/oscap_source.c:284]Unable to open file: '/tmp/tmp.8KTqEvg4Pj/file:///usr/share/openscap/ssg-ubuntu2204-ds-1.2.xml' [../../../src/source/oscap_source.c:284]Unrecognized document type for: /tmp/tmp.8KTqEvg4Pj/file:///usr/share/openscap/ssg-ubuntu2204-ds-1.2.xml [../../../src/source/oscap_source.c:330]Unable to open file: '/tmp/tmp.8KTqEvg4Pj/file:///usr/share/openscap/ssg-ubuntu2204-ds-1.2.xml' [../../../src/source/oscap_source.c:284]Unable to open file: '/tmp/tmp.8KTqEvg4Pj/file:///usr/share/openscap/ssg-ubuntu2204-ds-1.2.xml' [../../../src/source/oscap_source.c:284]Invalid (null) ((null)) content in /tmp/tmp.8KTqEvg4Pj/file:///usr/share/openscap/ssg-ubuntu2204-ds-1.2.xml [../../../src/XCCDF/xccdf_session.c:628]oscap exit code: 1Copying back requested files...File "/tmp/tmp.8KTqEvg4Pj/results.xml" not found.Failed to download '/tmp/tmp.8KTqEvg4Pj/results.xml'Failed to copy the results file back to local machine![root@localhost openscap]#
The end goal is to be able to use a custom CIS Level 1 Server profile to both evaluate and remediate an Ubuntu 22.04 VM