필드 암호화 정책 구성 참조
필드 암호화 정책 구성 참조 (Encrypt Fields Policy)
이 문서는 Kong Event Gateway에서 파싱된 Kafka 레코드의 필드를 AES_256_GCM으로 암호화하는 Encrypt Fields 정책의 구성 참조 문서예요. 이 정책은 스키마 검증 정책의 자식 정책으로만 사용할 수 있고, 일부 기능은 런타임 버전 1.2 이상이 필요하다는 점을 기억해두면 좋아요. 정책 이름, 설명, 활성화 여부, 적용 조건식 같은 각 속성이 어떤 역할을 하는지 하나씩 살펴볼게요. 조건식에서는 인증 주체 정보나 record.value 필드를 참조할 수 있으니 활용 범위가 꽤 넓어요
출처: 문서
본문
구성
{
"description": "Encrypts fields of parsed Kafka records using AES_256_GCM. Keys are therefore 256 bits long.\n\nNote this policy can only be used as a child of a `EventGatewayProduceSchemaValidationPolicy` policy.\n\n**Requires a minimum runtime version of `1.2`**.",
"type": "object",
"properties": {
"type": {
"description": "The type name of the policy.",
"type": "string",
"enum": [
"encrypt_fields"
],
"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/EventGatewayParsedRecordEncryptFieldsConfig"
},
"condition": {
"description": "A string containing the boolean expression that determines whether the policy is applied.\n\nWhen the policy is applied as a child policy of schema_validation, the expression can also reference\n`record.value` fields.\n",
"type": "string",
"example": "record.value.content.foo.bar == \"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."
},
{
"name": "record.value.validated",
"type": "boolean",
"description": "Indicates whether the record value was successfully validated."
},
{
"name": "record.value.content",
"type": "object",
"description": "The content of the record value."
},
{
"name": "record.value.schema",
"type": "object",
"x-min-runtime-version": "1.2",
"description": "Registry-supplied schema metadata for the record value. Populated when the value\nwas validated by a Confluent schema registry. Fields: `id` (uint), `version` (uint,\nwhen returned by the registry), `format` (\"avro\"|\"json\"), and either\n`avro.{name, namespace}` or `json.{title, id}`. Sub-fields are absent when not\napplicable; use `has()` to test presence. Registry `metadata` (tags and properties)\nis available from runtime 1.3 via `record.value.schema.metadata`.\n\n**Requires a minimum runtime version of `1.2`**."
},
{
"name": "record.value.schema.metadata",
"type": "object",
"x-min-runtime-version": "1.3",
"description": "Confluent schema-registry metadata for the record value. Present (as empty maps)\nwhenever `record.value.schema` is present. Fields:\n* `properties` (`map` of `string` to `string`) - Confluent `metadata.properties`;\n empty map when the registry omits it.\n* `tags` (`map` of `string` to list of `string`) - keyed by tag, value is the list\n of Confluent schema paths (e.g. `io.confluent.field.<name>`) carrying that tag;\n empty map when the registry omits it.\n\n**Requires a minimum runtime version of `1.3`**."
},
{
"name": "record.key.schema",
"type": "object",
"x-min-runtime-version": "1.2",
"description": "Same shape as `record.value.schema`, populated when the record key has\nschema_validation configured.\n\n**Requires a minimum runtime version of `1.2`**."
},
{
"name": "record.key.schema.metadata",
"type": "object",
"x-min-runtime-version": "1.3",
"description": "Same shape as `record.value.schema.metadata`, populated when the record key has\nschema_validation configured.\n\n**Requires a minimum runtime version of `1.3`**."
}
]
}
}
},
"required": [
"type",
"config"
],
"title": "Encrypt Parsed Record",
"x-min-runtime-version": "1.2"
}
관련 리소스
더 알아보기 (Learn more)
- Encrypt Fields 정책과 짝을 이루는 복호화 정책의 구성을 확인할 수 있어요 — Decrypt Fields policy
- 정책 엔티티의 기본 개념과 관리 방법을 함께 이해하면 좋아요 — Policies
- 암호화에 사용되는 정적 키 엔티티의 구성 방법을 살펴볼 수 있어요 — Static keys
- Kafka 메시지 필드를 실제로 암호화하고 복호화하는 전체 과정을 따라 해볼 수 있어요 — Encrypt and decrypt Kafka message fields with Kong Event Gateway
- 동적으로 필드를 암호화하고 복호화하는 심화 시나리오를 확인할 수 있어요 — Encrypt and decrypt Kafka message fields dynamically with Kong Event Gateway