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

암호화 정책 구성 참조

원문 보기 위키 갱신

암호화 정책 구성 참조 (Encrypt Policy Configuration Reference)

이 문서는 Kong Event Gateway에서 Kafka 레코드와 키를 AES_256_GCM 방식으로 암호화하는 Encrypt 정책의 구성 옵션을 정리한 참조 자료예요. 정책 이름, 설명, 활성화 여부 같은 기본 필드부터 정책 적용 여부를 결정하는 조건식 작성 방법까지 각 속성이 어떤 역할을 하는지 하나씩 설명해요. Encrypt 정책을 직접 작성하거나 수정할 때 어떤 값을 넣어야 하는지 확인하는 기준으로 삼으면 좋아요

출처: 문서

본문

구성

{
  "description": "Encrypts Kafka records or keys using AES_256_GCM. Keys are therefore 256 bits long.",
  "type": "object",
  "properties": {
    "type": {
      "description": "The type name of the policy.",
      "type": "string",
      "enum": [
        "encrypt"
      ],
      "maxLength": 255,
      "minLength": 1,
      "x-terraform-transform-const": true
    },
    "name": {
      "description": "A unique user-defined name of the policy.",
      "type": "string",
      "maxLength": 255,
      "x-unicode-pattern": "^[\\p{L}\\p{N}][\\p{L}\\p{N} _\\-\\.:/+']*[\\p{L}\\p{N}]$"
    },
    "description": {
      "description": "A human-readable description of the policy.",
      "type": "string",
      "default": "",
      "maxLength": 512
    },
    "enabled": {
      "description": "Whether the policy is enabled.",
      "type": "boolean",
      "default": true
    },
    "labels": {
      "$ref": "#/components/schemas/Labels"
    },
    "config": {
      "description": "The configuration of the policy.",
      "type": "object",
      "$ref": "#/components/schemas/EventGatewayEncryptConfig"
    },
    "condition": {
      "description": "A string containing the boolean expression that determines whether the policy is applied.",
      "type": "string",
      "example": "context.topic.name.endsWith(\"my_suffix\") && record.headers[\"x-flag\"] == \"a-value\"",
      "default": "",
      "maxLength": 1000,
      "x-expression": {
        "type": "boolean",
        "fields": [
          {
            "name": "context.auth.principal.name",
            "type": "string",
            "description": "Name of authenticated principal. Username in case of PLAIN/SCRAM, `sub` claim in case of OAUTHBEARER."
          },
          {
            "name": "context.auth.principal.id",
            "type": "string",
            "description": "Kong Identity principal ID. Only populated when Kong Identity principal fetching is configured and succeeds.\n\n**Requires a minimum runtime version of `1.2`**.",
            "x-min-runtime-version": "1.2"
          },
          {
            "name": "context.auth.principal.metadata",
            "type": "object",
            "description": "Kong Identity principal metadata. Only populated when Kong Identity principal fetching is configured and succeeds. Values can be strings, numbers, booleans, arrays or nested JSON objects.\n\n**Requires a minimum runtime version of `1.2`**.",
            "x-min-runtime-version": "1.2"
          },
          {
            "name": "context.auth.type",
            "type": "string",
            "description": "The matched authentication type from a virtual cluster: anonymous, sasl_plain, sasl_scram_sha256, sasl_scram_sha512, sasl_oauth_bearer.\n"
          },
          {
            "name": "context.topic.name",
            "type": "string",
            "description": "The name of the topic."
          },
          {
            "name": "record.headers",
            "type": "object",
            "description": "An associative array of header key value pairs."
          }
        ]
      }
    }
  },
  "required": [
    "type",
    "config"
  ],
  "title": "Encrypt"
}

관련 리소스

더 알아보기 (Learn more)

  • 암호화된 메시지를 되돌리는 복호화 정책의 구성도 함께 확인해요 — Decrypt policy
  • 정책 엔티티의 기본 개념과 관리 방법을 먼저 짚고 가면 이해가 쉬워요 — Policies
  • 암호화에 사용할 키를 정적으로 등록하고 관리하는 방법을 알아봐요 — Static keys
  • 정책이 적용되는 가상 클러스터의 개념도 함께 살펴봐요 — Virtual clusters
  • Kafka 메시지를 실제로 암호화하고 복호화하는 전체 과정을 따라 해봐요 — Encrypt and decrypt Kafka messages with Kong Event Gateway