5.2.5. 使用特定基准评估容器或容器镜像的安全性合规
评估容器或容器映像是否符合安全基线。支持的基线包括支付卡行业数据安全标准(PCI-DSS)和健康保险便携性和责任法案(HIPAA ) 。这也有助于识别漏洞。
先决条件
-
openscap-utils和scap-security-guide软件包已安装。 - 有对系统的 root 访问权限。
步骤
查找容器或容器镜像的 ID:
查找容器的 ID:
# podman ps -a查找容器镜像的 ID:
# podman images
根据配置集评估容器或容器镜像并保存结果:
# oscap-podman <ID> xccdf eval --report <scan_report.html> --profile <profile_ID> /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml替换:
-
使用容器或容器镜像的 ID 替换
<ID> -
使用
oscap保存扫描结果的文件名替换<scan_report.html> -
使用系统应该遵守的配置文件 ID,例如
hipaa或pci-dss替换<profile_ID>
-
使用容器或容器镜像的 ID 替换
验证
在浏览器中打开结果:
$ firefox <scan_report.html> &注意标记为
notapplicable的规则仅适用于裸机和虚拟系统,不适用于容器或容器镜像。