5.4. 규정 준수 운영자 개념


5.4.1. Compliance Operator 이해

OpenShift Container Platform 관리자는 Compliance Operator를 통해 클러스터의 필수 규정 준수 상태를 설명하고 격차에 대한 개요와 문제를 해결하는 방법을 제공할 수 있습니다. Compliance Operator는 OpenShift Container Platform의 Kubernetes API 리소스와 클러스터를 실행하는 노드 모두의 규정 준수를 평가합니다. Compliance Operator는 NIST 인증 툴인 OpenSCAP을 사용하여 콘텐츠에서 제공하는 보안 정책을 검사하고 시행합니다.

중요

Compliance Operator는 Red Hat Enterprise Linux CoreOS(RHCOS) 배포에만 사용할 수 있습니다.

5.4.1.1. Compliance Operator 프로필

Compliance Operator 설치의 일부로 다양한 프로필을 사용할 수 있습니다. oc get 명령을 사용하면 사용 가능한 프로필, 프로필 세부 정보 및 특정 규칙을 볼 수 있습니다.

  • 사용 가능한 프로필 보기:

    $ oc get profile.compliance -n openshift-compliance
    Copy to Clipboard Toggle word wrap

    출력 예

    NAME                       AGE     VERSION
    ocp4-cis                   3h49m   1.5.0
    ocp4-cis-1-4               3h49m   1.4.0
    ocp4-cis-1-5               3h49m   1.5.0
    ocp4-cis-node              3h49m   1.5.0
    ocp4-cis-node-1-4          3h49m   1.4.0
    ocp4-cis-node-1-5          3h49m   1.5.0
    ocp4-e8                    3h49m
    ocp4-high                  3h49m   Revision 4
    ocp4-high-node             3h49m   Revision 4
    ocp4-high-node-rev-4       3h49m   Revision 4
    ocp4-high-rev-4            3h49m   Revision 4
    ocp4-moderate              3h49m   Revision 4
    ocp4-moderate-node         3h49m   Revision 4
    ocp4-moderate-node-rev-4   3h49m   Revision 4
    ocp4-moderate-rev-4        3h49m   Revision 4
    ocp4-nerc-cip              3h49m
    ocp4-nerc-cip-node         3h49m
    ocp4-pci-dss               3h49m   3.2.1
    ocp4-pci-dss-3-2           3h49m   3.2.1
    ocp4-pci-dss-4-0           3h49m   4.0.0
    ocp4-pci-dss-node          3h49m   3.2.1
    ocp4-pci-dss-node-3-2      3h49m   3.2.1
    ocp4-pci-dss-node-4-0      3h49m   4.0.0
    ocp4-stig                  3h49m   V2R1
    ocp4-stig-node             3h49m   V2R1
    ocp4-stig-node-v1r1        3h49m   V1R1
    ocp4-stig-node-v2r1        3h49m   V2R1
    ocp4-stig-v1r1             3h49m   V1R1
    ocp4-stig-v2r1             3h49m   V2R1
    rhcos4-e8                  3h49m
    rhcos4-high                3h49m   Revision 4
    rhcos4-high-rev-4          3h49m   Revision 4
    rhcos4-moderate            3h49m   Revision 4
    rhcos4-moderate-rev-4      3h49m   Revision 4
    rhcos4-nerc-cip            3h49m
    rhcos4-stig                3h49m   V2R1
    rhcos4-stig-v1r1           3h49m   V1R1
    rhcos4-stig-v2r1           3h49m   V2R1
    Copy to Clipboard Toggle word wrap

    이러한 프로필은 다양한 규정 준수 벤치마크를 나타냅니다. 각 프로필에는 적용되는 제품 이름이 프로필 이름에 접두사로 추가됩니다. ocp4-e8은 OpenShift Container Platform 제품에 Essential 8 벤치마크를 적용하고, rhcos4-e8 은 Red Hat Enterprise Linux CoreOS(RHCOS) 제품에 Essential 8 벤치마크를 적용합니다.

  • rhcos4-e8 프로필의 세부 정보를 보려면 다음 명령을 실행하세요.

    $ oc get -n openshift-compliance -oyaml profiles.compliance rhcos4-e8
    Copy to Clipboard Toggle word wrap

    예 5.1. 출력 예

    apiVersion: compliance.openshift.io/v1alpha1
    description: 'This profile contains configuration checks for Red Hat Enterprise Linux
      CoreOS that align to the Australian Cyber Security Centre (ACSC) Essential Eight.
      A copy of the Essential Eight in Linux Environments guide can be found at the ACSC
      website: https://www.cyber.gov.au/acsc/view-all-content/publications/hardening-linux-workstations-and-servers'
    id: xccdf_org.ssgproject.content_profile_e8
    kind: Profile
    metadata:
      annotations:
        compliance.openshift.io/image-digest: pb-rhcos4hrdkm
        compliance.openshift.io/product: redhat_enterprise_linux_coreos_4
        compliance.openshift.io/product-type: Node
      creationTimestamp: "2022-10-19T12:06:49Z"
      generation: 1
      labels:
        compliance.openshift.io/profile-bundle: rhcos4
      name: rhcos4-e8
      namespace: openshift-compliance
      ownerReferences:
      - apiVersion: compliance.openshift.io/v1alpha1
        blockOwnerDeletion: true
        controller: true
        kind: ProfileBundle
        name: rhcos4
        uid: 22350850-af4a-4f5c-9a42-5e7b68b82d7d
      resourceVersion: "43699"
      uid: 86353f70-28f7-40b4-bf0e-6289ec33675b
    rules:
    - rhcos4-accounts-no-uid-except-zero
    - rhcos4-audit-rules-dac-modification-chmod
    - rhcos4-audit-rules-dac-modification-chown
    - rhcos4-audit-rules-execution-chcon
    - rhcos4-audit-rules-execution-restorecon
    - rhcos4-audit-rules-execution-semanage
    - rhcos4-audit-rules-execution-setfiles
    - rhcos4-audit-rules-execution-setsebool
    - rhcos4-audit-rules-execution-seunshare
    - rhcos4-audit-rules-kernel-module-loading-delete
    - rhcos4-audit-rules-kernel-module-loading-finit
    - rhcos4-audit-rules-kernel-module-loading-init
    - rhcos4-audit-rules-login-events
    - rhcos4-audit-rules-login-events-faillock
    - rhcos4-audit-rules-login-events-lastlog
    - rhcos4-audit-rules-login-events-tallylog
    - rhcos4-audit-rules-networkconfig-modification
    - rhcos4-audit-rules-sysadmin-actions
    - rhcos4-audit-rules-time-adjtimex
    - rhcos4-audit-rules-time-clock-settime
    - rhcos4-audit-rules-time-settimeofday
    - rhcos4-audit-rules-time-stime
    - rhcos4-audit-rules-time-watch-localtime
    - rhcos4-audit-rules-usergroup-modification
    - rhcos4-auditd-data-retention-flush
    - rhcos4-auditd-freq
    - rhcos4-auditd-local-events
    - rhcos4-auditd-log-format
    - rhcos4-auditd-name-format
    - rhcos4-auditd-write-logs
    - rhcos4-configure-crypto-policy
    - rhcos4-configure-ssh-crypto-policy
    - rhcos4-no-empty-passwords
    - rhcos4-selinux-policytype
    - rhcos4-selinux-state
    - rhcos4-service-auditd-enabled
    - rhcos4-sshd-disable-empty-passwords
    - rhcos4-sshd-disable-gssapi-auth
    - rhcos4-sshd-disable-rhosts
    - rhcos4-sshd-disable-root-login
    - rhcos4-sshd-disable-user-known-hosts
    - rhcos4-sshd-do-not-permit-user-env
    - rhcos4-sshd-enable-strictmodes
    - rhcos4-sshd-print-last-log
    - rhcos4-sshd-set-loglevel-info
    - rhcos4-sysctl-kernel-dmesg-restrict
    - rhcos4-sysctl-kernel-kptr-restrict
    - rhcos4-sysctl-kernel-randomize-va-space
    - rhcos4-sysctl-kernel-unprivileged-bpf-disabled
    - rhcos4-sysctl-kernel-yama-ptrace-scope
    - rhcos4-sysctl-net-core-bpf-jit-harden
    title: Australian Cyber Security Centre (ACSC) Essential Eight
    Copy to Clipboard Toggle word wrap
  • rhcos4-audit-rules-login-events 규칙의 세부 정보를 보려면 다음 명령을 실행하세요.

    $ oc get -n openshift-compliance -oyaml rules rhcos4-audit-rules-login-events
    Copy to Clipboard Toggle word wrap

    예 5.2. 출력 예

    apiVersion: compliance.openshift.io/v1alpha1
    checkType: Node
    description: |-
      The audit system already collects login information for all users and root. If the auditd daemon is configured to use the augenrules program to read audit rules during daemon startup (the default), add the following lines to a file with suffix.rules in the directory /etc/audit/rules.d in order to watch for attempted manual edits of files involved in storing logon events:
    
      -w /var/log/tallylog -p wa -k logins
      -w /var/run/faillock -p wa -k logins
      -w /var/log/lastlog -p wa -k logins
    
      If the auditd daemon is configured to use the auditctl utility to read audit rules during daemon startup, add the following lines to /etc/audit/audit.rules file in order to watch for unattempted manual edits of files involved in storing logon events:
    
      -w /var/log/tallylog -p wa -k logins
      -w /var/run/faillock -p wa -k logins
      -w /var/log/lastlog -p wa -k logins
    id: xccdf_org.ssgproject.content_rule_audit_rules_login_events
    kind: Rule
    metadata:
      annotations:
        compliance.openshift.io/image-digest: pb-rhcos4hrdkm
        compliance.openshift.io/rule: audit-rules-login-events
        control.compliance.openshift.io/NIST-800-53: AU-2(d);AU-12(c);AC-6(9);CM-6(a)
        control.compliance.openshift.io/PCI-DSS: Req-10.2.3
        policies.open-cluster-management.io/controls: AU-2(d),AU-12(c),AC-6(9),CM-6(a),Req-10.2.3
        policies.open-cluster-management.io/standards: NIST-800-53,PCI-DSS
      creationTimestamp: "2022-10-19T12:07:08Z"
      generation: 1
      labels:
        compliance.openshift.io/profile-bundle: rhcos4
      name: rhcos4-audit-rules-login-events
      namespace: openshift-compliance
      ownerReferences:
      - apiVersion: compliance.openshift.io/v1alpha1
        blockOwnerDeletion: true
        controller: true
        kind: ProfileBundle
        name: rhcos4
        uid: 22350850-af4a-4f5c-9a42-5e7b68b82d7d
      resourceVersion: "44819"
      uid: 75872f1f-3c93-40ca-a69d-44e5438824a4
    rationale: Manual editing of these files may indicate nefarious activity, such as
      an attacker attempting to remove evidence of an intrusion.
    severity: medium
    title: Record Attempts to Alter Logon and Logout Events
    warning: Manual editing of these files may indicate nefarious activity, such as an
      attacker attempting to remove evidence of an intrusion.
    Copy to Clipboard Toggle word wrap
