인증
1장. 런타임 시 인증 이해 링크 복사링크가 클립보드에 복사되었습니다!
이미지를 빌드할 때 다음 시나리오에서 인증을 정의해야 할 수 있습니다.
- 컨테이너 레지스트리에 인증
- Git에서 소스 코드 가져오기
인증은 필요한 중요한 데이터가 저장되는 보안 정의를 통해 수행됩니다.
1.1. 빌드 보안 주석 링크 복사링크가 클립보드에 복사되었습니다!
빌드 보안에 build.shipwright.io/referenced.secret: "true"
주석을 추가할 수 있습니다. 이 주석을 기반으로 빌드 컨트롤러는 빌드 보안에 대한 이벤트 생성, 업데이트 또는 삭제와 같은 이벤트 시 조정 작업을 수행합니다. 다음 예제에서는 보안과 함께 주석을 사용하는 방법을 보여줍니다.
이 주석은 빌드 인스턴스에서 참조하지 않는 보안을 필터링합니다. 예를 들어 시크릿에 이 주석이 없는 경우 보안에 대해 이벤트가 트리거된 경우에도 빌드 컨트롤러에서 조정하지 않습니다. 이벤트 트리거를 조정하면 빌드 컨트롤러에서 빌드 구성에 대한 검증을 다시 트리거하여 종속성이 누락되었는지 파악할 수 있습니다.
1.2. Git 리포지토리에 대한 인증 링크 복사링크가 클립보드에 복사되었습니다!
Git 리포지토리에 대해 다음과 같은 인증 유형을 정의할 수 있습니다.
- 기본 인증
- SSH(Secure Shell) 인증
Build
CR에서 두 가지 유형의 인증을 사용하여 Git 보안을 구성할 수도 있습니다.
1.2.1. 기본 인증 링크 복사링크가 클립보드에 복사되었습니다!
기본 인증을 사용하여 Git 리포지토리의 사용자 이름과 암호를 구성해야 합니다. 다음 예제에서는 Git에 대한 기본 인증을 사용하는 방법을 보여줍니다.
1.2.2. SSH 인증 링크 복사링크가 클립보드에 복사되었습니다!
SSH 인증을 사용하면 사용할 Git 리포지토리 공급자의 호스트 이름을 지정하도록 Tekton 주석을 구성해야 합니다. 예를 들어 GitHub의 경우 github.com
또는 GitLab 의 경우 github.com
입니다.
다음 예제에서는 Git에 대한 SSH 인증을 사용하는 방법을 보여줍니다.
1.2.3. Git 시크릿 사용 링크 복사링크가 클립보드에 복사되었습니다!
관련 네임스페이스에 보안을 생성한 후 Build
사용자 정의 리소스(CR)에서 참조할 수 있습니다. 두 가지 유형의 인증을 모두 사용하여 Git 시크릿을 구성할 수 있습니다.
다음 예제에서는 SSH 인증 유형을 사용하여 Git 시크릿을 사용하는 방법을 보여줍니다.
다음 예제에서는 기본 인증 유형을 사용하여 Git 보안을 사용하는 방법을 보여줍니다.
1.3. 컨테이너 레지스트리에 대한 인증 링크 복사링크가 클립보드에 복사되었습니다!
이미지를 프라이빗 컨테이너 레지스트리로 내보내려면 해당 네임스페이스에 보안을 정의한 다음 Build
사용자 정의 리소스(CR)에서 참조해야 합니다.
프로세스
다음 명령을 실행하여 보안을 생성합니다.
oc --namespace <namespace> create secret docker-registry <container_registry_secret_name> \ --docker-server=<registry_host> \ --docker-username=<username> \ --docker-password=<password> \ --docker-email=<email_address>
$ oc --namespace <namespace> create secret docker-registry <container_registry_secret_name> \ --docker-server=<registry_host> \
1 --docker-username=<username> \
2 --docker-password=<password> \
3 --docker-email=<email_address>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 다음 명령을 실행하여 보안에 주석을 답니다.
oc --namespace <namespace> annotate secrets <container_registry_secret_name> build.shipwright.io/referenced.secret='true'
$ oc --namespace <namespace> annotate secrets <container_registry_secret_name> build.shipwright.io/referenced.secret='true'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow spec.output.pushSecret
필드의 값을Build
CR의 보안 이름으로 설정합니다.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.4. 역할 기반 액세스 제어 링크 복사링크가 클립보드에 복사되었습니다!
릴리스 배포 YAML 파일에는 Builds 오브젝트를 사용하기 위한 두 가지 클러스터 전체 역할이 포함되어 있습니다. 기본적으로 다음 역할이 설치됩니다.
-
shpwright-build-aggregate-view
:Build
Strategy ,Cluster
BuildStrategy
,BuildRun
과 같은 Builds 리소스에 대한 읽기 액세스 권한을 부여합니다. 이 역할은 Kubernetes뷰
역할에 집계됩니다. -
shipwright-build-aggregate-edit
: 네임스페이스 수준에서 구성된 Builds 리소스에 대한 액세스 권한을 작성합니다. 빌드 리소스에는BuildStrategy
,Build
,BuildRun
이 포함됩니다. 모든ClusterBuildStrategy
리소스에 읽기 액세스 권한이 부여됩니다. 이 역할은 Kubernetesedit
및admin
역할에 집계됩니다.
클러스터 관리자만 ClusterBuildStrategy
리소스에 대한 쓰기 액세스 권한이 있습니다. 이러한 권한으로 별도의 Kubernetes ClusterRole
역할을 생성하고 해당 역할을 적절한 사용자에게 바인딩하여 이 설정을 변경할 수 있습니다.
Legal Notice
링크 복사링크가 클립보드에 복사되었습니다!
Copyright © 2025 Red Hat
OpenShift documentation is licensed under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0).
Modified versions must remove all Red Hat trademarks.
Portions adapted from https://github.com/kubernetes-incubator/service-catalog/ with modifications by Red Hat.
Red Hat, Red Hat Enterprise Linux, the Red Hat logo, the Shadowman 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 Software Collections 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.