|
| 1 | +ocp-disa-stig-compliance |
| 2 | +======================== |
| 3 | + |
| 4 | +The Compliance Operator lets OpenShift Container Platform administrators describe the required compliance state of a cluster and provides them with an overview of gaps and ways to remediate them. The Compliance Operator assesses compliance of both the Kubernetes API resources of OpenShift Container Platform, as well as the nodes running the cluster. The Compliance Operator uses OpenSCAP, a NIST-certified tool, to scan and enforce security policies provided by the content. |
| 5 | + |
| 6 | +This playbook installs Compliance Operator and enables: |
| 7 | +Various rhcos4 and ocp4 disa-stig profiles |
| 8 | +Remediate various rules under these profiles to make them compliant, ensuring validation of these profiles for CO on Power. |
| 9 | + |
| 10 | +Requirements |
| 11 | +------------ |
| 12 | + |
| 13 | +- Access to the cluster as a user with the cluster-admin role. |
| 14 | +- The cluster is in a known good state, without any errors. |
| 15 | +- Default StorageClass must be configured |
| 16 | + |
| 17 | +Role Variables |
| 18 | +-------------- |
| 19 | + |
| 20 | +Role Variables |
| 21 | +-------------- |
| 22 | +| Variable | Required | Default | Comments | |
| 23 | +|--------------------------------|----------|-------------|------------------------------------------------| |
| 24 | +| stig_compliance_enabled | no | false | Set it to true to run this playbook | |
| 25 | +| compliance_catalogsource | yes | "redhat-operators" | Catlog source index image. default `redhat-operators` catalog source will be used | |
| 26 | +| compliance_upgrade_channel | yes | stable | Channel version for the compliance operator | |
| 27 | +| rhcos4_contentfile | yes | "ssg-rhcos4-ds.xml" | Location of the file containing the rhcos4 compliance content | |
| 28 | +| ocp4_contentfile | yes | "ssg-ocp4-ds.xml" | Location of the file containing the ocp4 compliance content | |
| 29 | +| content_image | yes | "ghcr.io/complianceascode/k8scontent:latest" | Content image location | |
| 30 | + |
| 31 | + |
| 32 | +Example Playbook |
| 33 | +---------------- |
| 34 | + |
| 35 | +``` |
| 36 | +- name: Validate stig profiles |
| 37 | + hosts: bastion |
| 38 | + roles: |
| 39 | + - ocp-disa-stig-compliance |
| 40 | +``` |
| 41 | + |
| 42 | +Steps to run playbook |
| 43 | +---------------------- |
| 44 | + |
| 45 | +- Copy `ocp4-playbooks-extras/examples/inventory` file to the home or working directory and modify it to add a remote host |
| 46 | +- Copy the `ocp4-playbooks-extras/examples/ocp_disa_stig_vars.yaml` to the home or working directory and set the role variables for `roles/ocp-disa-stig-compliance` with the custom inputs. |
| 47 | +- To execute the playbook run the below sample command |
| 48 | + |
| 49 | + |
| 50 | +Sample Command |
| 51 | +--------------- |
| 52 | + |
| 53 | +ansible-playbook -i inventory -e @ocp_disa_stig_vars.yaml ~/ocp4-playbooks-extras/playbooks/ocp-disa-stig-compliance.yml |
| 54 | + |
| 55 | +License |
| 56 | +------- |
| 57 | + |
| 58 | +See LICENCE.txt |
| 59 | + |
| 60 | +Author Information |
| 61 | +------------------ |
| 62 | + |
| 63 | + |
0 commit comments