5.4.2.11. ScanSetting 오브젝트
ScanSetting 오브젝트를 사용하여 운영 정책을 정의하고 재사용하여 검사를 실행하여 여러 검사 바인딩의 구성 반복을 줄일 수 있습니다.
기본적으로 Compliance Operator는 다음 ScanSetting 오브젝트를 생성합니다.
- Default - 1Gi Persistent Volume (PV)을 사용하여 컨트롤 플레인 및 작업자 노드 모두에서 매일 검사를 실행하고 마지막 세 가지 결과를 유지합니다. 수정은 자동으로 적용되거나 업데이트되지 않습니다.
-
default-auto-apply - 1Gi 영구 볼륨(PV)을 사용하여 컨트롤 플레인 및 작업자 노드 모두에서 매일 검사를 실행하고 마지막 세 가지 결과를 유지합니다.
autoApplyRemediations및autoUpdateRemediations는 모두true로 설정됩니다.
예제 ScanSetting 오브젝트
apiVersion: compliance.openshift.io/v1alpha1
autoApplyRemediations: true
autoUpdateRemediations: true
kind: ScanSetting
maxRetryOnTimeout: 3
metadata:
creationTimestamp: "2022-10-18T20:21:00Z"
generation: 1
name: default-auto-apply
namespace: openshift-compliance
resourceVersion: "38840"
uid: 8cb0967d-05e0-4d7a-ac1c-08a7f7e89e84
rawResultStorage:
nodeSelector:
node-role.kubernetes.io/master: ""
pvAccessModes:
- ReadWriteOnce
rotation: 3
size: 1Gi
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
tolerationSeconds: 300
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
tolerationSeconds: 300
- effect: NoSchedule
key: node.kubernetes.io/memory-pressure
operator: Exists
roles:
- master
- worker
scanTolerations:
- operator: Exists
schedule: 0 1 * * *
showNotApplicable: false
strictNodeScan: true
timeout: 30m
다음과 같습니다.
autoApplyRemediations-
자동 수정을 활성화하려면
true로 설정합니다. 자동 수정을 비활성화하려면false로 설정합니다. autoUpdateRemediations-
콘텐츠 업데이트에 대한 자동 수정을 활성화하려면
true로 설정합니다. 콘텐츠 업데이트에 대한 자동 수정을 비활성화하려면false로 설정합니다. rawResultStorage.rotation-
원시 결과 형식으로 저장된 검사 수를 지정합니다. 기본값은
3입니다. 이전 결과가 순환되면 관리자는 교체를 수행하기 전에 결과를 다른 위치에 저장해야 합니다. 회전 정책을 비활성화하려면 값을0으로 설정합니다. rawResultStorage.size-
원시 결과를 저장하기 위해 검사에 생성해야 하는 스토리지 크기를 지정합니다. 기본값은
1Gi입니다. 스케줄cron 형식으로 검사를 실행해야 하는 빈도를 지정합니다.
참고회전 정책을 비활성화하려면 값을
0으로 설정합니다.역할-
노드 유형에 대한 검사를 예약할
node-role.kubernetes.io레이블 값을 지정합니다.이 값은MachineConfigPool의 이름과 일치해야 합니다.
5.4.2.11.1. ScanSettingBinding object 링크 복사링크가 클립보드에 복사되었습니다!
ScanSettingBinding 오브젝트를 사용하여 Profile 또는 TailoredProfile 오브젝트에 대한 참조로 규정 준수 요구 사항을 지정할 수 있습니다.
ScanSettingBinding 오브젝트는 검사에 대한 작동 제약 조건을 제공하는 ScanSetting 오브젝트에 연결되어 있습니다. 그런 다음 Compliance Operator는 ScanSetting 및 ScanSettingBinding 오브젝트를 기반으로 ComplianceSuite 오브젝트를 생성합니다.
예제 ScanSettingBinding 오브젝트
apiVersion: compliance.openshift.io/v1alpha1
kind: ScanSettingBinding
metadata:
name: <name of the scan>
profiles:
# Node checks
- name: rhcos4-with-usb
kind: TailoredProfile
apiGroup: compliance.openshift.io/v1alpha1
# Cluster checks
- name: ocp4-moderate
kind: Profile
apiGroup: compliance.openshift.io/v1alpha1
settingsRef:
name: my-companys-constraints
kind: ScanSetting
apiGroup: compliance.openshift.io/v1alpha1
다음과 같습니다.
profiles-
환경을 검사할
Profile또는TailoredProfile오브젝트의 세부 정보를 지정합니다. settingsRef- 일정 및 스토리지 크기와 같은 작동 제약 조건을 지정합니다.
ScanSetting 및 ScanSettingBinding 오브젝트를 생성하면 규정 준수 제품군이 생성됩니다. 규정 준수 제품군 목록을 가져오려면 다음 명령을 실행합니다.
$ oc get compliancesuites
ScanSettingBinding 을 삭제하면 규정 준수 제품군도 삭제됩니다.