2.2. Configuring the ScanSettingBinding object


By creating a ScanSettingBinding object in the openshift-compliance namespace, you can scan your cluster by using the cis and cis-node profiles either from the command-line interface (CLI) or user interface (UI).

重要

This example uses ocp4-cis and ocp4-cis-node profiles, but OpenShift Container Platform provides additional profiles.

For more information, see "Understanding the Compliance Operator".

Prerequisites

  • You have installed the Compliance Operator.

Procedure

  • To create the ScanSettingBinding object from the CLI, perform the following steps:

    1. Create a file named sscan.yaml by using the following content:

      apiVersion: compliance.openshift.io/v1alpha1
      kind: ScanSettingBinding
      metadata:
        name: cis-compliance
      profiles:
        - name: ocp4-cis-node
          kind: Profile
          apiGroup: compliance.openshift.io/v1alpha1
        - name: ocp4-cis
          kind: Profile
          apiGroup: compliance.openshift.io/v1alpha1
      settingsRef:
        name: default
        kind: ScanSetting
        apiGroup: compliance.openshift.io/v1alpha1
    2. Create the ScanSettingBinding object by running the following command:

      $ oc create -f sscan.yaml -n openshift-compliance

      If successful, the following message is displayed:

      $ scansettingbinding.compliance.openshift.io/cis-compliance created
  • To create the ScanSettingBinding object from the UI, perform the following steps:

    1. Change the active project to openshift-compliance.
    2. Click + to open the Import YAML page.
    3. Paste the YAML from the previous example, and then click Create.

Verification

  1. Run a compliance scan in RHACS.

    For more information about how to run a compliance scan by using the compliance feature, see "Checking the compliance status of your infrastructure".

  2. Ensure that ocp4-cis and ocp4-cis-node results are displayed.
重要
  • If you are using the CLI, you can view the compliance scan results from the dashboard page.

    For more information about how to view the compliance scan results from the dashboard page, see "Viewing the compliance standards across your environment".

  • If you are using the UI, you can view the compliance scan results from both the dashboard and coverage page.

    For more information about how to view the compliance scan results from the coverage page, see "Assessing the profile compliance across clusters".

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部