5.4.1.1.1. 규정 준수 운영자 프로필 유형

규정 준수 운영자 규칙은 프로필로 구성됩니다. 프로필은 OpenShift Container Platform의 플랫폼이나 노드를 타겟으로 할 수 있으며, 일부 벤치마크에는 rhcos4 노드 프로필이 포함됩니다.

플랫폼
플랫폼 프로필은 OpenShift Container Platform 클러스터 구성 요소를 평가합니다. 예를 들어, 플랫폼 수준 규칙은 APIServer 구성에서 강력한 암호화를 사용하는지 확인할 수 있습니다.
노드
노드 프로필은 각 호스트의 OpenShift 또는 RHCOS 구성을 평가합니다. 두 가지 노드 프로필을 사용할 수 있습니다. ocp4 노드 프로필과 rhcos4 노드 프로필입니다. ocp4 노드 프로필은 각 호스트의 OpenShift 구성을 평가합니다. 예를 들어, kubeconfig 파일에 규정 준수 기준을 충족하는 데 필요한 올바른 권한이 있는지 확인할 수 있습니다. rhcos4 노드 프로필은 각 호스트의 Red Hat Enterprise Linux CoreOS(RHCOS) 구성을 평가합니다. 예를 들어, SSHD 서비스가 비밀번호 로그인을 비활성화하도록 구성되어 있는지 확인할 수 있습니다.
중요

