TLS 서버: TLS 연결 허용
TLS 서버: TLS 연결 허용 (TLS Server: Allow TLS connections)
Event Gateway 서버로의 TLS 연결을 허용하는 방법을 안내하는 문서예요. 인증서와 키 쌍을 준비하는 사전 요건부터 tls_server 정책을 설정하는 절차까지 차근차근 설명해요. Konnect API, Terraform, kongctl 세 가지 방식으로 정책을 구성하는 예시도 함께 제공해요
출처: 문서
본문
TLS 연결 허용
Event Gateway 서버로의 TLS 연결을 허용해요.
키 값은 반드시 시크릿에 대한 참조여야 해요.
사전 준비
- 인증서와 키 쌍이 필요해요. 키는 환경 변수로 저장해야 해요. 인증서는 리터럴 값이거나 시크릿에 대한 참조일 수 있어요.
정책 설정하기
Konnect API
curl -X POST https://{region}.api.konghq.com/v1/event-gateways/{eventGatewayId}/listeners/{eventGatewayListenerId}/policies \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "tls",
"type": "tls_server",
"config": {
"certificates": [
{
"certificate": "${env[\"MY_CERTIFICATE\"]}",
"key": "${env[\"MY_SECRET\"]}"
}
],
"versions": {
"min": "TLSv1.2",
"max": "TLSv1.2"
},
"allow_plaintext": false
}
}
'
다음 플레이스홀더를 여러분의 값으로 바꿔야 해요:
-
region: Kong Konnect가 호스팅되고 운영되는 지리적 지역이에요. -
KONNECT_TOKEN: Konnect 계정과 연결된 개인 액세스 토큰(PAT)이에요. -
virtualClusterId: Virtual Cluster의id예요. -
eventGatewayId: Event Gateway의id예요. -
eventGatewayListenerId: Event Gateway Listener의id예요.
지역별 URL과 개인 액세스 토큰에 대해 알아보려면 Konnect Event Gateway API reference 문서를 확인하세요.
Terraform
사전 준비: 개인 액세스 토큰 구성하기
terraform {
required_providers {
konnect-beta = {
source = "kong/konnect-beta"
}
}
}
provider "konnect-beta" {
personal_access_token = "$KONNECT_TOKEN"
server_url = "https://us.api.konghq.com/"
}
Terraform 구성에 다음을 추가하세요:
resource "konnect_event_gateway_listener_policy_tls_server" "my_listener_policy_tls_server" {
provider = konnect-beta
type = "tls_server"
config = {
certificates = [
{
certificate = var.my_certificate
key = var.my_secret
} ]
versions = {
min = "TLSv1.2"
max = "TLSv1.2"
}
allow_plaintext = false
}
event_gateway_listener_id = konnect_event_gateway_listener.my_listener.id
gateway_id = konnect_event_gateway.my_event_gateway.id
}
kongctl
다음 예제는 새로운 tls_server 정책을 생성해요.
event_gateways:
- ref: eventGatewayName
name: eventGatewayName
listeners:
- ref: listenerName
name: listenerName
policies:
- ref: tls
type: tls_server
tls_server:
name: tls
config:
certificates:
- certificate: ${env["MY_CERTIFICATE"]}
key: ${env["MY_SECRET"]}
versions:
min: TLSv1.2
max: TLSv1.2
allow_plaintext: false
{: data-file="event_gateway_policy.yaml" data-tool="kongctl" }
다음 플레이스홀더를 여러분의 값으로 바꿔야 해요:
-
eventGatewayName: Event Gateway의name이에요. -
listenerName: Listener의name이에요.
관련 리소스
더 알아보기 (Learn more)
- Event Gateway 정책 엔티티의 개념과 구성 방법을 정리한 문서예요 — Policies
- 정책을 적용하는 리스너 엔티티에 대한 설명이에요 — Listeners
- mTLS 클라이언트 인증을 구성하는 방법을 단계별로 안내해요 — How-to: Configure mTLS client authentication
- TLS 신뢰 번들 엔티티를 관리하는 방법을 설명해요 — TLS trust bundles
- 리전별 URL과 개인 액세스 토큰 등 Konnect Event Gateway API 사용법을 확인할 수 있어요 — Konnect Event Gateway API reference