我在 RHEL 9.2 VM 上安装了所有 OpenSCAP 软件包,然后在 Ubuntu 22.04 VM 上远程评估和修复了 CIS 1 级服务器配置文件基准,没有任何问题。只有当我尝试使用我使用 autotailor 命令创建的自定义配置文件时才会出现此问题。以下是我遇到的错误。
自定义配置文件的原因是我们需要从默认的 1 级服务器配置文件中排除一些基准。
我使用的所有命令均来自 OpenSCAP 用户手册(https://static.open-scap.org/openscap-1.3/oscap_user_manual.html#_creating_tailoring_files)
[root@localhost openscap]# oscap-ssh [email protected] 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.xml
Connecting to '[email protected]' on port '22'...
[email protected]'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: 1
Copying 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]#
最终目标是能够使用自定义 CIS 1 级服务器配置文件通过 RHEL 9.2 VM 远程评估和修复 Ubuntu 22.04 VM。如能提供任何帮助,我们将不胜感激。