PCI-DSS와 같이 노드 및 플랫폼 프로필이 있는 벤치마크의 경우 OpenShift Container Platform 환경에서 두 프로필을 모두 실행해야 합니다.

FedRAMP High와 같이 ocp4 플랫폼, ocp4 노드 및 rhcos4 노드 프로필이 있는 벤치마크의 경우 OpenShift 컨테이너 플랫폼 환경에서 세 가지 프로필을 모두 실행해야 합니다.

참고

많은 노드가 있는 클러스터에서는 ocp4 노드와 rhcos4 노드 스캔을 완료하는 데 시간이 오래 걸릴 수 있습니다.

5.4.2. 사용자 정의 리소스 정의 이해

OpenShift 컨테이너 플랫폼의 Compliance Operator는 규정 준수 검사를 수행하기 위한 여러 가지 사용자 정의 리소스 정의(CRD)를 제공합니다. 규정 준수 검사를 실행하려면 ComplianceAsCode 커뮤니티 프로젝트에서 파생된 사전 정의된 보안 정책을 활용합니다. 규정 준수 운영자는 이러한 보안 정책을 CRD로 변환합니다. 이를 사용하여 규정 준수 검사를 실행하고 발견된 문제에 대한 수정 사항을 얻을 수 있습니다.

5.4.2.1. CRD 워크플로

CRD는 규정 준수 검사를 완료하기 위한 다음과 같은 워크플로를 제공합니다.

  1. 규정 준수 스캔 요구 사항 정의
  2. 규정 준수 검사 설정 구성
  3. 규정 준수 스캔 설정을 사용하여 규정 준수 요구 사항 처리
  4. 규정 준수 스캔을 모니터링합니다.
  5. 규정 준수 검사 결과를 확인하세요

