검색

5.8. Compliance Operator 조정

download PDF

Compliance Operator는 즉시 사용할 수 있는 프로필과 함께 제공되지만 조직의 필요 및 요구 사항에 맞게 수정해야 합니다. 프로필을 수정하는 프로세스를 조정이라고 합니다.

Compliance Operator는 프로필을 조정할 수 있도록 TailoredProfile 오브젝트를 제공합니다.

5.8.1. 새로운 맞춤형 프로파일 생성

TailoredProfile 오브젝트를 사용하여 처음부터 맞춤형 프로필을 작성할 수 있습니다. 적절한 제목설명을 설정하고 extends 필드를 비워 둡니다. 이 사용자 정의 프로필이 생성할 Compliance Operator에 검사 유형을 지정합니다.

  • 노드 검사: 운영 체제를 스캔합니다.
  • 플랫폼 스캔: OpenShift 구성을 검사합니다.

프로세스

TailoredProfile 오브젝트에 다음 주석을 설정합니다.

+ .example new-profile.yaml

apiVersion: compliance.openshift.io/v1alpha1
kind: TailoredProfile
metadata:
  name: new-profile
  annotations:
    compliance.openshift.io/product-type: Node 1
spec:
  extends:
  description: My custom profile 2
  title: Custom profile 3
1
이에 따라 노드 또는 플랫폼을 설정합니다.
2
description 필드를 사용하여 새 TailoredProfile 오브젝트의 기능을 설명합니다.
3
TailoredProfile 오브젝트에 제목 필드의 제목 을 지정합니다.
참고

TailoredProfile 오브젝트의 name 필드에 -node 접미사를 추가하는 것은 Node 제품 유형 주석을 추가하고 운영 체제 스캔을 생성하는 것과 유사합니다.

5.8.2. 맞춤형 프로필을 사용하여 기존 ProfileBundle 확장

TailoredProfile CR에서는 가장 일반적인 맞춤 작업을 수행할 수 있지만 XCCDF 표준을 사용하면 OpenSCAP 프로필 맞춤 시 유연성이 훨씬 더 향상됩니다. 또한 조직에서 이전에 OpenScap을 사용한 적이 있는 경우 기존 XCCDF 맞춤 파일이 있을 수 있으며 이 파일을 다시 사용할 수 있습니다.

ComplianceSuite 오브젝트에는 사용자 정의 맞춤 파일을 가리킬 수 있는 선택적 TailoringConfigMap 특성이 포함되어 있습니다. TailoringConfigMap 특성 값은 구성 맵의 이름으로, 이 맵에는 tailoring.xml이라는 키가 포함되어야 하며 이 키의 값은 맞춤 콘텐츠입니다.

프로세스

  1. RHCOS(Red Hat Enterprise Linux CoreOS) ProfileBundle에 사용 가능한 규칙을 찾습니다.

    $ oc get rules.compliance -n openshift-compliance -l compliance.openshift.io/profile-bundle=rhcos4
  2. 해당 ProfileBundle에서 사용 가능한 변수를 찾습니다.

    $ oc get variables.compliance -n openshift-compliance -l compliance.openshift.io/profile-bundle=rhcos4
  3. 이름이 nist-moderate-modified 인 맞춤형 프로필을 생성합니다.

    1. nist-moderate-modified tailored profile에 추가할 규칙을 선택합니다. 이 예제에서는 두 개의 규칙을 비활성화하고 하나의 값을 변경하여 rhcos4-moderate 프로필을 확장합니다. rationale 값을 사용하여 이러한 변경이 이루어진 이유를 설명합니다.

      예: new-profile-node.yaml

      apiVersion: compliance.openshift.io/v1alpha1
      kind: TailoredProfile
      metadata:
        name: nist-moderate-modified
      spec:
        extends: rhcos4-moderate
        description: NIST moderate profile
        title: My modified NIST moderate profile
        disableRules:
        - name: rhcos4-file-permissions-var-log-messages
          rationale: The file contains logs of error messages in the system
        - name: rhcos4-account-disable-post-pw-expiration
          rationale: No need to check this as it comes from the IdP
        setValues:
        - name: rhcos4-var-selinux-state
          rationale: Organizational requirements
          value: permissive

      표 5.2. spec 변수의 속성
      속성설명

      extends

      TailoredProfile이 빌드되는 Profile 오브젝트의 이름입니다.

      title

      TailoredProfile의 사람이 읽을 수 있는 제목입니다.

      disableRules

      이름 및 이유 쌍 목록입니다. 각 이름은 비활성화할 규칙 오브젝트의 이름을 나타냅니다. 이유 값은 규칙이 비활성화된 이유를 설명하는 사람이 읽을 수 있는 텍스트입니다.

      manualRules

      이름 및 이유 쌍 목록입니다. 수동 규칙이 추가되면 검사 결과 상태는 항상 수동 이며 수정이 생성되지 않습니다. 이 속성은 자동이며, 수동 규칙으로 설정할 때 기본적으로 값이 없습니다.

      enableRules

      이름 및 이유 쌍 목록입니다. 각 이름은 활성화할 규칙 오브젝트의 이름을 나타냅니다. 이유 값은 규칙이 활성화된 이유를 설명하는 사람이 읽을 수 있는 텍스트입니다.

      description

      TailoredProfile을 설명하는 사람이 읽을 수 있는 텍스트입니다.

      setValues

      이름, 이유 및 값 그룹화 목록입니다. 각 이름은 설정된 값의 이름을 나타냅니다. 이유는 집합을 설명하는 사람이 읽을 수 있는 텍스트입니다. 값은 실제 설정입니다.

    2. tailoredProfile.spec.ECDHERules 특성을 추가합니다.

      Example tailoredProfile.spec.manualRules.yaml

      apiVersion: compliance.openshift.io/v1alpha1
      kind: TailoredProfile
      metadata:
        name: ocp4-manual-scc-check
      spec:
        extends: ocp4-cis
        description: This profile extends ocp4-cis by forcing the SCC check to always return MANUAL
        title: OCP4 CIS profile with manual SCC check
        manualRules:
          - name: ocp4-scc-limit-container-allowed-capabilities
            rationale: We use third party software that installs its own SCC with extra privileges

    3. TailoredProfile 오브젝트를 생성합니다.

      $ oc create -n openshift-compliance -f new-profile-node.yaml 1
      1
      TailoredProfile 오브젝트는 기본 openshift-compliance 네임스페이스에 생성됩니다.

      출력 예

      tailoredprofile.compliance.openshift.io/nist-moderate-modified created

  4. nist-moderate-modified tailored 프로필을 기본 ScanSetting 오브젝트에 바인딩하도록 ScanSettingBinding 오브젝트를 정의합니다.

    new-scansettingbinding.yaml의 예

    apiVersion: compliance.openshift.io/v1alpha1
    kind: ScanSettingBinding
    metadata:
      name: nist-moderate-modified
    profiles:
      - apiGroup: compliance.openshift.io/v1alpha1
        kind: Profile
        name: ocp4-moderate
      - apiGroup: compliance.openshift.io/v1alpha1
        kind: TailoredProfile
        name: nist-moderate-modified
    settingsRef:
      apiGroup: compliance.openshift.io/v1alpha1
      kind: ScanSetting
      name: default

  5. ScanSettingBinding 오브젝트를 생성합니다.

    $ oc create -n openshift-compliance -f new-scansettingbinding.yaml

    출력 예

    scansettingbinding.compliance.openshift.io/nist-moderate-modified created

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

© 2024 Red Hat, Inc.