7.7.2.2. ProfileBindings를 사용하여 프로필에 워크로드 바인딩


ProfileBinding 리소스를 사용하여 보안 프로필을 컨테이너의 SecurityContext 에 바인딩할 수 있습니다.

프로세스

  1. quay.io/security-profiles-operator/test-nginx-unprivileged:1.21 이미지를 사용하는 Pod를 SelinuxProfile 프로필 예제에 바인딩하려면 Pod 및 SelinuxProfile 오브젝트를 사용하여 동일한 네임스페이스에 ProfileBinding 오브젝트를 생성합니다.

    apiVersion: security-profiles-operator.x-k8s.io/v1alpha1
    kind: ProfileBinding
    metadata:
      namespace: my-namespace
      name: nginx-binding
    spec:
      profileRef:
        kind: SelinuxProfile 
    1
    
        name: profile 
    2
    
      image: quay.io/security-profiles-operator/test-nginx-unprivileged:1.21 
    3
    1
    kind: 변수는 프로필의 종류를 나타냅니다.
    2
    name: 변수는 프로필의 이름을 나타냅니다.
    3
    이미지 특성에서 와일드카드를 사용하여 기본 보안 프로필을 활성화할 수 있습니다. image: "*"
    중요

    image: "*" 와일드카드 속성을 사용하면 모든 새 Pod가 지정된 네임스페이스의 기본 보안 프로필로 바인딩됩니다.

  2. 다음 명령을 실행하여 enable-binding=true 로 네임스페이스에 레이블을 지정합니다.

    $ oc label ns my-namespace spo.x-k8s.io/enable-binding=true
  3. test-pod.yaml 이라는 Pod를 정의합니다.

    apiVersion: v1
    kind: Pod
    metadata:
      name: test-pod
    spec:
      containers:
      - name: test-container
        image: quay.io/security-profiles-operator/test-nginx-unprivileged:1.21
  4. Pod를 생성합니다.

    $ oc create -f test-pod.yaml
    참고

    Pod가 이미 존재하는 경우 바인딩이 제대로 작동하려면 Pod를 다시 생성해야 합니다.

검증

  • 다음 명령을 실행하여 Pod가 ProfileBinding 을 상속하는지 확인합니다.

    $ oc get pod test-pod -o jsonpath='{.spec.containers[*].securityContext.seLinuxOptions.type}'

    출력 예

    profile.process

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

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

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

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

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동