Chapter 3. Using the Compliance Operator
3.1. Using the Compliance Operator with Red Hat Advanced Cluster Security for Kubernetes Copy linkLink copied to clipboard!
You can configure RHACS to use the Compliance Operator for compliance reporting and remediation with OpenShift Container Platform clusters. Results from the Compliance Operator are reported in the RHACS Compliance Dashboard.
The Compliance Operator automates the review of numerous technical implementations and compares them with certain aspects of industry standards, benchmarks, and baselines.
The Compliance Operator is not an auditor. To comply or certify to these various standards, you must engage an authorized auditor such as a Qualified Security Assessor (QSA), Joint Authorization Board (JAB), or other industry-recognized regulatory authority to assess your environment.
The Compliance Operator makes recommendations based on generally available information and practices that relate to such standards and can assist with remediation, but actual compliance is your responsibility. You are required to work with an authorized auditor to achieve compliance with a standard.
For the latest updates, see the Compliance Operator release notes.
3.1.1. Installing the Compliance Operator Copy linkLink copied to clipboard!
Install the Compliance Operator using Operator Hub.
Procedure
Install the Operator by performing the following steps:
-
Navigate in the web console to the Operators
OperatorHub page. - Enter compliance operator into the Filter by keyword box to find the Compliance Operator.
- Select the Compliance Operator to view the details page.
- Read the information about the Operator, and then click Install.
3.1.2. Configuring the ScanSettingBinding object Copy linkLink copied to clipboard!
Create a ScanSettingBinding object in the openshift-compliance namespace to scan the cluster by using the cis and cis-node profiles.
This example uses cis and cis-node profiles, but OpenShift Container Platform provides additional profiles. See "Understanding the Compliance Operator" in the "Additional resources" section for more information.
Procedure
Select one of the following options:
Use the CLI to create the YAML file and object. For example:
Create a file called
sscan.yamlusing the following text: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/v1alpha1Create the
ScanSettingBindingobject by running the following command:$ oc create -f sscan.yaml -n openshift-complianceIf successful, the following message is displayed:
$ scansettingbinding.compliance.openshift.io/cis-compliance created
Use the web console to create the object by performing the following steps:
-
Change the active project to
openshift-compliance. - Click + to open the Import YAML page.
- Paste the YAML from the previous example and then click Create.
-
Change the active project to
Additional resources
- Understanding the Compliance Operator
- Compliance Operator scans in OpenShift Container Platform
Optional: If you installed the Compliance Operator after installing RHACS, restart Sensor in the secured cluster by performing one of the following options:
Run the following command:
$ oc -n stackrox delete pod -lapp=sensorIn the OpenShift Container Platform web console, perform the following steps:
-
Change the active project to
stackrox. -
Navigate to Workloads
Pods. -
Locate the pod with the name starting with
sensor-, and then click ActionsDelete Pod.
-
Change the active project to
Verification
After performing these steps, run a compliance scan in RHACS and ensure that ocp4-cis and ocp4-cis-node results are displayed. See "Running a compliance scan" in the "Additional resources" section for more information.
Additional resources