5.4.2.2. 규정 준수 스캔 요구 사항 정의

기본적으로 Compliance Operator CRD에는 ProfileBundleProfile 개체가 포함되어 있으며, 이를 통해 규정 준수 검사 요구 사항에 대한 규칙을 정의하고 설정할 수 있습니다. TailoredProfile 객체를 사용하여 기본 프로필을 사용자 정의할 수도 있습니다.

5.4.2.2.1. ProfileBundle 객체

Compliance Operator를 설치하면 즉시 실행 가능한 ProfileBundle 오브젝트가 포함됩니다. 규정 준수 연산자는 ProfileBundle 객체를 구문 분석하고 번들의 각 프로필에 대한 Profile 객체를 생성합니다. 또한 Profile 객체에서 사용되는 RuleVariable 객체를 구문 분석합니다.

ProfileBundle 객체의 예

apiVersion: compliance.openshift.io/v1alpha1
kind: ProfileBundle
  name: <profile bundle name>
  namespace: openshift-compliance
status:
  dataStreamStatus: VALID 
1
Copy to Clipboard Toggle word wrap

1
Compliance Operator에서 콘텐츠 파일을 구문 분석할 수 있는지 여부를 나타냅니다.
참고

contentFile이 실패하면 발생한 오류에 대한 세부 정보를 제공하는 errorMessage 속성이 나타납니다.

문제 해결

유효하지 않은 이미지에서 알려진 콘텐츠 이미지로 롤백하는 경우 ProfileBundle 개체가 응답을 멈추고 PENDING 상태가 표시됩니다. 해결 방법으로, 이전 이미지가 아닌 다른 이미지로 이동할 수 있습니다. 또는 ProfileBundle 객체를 삭제하고 다시 생성하여 작업 상태로 돌아갈 수 있습니다.

5.4.2.2.2. 프로필 객체

Profile 객체는 특정 규정 준수 기준에 대해 평가할 수 있는 규칙과 변수를 정의합니다. 여기에는 XCCDF 식별자와 노드 또는 플랫폼 유형에 대한 프로필 검사 등 OpenSCAP 프로필에 대한 구문 분석된 세부 정보가 포함되어 있습니다. Profile 오브젝트를 직접 사용하거나 Tailor Profile 오브젝트를 사용하여 추가로 사용자 지정할 수 있습니다.

참고

Profile 객체는 단일 ProfileBundle 객체에서 파생되므로 수동으로 생성하거나 수정할 수 없습니다. 일반적으로 단일 ProfileBundle 객체에는 여러 개의 Profile 객체가 포함될 수 있습니다.

예제 Profile 객체

apiVersion: compliance.openshift.io/v1alpha1
description: <description of the profile>
id: xccdf_org.ssgproject.content_profile_moderate 
1

kind: Profile
metadata:
  annotations:
    compliance.openshift.io/product: <product name>
    compliance.openshift.io/product-type: Node 
2

  creationTimestamp: "YYYY-MM-DDTMM:HH:SSZ"
  generation: 1
  labels:
    compliance.openshift.io/profile-bundle: <profile bundle name>
  name: rhcos4-moderate
  namespace: openshift-compliance
  ownerReferences:
  - apiVersion: compliance.openshift.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: ProfileBundle
    name: <profile bundle name>
    uid: <uid string>
  resourceVersion: "<version number>"
  selfLink: /apis/compliance.openshift.io/v1alpha1/namespaces/openshift-compliance/profiles/rhcos4-moderate
  uid: <uid string>
rules: 
3

- rhcos4-account-disable-post-pw-expiration
- rhcos4-accounts-no-uid-except-zero
- rhcos4-audit-rules-dac-modification-chmod
- rhcos4-audit-rules-dac-modification-chown
title: <title of the profile>
Copy to Clipboard Toggle word wrap

1
프로필의 XCCDF 이름을 지정합니다. 스캔의 프로필 속성 값으로 ComplianceScan 객체를 정의할 때 이 식별자를 사용합니다.
2
노드 또는 플랫폼을 지정하세요. 노드 프로필은 클러스터 노드를 스캔하고 플랫폼 프로필은 Kubernetes 플랫폼을 스캔합니다.
3
프로필에 대한 규칙 목록을 지정합니다. 각 규칙은 단일 검사에 해당합니다.
5.4.2.2.3. 규칙 객체

프로필을 형성하는 규칙 객체도 객체로 노출됩니다. 규칙 객체를 사용하여 규정 준수 검사 요구 사항을 정의하고 이를 수정하는 방법을 지정합니다.

예제 규칙 객체

    apiVersion: compliance.openshift.io/v1alpha1
    checkType: Platform 
