본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Passbolt

원문 보기 위키 갱신

External Secrets Operator는 Passbolt API와 통합해서 Passbolt를 Kubernetes 클러스터가 가진 시크릿과 동기화해요.

출처: External Secrets

본문

Creating a Passbolt secret store

Kind=SecretStore에 passbolt provider가 나열되어 있고, auth와 host가 설정되어 있는지 확인하세요. API는 secret에 제공된 password와 private key를 요구해요.

apiVersion: external-secrets.io/v1
kind: SecretStore
metadata:
  name: passbolt
spec:
  provider:
    passbolt:
      host: https://passbolt.passbolt.svc.cluster.local
      auth:
        passwordSecretRef:
          key: password
          name: passbolt-credentials
        privateKeySecretRef:
          key: privateKey
          name: passbolt-credentials

Custom CA certificate

Passbolt 인스턴스가 사설 또는 커스텀 Certificate Authority(CA)가 서명한 인증서를 사용한다면, ESO가 Passbolt 서버 인증서를 검증할 때 사용할 CA 번들을 설정할 수 있어요. PEM으로 인코딩된 번들을 caBundle로 인라인으로 제공하거나, Secret/ConfigMap을 caProvider로 참조하면 돼요.

apiVersion: external-secrets.io/v1
kind: SecretStore
metadata:
  name: passbolt-with-custom-ca
spec:
  provider:
    passbolt:
      host: https://passbolt.example.com
      # Reference a ConfigMap or Secret containing the CA bundle that signed
      # the Passbolt server certificate.
      caProvider:
        type: ConfigMap
        name: passbolt-ca-bundle
        key: ca.crt
      auth:
        passwordSecretRef:
          key: password
          name: passbolt-credentials
        privateKeySecretRef:
          key: privateKey
          name: passbolt-credentials

caBundle도 caProvider도 설정하지 않으면 ESO는 시스템 루트 인증서로 TLS 연결을 검증해요.

Creating an external secret

Passbolt 시크릿을 Kubernetes secret으로 동기화하려면 Kind=ExternalSecret가 필요해요. 기본적으로 시크릿은 name, username, uri, password, description을 포함해요.

단일 속성만 선택하려면 property 키를 추가하면 돼요.

apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: passbolt-example-simple
spec:
  refreshInterval: "1h0m0s"
  secretStoreRef:
    name: passbolt
    kind: SecretStore
  target:
    name: passbolt-example
  data:
  - secretKey: full_secret
    remoteRef:
      key: e22487a8-feb8-4591-95aa-14b193930cb4 # Replace with ID of exising Passbolt secret
  - secretKey: password_only
    remoteRef:
      key: e22487a8-feb8-4591-95aa-14b193930cb4 # Replace with ID of exising Passbolt secret
      property: password # You can limit the secret to only display one property

위 ExternalSecret은 다음과 같은 형태의 secret을 만들어요:

apiVersion: v1
kind: Secret
metadata:
  name: passbolt-example
data:
  full_secret: '{"name":"passbolt-secret","username":"some-username","password":"supersecretpassword","uri":"passbolt.com","description":"some description"}'
  password_only: supersecretpassword
type: Opaque

Finding a secret by name

ID로 시크릿을 가져오는 대신, dataFrom을 사용해 이름으로 시크릿을 검색할 수도 있어요.

apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: passbolt-example
spec:
  refreshInterval: "1h0m0s"
  secretStoreRef:
    name: passbolt
    kind: SecretStore
  target:
    name: passbolt-example
  dataFrom:
    - find:
        name:
          regexp: ".*"

Custom fields

Passbolt 리소스는 표준 name, username, password, uri, description 속성 외에도 임의의 custom fields를 가질 수 있어요. ESO는 각 custom field를 custom_fields.<name> 속성 문법으로 노출하는데, <name>은 Passbolt에서 설정된 필드의 표시 이름(display name)이에요.

apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: passbolt-custom-fields-example
spec:
  refreshInterval: "1h0m0s"
  secretStoreRef:
    name: passbolt
    kind: SecretStore
  target:
    name: passbolt-custom-fields
  data:
    # Fetch a single custom field by its display name (metadata_key).
    # The property value is the literal prefix "custom_fields." followed by
    # the name of the field as configured in Passbolt.
  - secretKey: api_token
    remoteRef:
      key: e22487a8-feb8-4591-95aa-14b193930cb4 # Replace with the ID of an existing Passbolt secret
      property: custom_fields.api-token
  - secretKey: deploy_key
    remoteRef:
      key: e22487a8-feb8-4591-95aa-14b193930cb4
      property: custom_fields.deploy-key
    # Omitting property returns the full secret as JSON, with custom_fields
    # included as a nested object keyed by the field display name.
  - secretKey: full_secret
    remoteRef:
      key: e22487a8-feb8-4591-95aa-14b193930cb4

위 ExternalSecret은 다음과 같은 형태의 Kubernetes Secret을 만들어요:

apiVersion: v1
kind: Secret
metadata:
  name: passbolt-custom-fields
data:
  api_token: my-api-token-value
  deploy_key: ssh-ed25519-AAAA...
  full_secret: '{"name":"my-service","username":"deploy","password":"supersecretpassword","uri":"https://example.com","description":"","custom_fields":{"api-token":"my-api-token-value","deploy-key":"ssh-ed25519-AAAA..."}}'
type: Opaque

property를 지정하지 않으면 전체 시크릿이 JSON 객체로 반환돼요. 리소스에 명명된 custom field가 하나라도 있으면 custom_fields 키가 그 객체에 포함돼요.

Passbolt는 custom field의 각 절반을 필드 설정이 요구하는 쪽에 저장해요. 즉 name은 cleartext 메타데이터이거나 secret과 함께 암호화되고, value도 마찬가지예요. ESO는 읽기 전에 양쪽을 모두 복호화하므로, 어느 쪽이든 필드를 표시 이름으로 주소 지정할 수 있어요.

더 알아보기 (Learn more)