보안 및 컴플라이언스

Red Hat OpenShift Service on AWS 4

AWS 클러스터에서 보안 컨텍스트 제약 조건 구성

Red Hat OpenShift Documentation Team

초록

이 문서에서는 보안 컨텍스트 제약 조건을 구성하는 방법을 설명합니다.

1장. 감사 로그

AWS 감사의 Red Hat OpenShift Service는 시스템의 개별 사용자, 관리자 또는 기타 구성 요소가 시스템에 영향을 준 활동 순서를 문서화하는 보안 관련 레코드 집합을 제공합니다.

1.1. API 감사 로그 정보

감사는 API 서버 수준에서 작동하며 서버로 들어오는 모든 요청을 기록합니다. 각 감사 로그에는 다음 정보가 포함됩니다.

표 1.1. 감사 로그 필드

필드설명

level

이벤트가 생성된 감사 수준입니다.

auditID

각 요청에 생성되는 고유 감사 ID입니다.

stage

이 이벤트 인스턴스가 생성되었을 때의 요청 처리 단계입니다.

requestURI

클라이언트에서 서버로 보낸 요청 URI입니다.

verb

요청과 관련된 Kubernetes 동사입니다. 리소스가 아닌 요청의 경우 소문자 HTTP 메서드입니다.

user

인증된 사용자 정보입니다.

impersonatedUser

선택 사항입니다. 요청에서 다른 사용자를 가장하는 경우 가장된 사용자 정보입니다.

sourceIPs

선택 사항입니다. 요청이 발생한 소스 IP 및 중간 프록시입니다.

userAgent

선택 사항입니다. 클라이언트에서 보고한 사용자 에이전트 문자열입니다. 사용자 에이전트는 클라이언트에서 제공하며 신뢰할 수 없습니다.

objectRef

선택 사항입니다. 이 요청의 대상이 되는 오브젝트 참조입니다. 이는 List 유형의 요청 또는 리소스가 아닌 요청에는 적용되지 않습니다.

responseStatus

선택 사항입니다. ResponseObjectStatus 유형이 아닌 경우에도 채워지는 응답 상태입니다. 성공적인 응답을 위해 여기에는 코드만 포함됩니다. 상태 유형이 아닌 오류 응답의 경우 오류 메시지가 자동으로 채워집니다.

requestObject

선택 사항입니다. 요청의 API 오브젝트로, JSON 형식으로 되어 있습니다. RequestObject는 버전 변환, 기본값 설정, 승인 또는 병합 전에 요청에 있는 그대로(JSON으로 다시 인코딩될 수 있음) 기록됩니다. 외부 버전이 지정된 오브젝트 유형이며 그 자체로는 유효한 오브젝트가 아닐 수 있습니다. 리소스가 아닌 요청의 경우 생략되며 요청 수준 이상에서만 기록됩니다.

responseObject

선택 사항입니다. 응답에서 반환된 API 오브젝트로, JSON 형식으로 되어 있습니다. ResponseObject는 외부 유형으로 변환된 후 기록되고 JSON으로 직렬화됩니다. 리소스가 아닌 요청의 경우 생략되며 응답 수준에서만 기록됩니다.

requestReceivedTimestamp

요청이 API 서버에 도달한 시간입니다.

stageTimestamp

요청이 현재 감사 단계에 도달한 시간입니다.

annotations

선택 사항: 인증, 권한 부여 및 승인 플러그인을 포함하여 요청 서비스 체인에서 호출한 플러그인에 의해 설정될 수 있는 감사 이벤트와 함께 저장된 구조화되지 않은 키 값 맵입니다. 이러한 주석은 감사 이벤트용이며 제출된 오브젝트의 metadata.annotations와 일치하지 않습니다. 키는 이름 충돌을 방지하기 위해 알림 구성 요소를 고유하게 식별해야 합니다(예: podsecuritypolicy.admission.k8s.io/policy). 값은 짧아야 합니다. 주석은 메타데이터 수준에 포함됩니다.

Kubernetes API 서버의 출력 예:

{"kind":"Event","apiVersion":"audit.k8s.io/v1","level":"Metadata","auditID":"ad209ce1-fec7-4130-8192-c4cc63f1d8cd","stage":"ResponseComplete","requestURI":"/api/v1/namespaces/openshift-kube-controller-manager/configmaps/cert-recovery-controller-lock?timeout=35s","verb":"update","user":{"username":"system:serviceaccount:openshift-kube-controller-manager:localhost-recovery-client","uid":"dd4997e3-d565-4e37-80f8-7fc122ccd785","groups":["system:serviceaccounts","system:serviceaccounts:openshift-kube-controller-manager","system:authenticated"]},"sourceIPs":["::1"],"userAgent":"cluster-kube-controller-manager-operator/v0.0.0 (linux/amd64) kubernetes/$Format","objectRef":{"resource":"configmaps","namespace":"openshift-kube-controller-manager","name":"cert-recovery-controller-lock","uid":"5c57190b-6993-425d-8101-8337e48c7548","apiVersion":"v1","resourceVersion":"574307"},"responseStatus":{"metadata":{},"code":200},"requestReceivedTimestamp":"2020-04-02T08:27:20.200962Z","stageTimestamp":"2020-04-02T08:27:20.206710Z","annotations":{"authorization.k8s.io/decision":"allow","authorization.k8s.io/reason":"RBAC: allowed by ClusterRoleBinding \"system:openshift:operator:kube-controller-manager-recovery\" of ClusterRole \"cluster-admin\" to ServiceAccount \"localhost-recovery-client/openshift-kube-controller-manager\""}}

1.2. 감사 로그 수집

must-gather 툴을 사용하여 클러스터 디버깅을 위한 감사 로그를 수집할 수 있으며, 이를 통해 Red Hat 지원을 검토하거나 보낼 수 있습니다.

절차

  1. -- /usr/bin/gather_audit_logs 를 사용하여 oc adm must-gather 명령을 실행합니다.

    $ oc adm must-gather -- /usr/bin/gather_audit_logs
  2. 작업 디렉토리에서 생성된 must-gather 디렉토리에서 압축 파일을 만듭니다. 예를 들어 Linux 운영 체제를 사용하는 컴퓨터에서 다음 명령을 실행합니다.

    $ tar cvaf must-gather.tar.gz must-gather.local.472290403699006248 1
    1
    must-gather-local.472290403699006248 을 실제 디렉터리 이름으로 교체합니다.
  3. Red Hat Customer Portal에서 해당 지원 사례에 압축 파일을 첨부합니다.

법적 공지

Copyright © 2023 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.