이름과 채널을 참조하는 서브스크립션(container-security-operator)을 생성하는 정책입니다. 이 구성 정책에는 리소스를 생성하기 위해 적용되는 spec.remediationAction 이 설정되어 있어야 합니다. 서브스크립션은 서브스크립션이 지원하는 컨테이너로 프로필을 가져옵니다. 다음 예제를 확인합니다.
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-imagemanifestvuln-example-sub
spec:
remediationAction: enforce # will be overridden by remediationAction in parent policy
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: container-security-operator
namespace: openshift-operators
spec:
# channel: quay-v3.3 # specify a specific channel if desired
installPlanApproval: Automatic
name: container-security-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:name: policy-imagemanifestvuln-example-sub
spec:remediationAction: enforce # will be overridden by remediationAction in parent policyseverity: high
object-templates:-complianceType: musthave
objectDefinition:apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:name: container-security-operator
namespace: openshift-operators
spec:# channel: quay-v3.3 # specify a specific channel if desiredinstallPlanApproval: Automatic
name: container-security-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
Copy to ClipboardCopied!Toggle word wrapToggle overflow
컨테이너 보안 Operator 설치에 성공했는지 확인하기 위해 ClusterServiceVersion 을 감사하는 정보 구성 정책입니다. 다음 예제를 확인합니다.
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-imagemanifestvuln-status
spec:
remediationAction: inform # will be overridden by remediationAction in parent policy
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
namespace: openshift-operators
spec:
displayName: Red Hat Quay Container Security Operator
status:
phase: Succeeded # check the CSV status to determine if operator is running or not
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:name: policy-imagemanifestvuln-status
spec:remediationAction: inform # will be overridden by remediationAction in parent policyseverity: high
object-templates:-complianceType: musthave
objectDefinition:apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:namespace: openshift-operators
spec:displayName: Red Hat Quay Container Security Operator
status:phase: Succeeded # check the CSV status to determine if operator is running or not
Copy to ClipboardCopied!Toggle word wrapToggle overflow
이미지 취약점 검사에 의해 ImageManifestVuln 오브젝트가 생성되었는지 여부를 감사하는 정보 구성 정책입니다. 다음 예제를 확인합니다.
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-imagemanifestvuln-example-imv
spec:
remediationAction: inform # will be overridden by remediationAction in parent policy
severity: high
namespaceSelector:
exclude: ["kube-*"]
include: ["*"]
object-templates:
- complianceType: mustnothave # mustnothave any ImageManifestVuln object
objectDefinition:
apiVersion: secscan.quay.redhat.com/v1alpha1
kind: ImageManifestVuln # checking for a Kind
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:name: policy-imagemanifestvuln-example-imv
spec:remediationAction: inform # will be overridden by remediationAction in parent policyseverity: high
namespaceSelector:exclude:["kube-*"]include:["*"]object-templates:-complianceType: mustnothave # mustnothave any ImageManifestVuln objectobjectDefinition:apiVersion: secscan.quay.redhat.com/v1alpha1
kind: ImageManifestVuln # checking for a Kind
Copy to ClipboardCopied!Toggle word wrapToggle overflow
etcd 암호화 정책을 적용하여 ETCD 데이터 저장소에서 중요한 데이터의 암호화를 감지하거나 활성화합니다. Kubernetes 구성 정책 컨트롤러는 etcd-encryption 정책의 상태를 모니터링합니다. 자세한 내용은 OpenShift Container Platform 설명서의 etcd 데이터 암호화 를 참조하십시오. 참고: ETCD 암호화 정책은 Red Hat OpenShift Container Platform 4 이상만 지원합니다.
Compliance Operator는 OpenSCAP을 실행하는 Operator이며 필요한 보안 벤치마크와 함께 Red Hat OpenShift Container Platform 클러스터를 계속 준수할 수 있습니다. Compliance Operator 정책을 사용하여 관리 클러스터에 규정 준수 Operator를 설치할 수 있습니다.
규정 준수 Operator 정책은 Red Hat Advanced Cluster Management에서 Kubernetes 구성 정책으로 생성됩니다. OpenShift Container Platform 4.7 및 4.6은 규정 준수 Operator 정책을 지원합니다. 자세한 내용은 OpenShift Container Platform 설명서 의 Compliance Operator 이해를 참조하십시오.
Essential 8 (E8) 검사 정책은 마스터 및 작업자 노드에서 E8 보안 프로필을 준수하는지 확인하는 검사를 배포합니다. E8 검사 정책을 적용하려면 규정 준수 Operator를 설치해야 합니다.
E8 검사 정책은 Red Hat Advanced Cluster Management에서 Kubernetes 구성 정책으로 생성됩니다. OpenShift Container Platform 4.7 및 4.6에서는 E8 검사 정책을 지원합니다. 자세한 내용은 OpenShift Container Platform 설명서의 Compliance Operator 이해를 참조하십시오.
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: compliance-suite-e8
spec:
remediationAction: inform
severity: high
object-templates:
- complianceType: musthave # this template checks if scan has completed by checking the status field
objectDefinition:
apiVersion: compliance.openshift.io/v1alpha1
kind: ScanSettingBinding
metadata:
name: e8
namespace: openshift-compliance
profiles:
- apiGroup: compliance.openshift.io/v1alpha1
kind: Profile
name: ocp4-e8
- apiGroup: compliance.openshift.io/v1alpha1
kind: Profile
name: rhcos4-e8
settingsRef:
apiGroup: compliance.openshift.io/v1alpha1
kind: ScanSetting
name: default
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:name: compliance-suite-e8
spec:remediationAction: inform
severity: high
object-templates:-complianceType: musthave # this template checks if scan has completed by checking the status fieldobjectDefinition:apiVersion: compliance.openshift.io/v1alpha1
kind: ScanSettingBinding
metadata:name: e8
namespace: openshift-compliance
profiles:-apiGroup: compliance.openshift.io/v1alpha1
kind: Profile
name: ocp4-e8
-apiGroup: compliance.openshift.io/v1alpha1
kind: Profile
name: rhcos4-e8
settingsRef:apiGroup: compliance.openshift.io/v1alpha1
kind: ScanSetting
name: default
Copy to ClipboardCopied!Toggle word wrapToggle overflow
status 필드를 확인하여 검사가 완료되었는지 확인하는 ComplianceSuite 리소스(compliance-suite-e8)입니다.
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: compliance-suite-e8
spec:
remediationAction: inform
severity: high
object-templates:
- complianceType: musthave # this template checks if scan has completed by checking the status field
objectDefinition:
apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceSuite
metadata:
name: e8
namespace: openshift-compliance
status:
phase: DONE
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:name: compliance-suite-e8
spec:remediationAction: inform
severity: high
object-templates:-complianceType: musthave # this template checks if scan has completed by checking the status fieldobjectDefinition:apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceSuite
metadata:name: e8
namespace: openshift-compliance
status:phase: DONE
Copy to ClipboardCopied!Toggle word wrapToggle overflow
ComplianceCheckResult CR(사용자 정의 리소스)을 확인하여 검사 모음의 결과를 보고하는 ComplianceCheckResult 리소스(compliance-suite-e8-results)입니다.
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: compliance-suite-e8-results
spec:
remediationAction: inform
severity: high
object-templates:
- complianceType: mustnothave # this template reports the results for scan suite: e8 by looking at ComplianceCheckResult CRs
objectDefinition:
apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceCheckResult
metadata:
namespace: openshift-compliance
labels:
compliance.openshift.io/check-status: FAIL
compliance.openshift.io/suite: e8
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:name: compliance-suite-e8-results
spec:remediationAction: inform
severity: high
object-templates:-complianceType: mustnothave # this template reports the results for scan suite: e8 by looking at ComplianceCheckResult CRsobjectDefinition:apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceCheckResult
metadata:namespace: openshift-compliance
labels:compliance.openshift.io/check-status: FAIL
compliance.openshift.io/suite: e8
Copy to ClipboardCopied!Toggle word wrapToggle overflow
참고: 자동 수정이 지원됩니다. ScanSettingBinding 리소스를 생성하기 위해 적용 되도록 수정 작업을 설정합니다.
OpenShift CIS 검사 정책은 마스터 및 작업자 노드를 확인하여 OpenShift CIS 보안 벤치마크를 준수하는 검사를 배포합니다. OpenShift CIS 정책을 적용하려면 규정 준수 Operator를 설치해야 합니다.
OpenShift CIS 검사 정책은 Red Hat Advanced Cluster Management에서 Kubernetes 구성 정책으로 생성됩니다. OpenShift Container Platform 4.9, 4.7 및 4.6은 OpenShift CIS 검사 정책을 지원합니다. 자세한 내용은 OpenShift Container Platform 설명서 의 Compliance Operator 이해를 참조하십시오.
Copy to ClipboardCopied!Toggle word wrapToggle overflow
status 필드를 확인하여 검사가 완료되었는지 확인하는 ComplianceSuite 리소스(compliance-suite-cis)
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: compliance-suite-cis
spec:
remediationAction: inform
severity: high
object-templates:
- complianceType: musthave # this template checks if scan has completed by checking the status field
objectDefinition:
apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceSuite
metadata:
name: cis
namespace: openshift-compliance
status:
phase: DONE
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:name: compliance-suite-cis
spec:remediationAction: inform
severity: high
object-templates:-complianceType: musthave # this template checks if scan has completed by checking the status fieldobjectDefinition:apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceSuite
metadata:name: cis
namespace: openshift-compliance
status:phase: DONE
Copy to ClipboardCopied!Toggle word wrapToggle overflow
ComplianceCheckResult CR(사용자 정의 리소스)을 확인하여 검사 모음의 결과를 보고하는 ComplianceCheckResult 리소스(compliance-suite-cis-results)입니다.
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: compliance-suite-cis-results
spec:
remediationAction: inform
severity: high
object-templates:
- complianceType: mustnothave # this template reports the results for scan suite: cis by looking at ComplianceCheckResult CRs
objectDefinition:
apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceCheckResult
metadata:
namespace: openshift-compliance
labels:
compliance.openshift.io/check-status: FAIL
compliance.openshift.io/suite: cis
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:name: compliance-suite-cis-results
spec:remediationAction: inform
severity: high
object-templates:-complianceType: mustnothave # this template reports the results for scan suite: cis by looking at ComplianceCheckResult CRsobjectDefinition:apiVersion: compliance.openshift.io/v1alpha1
kind: ComplianceCheckResult
metadata:namespace: openshift-compliance
labels:compliance.openshift.io/check-status: FAIL
compliance.openshift.io/suite: cis
Copy to ClipboardCopied!Toggle word wrapToggle overflow