Menu Close
5.9.3. 플랫폼 점검 수동 수정
플랫폼 검사에 대한 점검은 일반적으로 다음 두 가지 이유로 관리자가 수동으로 수정해야 합니다.
- 설정해야 하는 값을 자동으로 결정할 수 없는 경우가 있습니다. 검사 중 하나를 통해 허용된 레지스트리 목록을 제공해야 하지만 스캐너에서는 조직이 허용하려는 레지스트리를 알 수 없습니다.
-
다양한 점검에서 여러 API 오브젝트를 수정하므로 클러스터의 오브젝트를 수정하려면
root
또는 슈퍼 유저 액세스 권한을 가져오기 위해 자동 수정이 필요합니다. 이 방법은 바람직하지 않습니다.
프로세스
아래 예제에서는
ocp4-ocp-allowed-registries-for-import
규칙을 사용하며 기본 OpenShift Container Platform 설치에서 실패합니다.oc get rule.compliance/ocp4-ocp-allowed-registries-for-import -oyaml
규칙을 검사합니다. 이 규칙은allowedRegistriesForImport
특성을 설정하여 사용자가 이미지를 가져올 수 있는 레지스트리를 제한합니다. 규칙의 warning 특성에는 점검된 API 오브젝트도 표시되므로 이를 수정하고 문제를 해결할 수 있습니다.$ oc edit image.config.openshift.io/cluster
출력 예
apiVersion: config.openshift.io/v1 kind: Image metadata: annotations: release.openshift.io/create-only: "true" creationTimestamp: "2020-09-10T10:12:54Z" generation: 2 name: cluster resourceVersion: "363096" selfLink: /apis/config.openshift.io/v1/images/cluster uid: 2dcb614e-2f8a-4a23-ba9a-8e33cd0ff77e spec: allowedRegistriesForImport: - domainName: registry.redhat.io status: externalRegistryHostnames: - default-route-openshift-image-registry.apps.user-cluster-09-10-12-07.devcluster.openshift.com internalRegistryHostname: image-registry.openshift-image-registry.svc:5000
검사를 다시 실행합니다.
$ oc annotate compliancescans/<scan_name> compliance.openshift.io/rescan=