1

    description: <description of the rule>
    id: xccdf_org.ssgproject.content_rule_configure_network_policies_namespaces 
2

    instructions: <manual instructions for the scan>
    kind: Rule
    metadata:
      annotations:
        compliance.openshift.io/rule: configure-network-policies-namespaces
        control.compliance.openshift.io/CIS-OCP: 5.3.2
        control.compliance.openshift.io/NERC-CIP: CIP-003-3 R4;CIP-003-3 R4.2;CIP-003-3
          R5;CIP-003-3 R6;CIP-004-3 R2.2.4;CIP-004-3 R3;CIP-007-3 R2;CIP-007-3 R2.1;CIP-007-3
          R2.2;CIP-007-3 R2.3;CIP-007-3 R5.1;CIP-007-3 R6.1
        control.compliance.openshift.io/NIST-800-53: AC-4;AC-4(21);CA-3(5);CM-6;CM-6(1);CM-7;CM-7(1);SC-7;SC-7(3);SC-7(5);SC-7(8);SC-7(12);SC-7(13);SC-7(18)
      labels:
        compliance.openshift.io/profile-bundle: ocp4
      name: ocp4-configure-network-policies-namespaces
      namespace: openshift-compliance
    rationale: <description of why this rule is checked>
    severity: high 
3

    title: <summary of the rule>
Copy to Clipboard Toggle word wrap

1
이 규칙이 실행되는 검사 유형을 지정합니다. 노드 프로필은 클러스터 노드를 스캔하고 플랫폼 프로필은 Kubernetes 플랫폼을 스캔합니다. 빈 값은 자동 검사가 없음을 나타냅니다.
2
데이터 스트림에서 직접 구문 분석되는 규칙의 XCCDF 이름을 지정합니다.
3
규칙이 실패할 경우의 심각도를 지정합니다.
참고

Rule 객체는 연관된 ProfileBundle 객체를 쉽게 식별할 수 있도록 적절한 레이블을 얻습니다. ProfileBundle 은 또한 이 객체의 OwnerReferences 에 지정됩니다.

5.4.2.2.4. TailoredProfile 객체

TailoredProfile 객체를 사용하여 조직의 요구 사항에 따라 기본 Profile 객체를 수정합니다. 규칙을 활성화하거나 비활성화하고, 변수 값을 설정하고, 사용자 정의에 대한 정당성을 제공할 수 있습니다. 검증 후 TailoredProfile 개체는 ConfigMap을 생성하고, 이는 ComplianceScan 개체에서 참조할 수 있습니다.

작은 정보

ScanSettingBinding 개체에서 TailoredProfile 개체를 참조하여 해당 개체를 사용할 수 있습니다. ScanSettingBinding 에 대한 자세한 내용은 ScanSettingBinding 개체를 참조하세요.

TailoredProfile 오브젝트의 예

apiVersion: compliance.openshift.io/v1alpha1
kind: TailoredProfile
metadata:
  name: rhcos4-with-usb
spec:
  extends: rhcos4-moderate 
1

  title: <title of the tailored profile>
  disableRules:
    - name: <name of a rule object to be disabled>
      rationale: <description of why this rule is checked>
status:
  id: xccdf_compliance.openshift.io_profile_rhcos4-with-usb 
2

  outputRef:
    name: rhcos4-with-usb-tp 
3

    namespace: openshift-compliance
  state: READY 
4
Copy to Clipboard Toggle word wrap

1
이는 선택 사항입니다. TailoredProfile 이 빌드된 Profile 오브젝트의 이름입니다. 값을 설정하지 않으면 enableRules 목록에서 새 프로필이 생성됩니다.
2
맞춤형 프로필의 XCCDF 이름을 지정합니다.
3
ComplianceScantailoringConfigMap.name 속성 값으로 사용할 수 있는 ConfigMap 이름을 지정합니다.
4
READY , PENDING , FAILURE 와 같은 객체의 상태를 보여줍니다. 객체의 상태가 ERROR 인 경우, status.errorMessage 속성은 실패 이유를 제공합니다.

TailoredProfile 객체를 사용하면 TailoredProfile 구조를 사용하여 새로운 Profile 객체를 만들 수 있습니다. 새 프로필을 만들려면 다음 구성 매개변수를 설정하세요.

  • 적절한 제목
  • 확장 값은 비어 있어야 합니다.
  • TailoredProfile 객체에 대한 스캔 유형 주석:

    compliance.openshift.io/product-type: Platform/Node
    Copy to Clipboard Toggle word wrap
    참고

    제품 유형 주석을 설정하지 않은 경우 규정 준수 운영자는 기본적으로 플랫폼 스캔 유형을 사용합니다. TailoredProfile 객체의 이름에 -node 접미사를 추가하면 노드 스캔 유형이 생성됩니다.

