5.4.2.5. コンプライアンススキャンの追跡
コンプライアンススイートの作成後、ComplianceSuite オブジェクトを使用して、デプロイされたスキャンのステータスをモニターできます。
5.4.2.5.1. ComplianceSuite オブジェクト リンクのコピーリンクがクリップボードにコピーされました!
ComplianceSuite オブジェクトは、スキャンの状態を追跡するのに役立ちます。スキャンと全体的な結果を作成するための生の設定が含まれています。
Node タイプのスキャンの場合、問題の修正が含まれているため、スキャンを MachineConfigPool にマップする必要があります。ラベルを指定する場合は、それがプールに直接適用されることを確認してください。
ComplianceSuite オブジェクトの例
apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceSuite
metadata:
name: <name_of_the_suite>
spec:
autoApplyRemediations: false
schedule: "0 1 * * *"
scans:
- name: workers-scan
scanType: Node
profile: xccdf_org.ssgproject.content_profile_moderate
content: ssg-rhcos4-ds.xml
contentImage: registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256:45dc...
rule: "xccdf_org.ssgproject.content_rule_no_netrc_files"
nodeSelector:
node-role.kubernetes.io/worker: ""
status:
Phase: DONE
Result: NON-COMPLIANT
scanStatuses:
- name: workers-scan
phase: DONE
result: NON-COMPLIANT
バックグラウンドのスイートは、scans パラメーターに基づいて ComplianceScan オブジェクトを作成します。プログラムで ComplianceSuites イベントを取得できます。スイートのイベントを取得するには、次のコマンドを実行します。
$ oc get events --field-selector involvedObject.kind=ComplianceSuite,involvedObject.name=<name of the suite>
手動で ComplianceSuite を定義すると、XCCDF 属性が含まれているため、エラーが発生する可能性があります。