Red Hat Training

A Red Hat training course is available for RHEL 8

7.11. 使用特定基准评估容器或容器镜像的安全性合规

按照以下步骤,使用特定的安全基准来评估容器或容器镜像的合规性,如操作系统保护配置文件(OSPP)、支付卡行业数据安全标准(PCI-DSS)和健康保险可移植性和责任法案(HIPAA)。

注意

oscap-podman 命令从 RHEL 8.2 开始提供。对于RHEL 8.1和8.0,请参阅 Using OpenSCAP for scanning containers in RHEL 8

先决条件

  • openscap-utilsscap-security-guide 软件包已安装。

流程

  1. 获取容器或容器镜像的 ID,例如:

    # podman images
    REPOSITORY                            TAG      IMAGE ID       CREATED       SIZE
    registry.access.redhat.com/ubi8/ubi   latest   096cae65a207   7 weeks ago   239 MB
  2. 使用 HIPAA 配置文件评估容器镜像的合规性,并将扫描结果保存到 report.html HTML 文件中

    # oscap-podman 096cae65a207 xccdf eval --report report.html --profile hipaa /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml

    如果要评估符合 OSPP 或 PCI-DSS 基准的安全合规性,请用您容器镜像的 ID 替换 096cae65a207,用 ospppci-dss 替换 hipaa 。请注意,oscap-podman 命令需要 root 权限。

验证

  • 在您选择的浏览器中检查结果,例如:

    $ firefox report.html &
注意

标记为 notapplicable 的规则是不适用于容器化系统的规则。这些规则仅适用于裸机和虚拟化系统。

其它资源

  • oscap-podman(8)scap-security-guide(8) 手册页。
  • /usr/share/doc/scap-security-guide/ 目录。