5.4.2.3. 규정 준수 검사 설정 구성

규정 준수 검사의 요구 사항을 정의한 후 검사 유형, 검사 발생 시기, 검사 위치를 지정하여 규정 준수 검사를 구성할 수 있습니다. 이를 위해 Compliance Operator는 ScanSetting 객체를 제공합니다.

5.4.2.3.1. ScanSetting 객체

ScanSetting 객체를 사용하여 스캔을 실행하기 위한 운영 정책을 정의하고 재사용합니다. 기본적으로 Compliance Operator는 다음과 같은 ScanSetting 객체를 생성합니다.

  • Default - PV(영구 볼륨)를 사용하여 마스터 노드와 작업자 노드 모두에서 매일 검사를 실행하고 마지막 세 가지 결과를 유지합니다. 수정 사항이 자동으로 적용되거나 업데이트되지 않습니다.
  • default-auto-apply - PV(영구 볼륨)를 사용하여 컨트롤 플레인 및 작업자 노드에서 매일 1AM에서 검사를 실행하고 마지막 세 가지 결과를 유지합니다. autoApplyRemediationsautoUpdateRemediations가 모두 true로 설정되었습니다.

ScanSetting 객체 예제

apiVersion: compliance.openshift.io/v1alpha1
autoApplyRemediations: true 
1

autoUpdateRemediations: true 
2

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 
3

  size: 1Gi 
4

  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: 
5

- master
- worker
scanTolerations:
- operator: Exists
schedule: 0 1 * * * 
6

showNotApplicable: false
strictNodeScan: true
timeout: 30m
Copy to Clipboard Toggle word wrap

1
자동 수정을 활성화하려면 true 로 설정합니다. 자동 수정을 비활성화하려면 false 로 설정합니다.
2
콘텐츠 업데이트에 대한 자동 수정을 활성화하려면 true 로 설정합니다. 콘텐츠 업데이트에 대한 자동 수정을 비활성화하려면 false 로 설정합니다.
3
원시 결과 형식으로 저장된 스캔의 수를 지정합니다. 기본값은 3입니다. 이전 결과가 순환되면 관리자는 순환이 발생하기 전에 결과를 다른 곳에 저장해야 합니다.
4
스캔의 원시 결과를 저장하기 위해 생성해야 하는 저장 크기를 지정합니다. 기본값은 1Gi 입니다
6
크론 형식으로 검사를 얼마나 자주 실행할지 지정합니다.
참고

회전 정책을 비활성화하려면 값을 0 으로 설정합니다.

5
Node 유형에 대한 검사를 예약하려면 node-role.kubernetes.io 레이블 값을 지정합니다. 이 값은 MachineConfigPool 의 이름과 일치해야 합니다.

규정 준수 검사 요구 사항을 정의하고 검사를 실행하기 위한 설정을 구성하면 규정 준수 연산자는 ScanSettingBinding 개체를 사용하여 이를 처리합니다.

5.4.2.4.1. ScanSettingBinding 객체

ScanSettingBinding 객체를 사용하여 Profile 또는 TailoredProfile 객체를 참조하여 규정 준수 요구 사항을 지정합니다. 그런 다음 스캔에 대한 운영 제약 조건을 제공하는 ScanSetting 개체에 연결됩니다. 그런 다음 Compliance Operator는 ScanSettingScanSettingBinding 개체를 기반으로 ComplianceSuite 개체를 생성합니다.

예제 ScanSettingBinding 오브젝트

apiVersion: compliance.openshift.io/v1alpha1
kind: ScanSettingBinding
metadata:
  name: <name of the scan>
profiles: 
1

  # 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: 
2

  name: my-companys-constraints
  kind: ScanSetting
  apiGroup: compliance.openshift.io/v1alpha1
Copy to Clipboard Toggle word wrap

1
환경을 스캔하려면 Profile 또는 TailoredProfile 개체의 세부 정보를 지정하세요.
2
일정 및 저장 공간 크기와 같은 운영상의 제약조건을 지정합니다.

ScanSettingScanSettingBinding 객체를 생성하면 규정 준수 제품군이 생성됩니다. 규정 준수 제품군 목록을 얻으려면 다음 명령을 실행하세요.

$ oc get compliancesuites
Copy to Clipboard Toggle word wrap
중요

ScanSettingBinding을 삭제하면 규정 준수 제품군도 삭제됩니다.

5.4.2.5. 규정 준수 검사 추적

규정 준수 제품군을 만든 후에는 ComplianceSuite 객체를 사용하여 배포된 스캔의 상태를 모니터링할 수 있습니다.

5.4.2.5.1. ComplianceSuite 객체

ComplianceSuite 객체는 스캔 상태를 추적하는 데 도움이 됩니다. 여기에는 스캔을 생성하는 데 필요한 원시 설정과 전반적인 결과가 포함되어 있습니다.

