4.6. initdata 생성


initdata를 생성하여 런타임 시 민감하거나 워크로드별 데이터로 Pod를 안전하게 초기화하므로 이 데이터를 가상 머신 이미지에 포함할 필요가 없습니다. 이 접근 방식은 기밀 정보 노출 위험을 줄이고 사용자 정의 이미지 빌드의 필요성을 제거하여 추가 보안을 제공합니다.

Pod 구성 맵에서 글로벌 구성 또는 Pod 매니페스트에서 특정 Pod에 initdata를 지정할 수 있습니다. Pod 매니페스트의 initdata 값은 Pod 구성 맵에 설정된 값을 덮어씁니다.

중요

프로덕션 환경에서는 기본 허용 Kata 에이전트 정책을 재정의하려면 initdata를 생성해야 합니다.

피어 Pod 구성 맵에서 글로벌 구성 또는 특정 Pod에 대해 피어 Pod 매니페스트에서 initdata를 지정할 수 있습니다. 피어 Pod 매니페스트의 initdata 값은 피어 Pod 구성 맵에 설정된 값을 덮어씁니다.

중요

Red Hat build of Trustee의 kbs-config 구성 맵에서 insecure_http = true 를 구성하는 경우 kbs_cert 설정을 삭제해야 합니다.

프로세스

  1. 다음 명령을 실행하여 Red Hat build of Trustee IP 주소를 받으십시오.

    $ oc get node $(oc get pod -n trustee-operator-system \
      -o jsonpath='{.items[0].spec.nodeName}') \
      -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}'
    Copy to Clipboard Toggle word wrap

    출력 예

    192.168.122.22
    Copy to Clipboard Toggle word wrap

  2. 다음 명령을 실행하여 포트를 가져옵니다.

    $ oc get svc kbs-service -n trustee-operator-system
    Copy to Clipboard Toggle word wrap

    출력 예

    NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
    kbs-service  NodePort    172.30.116.11   <none>        8080:32178/TCP   12d
    Copy to Clipboard Toggle word wrap

  3. initdata.toml 파일을 생성합니다.

    algorithm = "sha384"
    version = "0.1.0"
    
    [data]
    "aa.toml" = '''
    [token_configs]
    [token_configs.coco_as]
    
    url = '<trustee_url>'
    
    [token_configs.kbs]
    url = '<trustee_url>'
    '''
    
    "cdh.toml" = '''
    socket = 'unix:///run/confidential-containers/cdh.sock'
    credentials = []
    
    [kbc]
    name = 'cc_kbc'
    url = '<trustee_url>'
    kbs_cert = """
    -----BEGIN CERTIFICATE-----
    <kbs_certificate>
    -----END CERTIFICATE-----
    """
    [image]
    image_security_policy_uri = 'kbs:///default/<secret-policy-name>/<key>
    '''
    
    "policy.rego" = '''
    package agent_policy
    
    default AddARPNeighborsRequest := true
    default AddSwapRequest := true
    default CloseStdinRequest := true
    default CopyFileRequest := true
    default CreateContainerRequest := true
    default CreateSandboxRequest := true
    default DestroySandboxRequest := true
    default GetMetricsRequest := true
    default GetOOMEventRequest := true
    default GuestDetailsRequest := true
    default ListInterfacesRequest := true
    default ListRoutesRequest := true
    default MemHotplugByProbeRequest := true
    default OnlineCPUMemRequest := true
    default PauseContainerRequest := true
    default PullImageRequest := true
    default ReadStreamRequest := true
    default RemoveContainerRequest := true
    default RemoveStaleVirtiofsShareMountsRequest := true
    default ReseedRandomDevRequest := true
    default ResumeContainerRequest := true
    default SetGuestDateTimeRequest := true
    default SignalProcessRequest := true
    default StartContainerRequest := true
    default StartTracingRequest := true
    default StatsContainerRequest := true
    default StopTracingRequest := true
    default TtyWinResizeRequest := true
    default UpdateContainerRequest := true
    default UpdateEphemeralMountsRequest := true
    default UpdateInterfaceRequest := true
    default UpdateRoutesRequest := true
    default WaitProcessRequest := true
    default ExecProcessRequest := false
    default SetPolicyRequest := false
    default WriteStreamRequest := false
    
    ExecProcessRequest if {
        input_command = concat(" ", input.process.Args)
        some allowed_command in policy_data.allowed_commands
        input_command == allowed_command
    }
    
    policy_data := {
      "allowed_commands": [
            "curl http://127.0.0.1:8006/cdh/resource/default/attestation-status/status"
      ]
    }
    '''
    Copy to Clipboard Toggle word wrap
    url
    Red Hat build of Trustee IP 주소와 포트를 지정합니다(예: https://192.168.122.22:32178 ).
    <kbs_certificate>
    인증 에이전트의 Base64로 인코딩된 TLS 인증서를 지정합니다.
    kbs_cert
    Red Hat build of Trustee의 kbs-config 구성 맵에서 insecure_http = true 를 구성하는 경우 kbs_cert 설정을 삭제합니다.
    image_security_policy_uri
    컨테이너 이미지 서명 확인 정책을 활성화한 경우에만 선택 사항입니다. < secret-policy-name > 및 < key >를 KbsConfig 사용자 정의 리소스 생성에 각각 지정된 보안 이름 및 키로 바꿉니다.
  4. 다음 명령을 실행하여 initdata.toml 파일을 텍스트 파일의 gzip 형식의 Base64 인코딩 문자열로 변환합니다.

    $ cat initdata.toml | gzip | base64 -w0 > initdata.txt
    Copy to Clipboard Toggle word wrap

    피어 Pod 구성 맵 또는 피어 Pod 매니페스트에 사용할 이 문자열을 기록합니다.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

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

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

Red Hat 소개

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

Theme

© 2025 Red Hat