노드 유형 스캔의 경우 문제에 대한 해결 방법이 포함되어 있으므로 해당 스캔을 MachineConfigPool 에 매핑해야 합니다. 라벨을 지정하는 경우 풀에 직접 적용되는지 확인하세요.

ComplianceSuite 오브젝트의 예

apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceSuite
metadata:
  name: <name_of_the_suite>
spec:
  autoApplyRemediations: false 
1

  schedule: "0 1 * * *" 
2

  scans: 
3

    - 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 
4

  Result: NON-COMPLIANT 
5

  scanStatuses:
  - name: workers-scan
    phase: DONE
    result: NON-COMPLIANT
Copy to Clipboard Toggle word wrap

1
자동 수정을 활성화하려면 true 로 설정합니다. 자동 수정을 비활성화하려면 false 로 설정합니다.
2
크론 형식으로 검사를 얼마나 자주 실행할지 지정합니다.
3
클러스터에서 실행할 스캔 사양 목록을 지정합니다.
4
검사 진행 상황을 나타냅니다.
5
제품군의 전반적인 평가를 나타냅니다.

백그라운드의 스위트는 스캔 매개변수를 기반으로 ComplianceScan 객체를 생성합니다. ComplianceSuites 이벤트를 프로그래밍 방식으로 가져올 수 있습니다. 해당 제품군의 이벤트를 가져오려면 다음 명령을 실행하세요.

$ oc get events --field-selector involvedObject.kind=ComplianceSuite,involvedObject.name=<name of the suite>
Copy to Clipboard Toggle word wrap
중요

XCCDF 속성이 포함되어 있으므로 ComplianceSuite를 수동으로 정의하면 오류가 발생할 수 있습니다.

5.4.2.5.2. 고급 ComplianceScan 개체

Compliance Operator에는 고급 사용자가 기존 툴을 디버깅하거나 통합할 수 있는 옵션이 포함되어 있습니다. ComplianceScan 객체를 직접 생성하지 않는 것이 좋지만 대신 ComplianceSuite 객체를 사용하여 관리할 수 있습니다.

고급 ComplianceScan 개체 예제

apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceScan
metadata:
  name: <name_of_the_compliance_scan>
spec:
  scanType: Node 
1

  profile: xccdf_org.ssgproject.content_profile_moderate 
2

  content: ssg-ocp4-ds.xml
  contentImage: registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256:45dc... 
3

  rule: "xccdf_org.ssgproject.content_rule_no_netrc_files" 
4

  nodeSelector: 
5

    node-role.kubernetes.io/worker: ""
status:
  phase: DONE 
6

  result: NON-COMPLIANT 
7
Copy to Clipboard Toggle word wrap

1
노드 또는 플랫폼을 지정하세요. 노드 프로필은 클러스터 노드를 스캔하고 플랫폼 프로필은 Kubernetes 플랫폼을 스캔합니다.
2
실행하려는 프로필의 XCCDF 식별자를 지정합니다.
3
프로필 파일을 캡슐화하는 컨테이너 이미지를 지정합니다.
4
이는 선택 사항입니다. 단일 규칙을 실행하도록 검사를 지정합니다. 이 규칙은 XCCDF ID로 식별되어야 하며, 지정된 프로필에 속해야 합니다.
참고

규칙 매개변수를 건너뛰면 지정된 프로필의 사용 가능한 모든 규칙에 대한 검사가 실행됩니다.

5
OpenShift Container Platform을 사용하고 수정 사항을 생성하려는 경우 nodeSelector 레이블은 MachineConfigPool 레이블과 일치해야 합니다.
참고

nodeSelector 매개변수를 지정하지 않거나 MachineConfig 레이블과 일치하지 않으면 검사는 계속 실행되지만 수정 사항은 생성되지 않습니다.

6
스캔의 현재 단계를 나타냅니다.
7
검사 결과를 나타냅니다.
중요

ComplianceSuite 객체를 삭제하면 관련된 모든 스캔이 삭제됩니다.

검사가 완료되면 ComplianceCheckResult 개체의 사용자 지정 리소스로 결과가 생성됩니다. 하지만 원시 결과는 ARF 형식으로 제공됩니다. 이러한 결과는 스캔 이름과 연결된 영구 볼륨 클레임(PVC)이 있는 영구 볼륨(PV)에 저장됩니다. ComplianceScans 이벤트를 프로그래밍 방식으로 가져올 수 있습니다. 제품군에 대한 이벤트를 생성하려면 다음 명령을 실행하세요.

oc get events --field-selector involvedObject.kind=ComplianceScan,involvedObject.name=<name_of_the_compliance_scan>
Copy to Clipboard Toggle word wrap

5.4.2.6. 규정 준수 결과 보기

규정 준수 제품군이 완료 단계에 도달하면 검사 결과와 가능한 수정 사항을 볼 수 있습니다.

5.4.2.6.1. ComplianceCheckResult 객체

특정 프로필로 검사를 실행하면 프로필의 여러 규칙이 검증됩니다. 이러한 각 규칙에 대해 ComplianceCheckResult 개체가 생성되어 특정 규칙에 대한 클러스터 상태를 제공합니다.

ComplianceCheckResult 오브젝트의 예

apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceCheckResult
metadata:
  labels:
    compliance.openshift.io/check-severity: medium
    compliance.openshift.io/check-status: FAIL
    compliance.openshift.io/suite: example-compliancesuite
    compliance.openshift.io/scan-name: workers-scan
  name: workers-scan-no-direct-root-logins
  namespace: openshift-compliance
  ownerReferences:
  - apiVersion: compliance.openshift.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: ComplianceScan
    name: workers-scan
description: <description of scan check>
instructions: <manual instructions for the scan>
id: xccdf_org.ssgproject.content_rule_no_direct_root_logins
severity: medium 
1

status: FAIL 
2
Copy to Clipboard Toggle word wrap

1
스캔 검사의 심각도를 설명합니다.
2
검사 결과를 설명합니다. 가능한 값은 다음과 같습니다.
  • PASS: 확인이 성공했습니다.
  • 실패: 확인에 실패했습니다.
  • 정보: 확인이 성공적이었으며 오류로 간주될 만큼 심각하지 않은 사항을 발견했습니다.
  • 수동: 자동으로 상태를 평가할 수 없으므로 수동 확인이 필요합니다.
  • 불일치: 서로 다른 노드가 서로 다른 결과를 보고합니다.
  • 오류: 검사 실행은 성공적으로 완료되었지만 완료할 수 없습니다.
  • NOTAPPLICABLE: 적용되지 않으므로 검사가 실행되지 않았습니다.

모든 검사 결과를 얻으려면 다음 명령을 실행하세요.

oc get compliancecheckresults \
-l compliance.openshift.io/suite=workers-compliancesuite
Copy to Clipboard Toggle word wrap
5.4.2.6.2. ComplianceRemediation 객체

특정 검사를 위해 데이터 스트림을 지정하여 수정할 수 있습니다. 하지만 Kubernetes 수정 사항이 있는 경우 Compliance Operator는 ComplianceRemediation 객체를 생성합니다.

ComplianceRemediation 오브젝트의 예

apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceRemediation
metadata:
  labels:
    compliance.openshift.io/suite: example-compliancesuite
    compliance.openshift.io/scan-name: workers-scan
    machineconfiguration.openshift.io/role: worker
  name: workers-scan-disable-users-coredumps
  namespace: openshift-compliance
  ownerReferences:
  - apiVersion: compliance.openshift.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: ComplianceCheckResult
    name: workers-scan-disable-users-coredumps
    uid: <UID>
spec:
  apply: false 
1

  object:
    current: 
2

       apiVersion: machineconfiguration.openshift.io/v1
       kind: MachineConfig
       spec:
         config:
           ignition:
             version: 2.2.0
           storage:
             files:
             - contents:
                 source: data:,%2A%20%20%20%20%20hard%20%20%20core%20%20%20%200
               filesystem: root
               mode: 420
               path: /etc/security/limits.d/75-disable_users_coredumps.conf
    outdated: {} 
3
Copy to Clipboard Toggle word wrap

1
true는 수정이 적용되었음을 나타냅니다. false 는 수정이 적용되지 않았음을 나타냅니다.
2
구제 조치의 정의를 포함합니다.
3
이전 버전의 콘텐츠에서 이전에 구문 분석된 수정 사항을 나타냅니다. 규정 준수 운영자는 관리자가 새로운 수정 사항을 적용하기 전에 검토할 수 있는 기회를 제공하기 위해 오래된 객체를 계속 보관합니다.

제품군의 모든 수정 사항을 가져오려면 다음 명령을 실행하세요.

oc get complianceremediations \
-l compliance.openshift.io/suite=workers-compliancesuite
Copy to Clipboard Toggle word wrap

자동으로 수정할 수 있는 모든 실패 검사를 나열하려면 다음 명령을 실행하세요.

oc get compliancecheckresults \
-l 'compliance.openshift.io/check-status in (FAIL),compliance.openshift.io/automated-remediation'
Copy to Clipboard Toggle word wrap

수동으로 수정할 수 있는 모든 실패 검사를 나열하려면 다음 명령을 실행하세요.

oc get compliancecheckresults \
-l 'compliance.openshift.io/check-status in (FAIL),!compliance.openshift.io/automated-remediation'
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat