TrendAI API Security 플러그인 활성화
TrendAI API Security 플러그인 활성화 (Enable the TrendAI API Security plugin)
TrendAI API Security 플러그인을 활성화해서 Kong Gateway의 데이터를 TrendAI Vision One으로 전송하는 방법을 안내해요. 플러그인 설정에 필요한 사전 요구 사항과 환경 변수를 먼저 확인해요. 이어서 decK, Admin API, Konnect API 세 가지 방식으로 플러그인을 설정하는 절차를 하나씩 살펴봐요
출처: 문서
본문
TrendAI API Security 플러그인 활성화하기v2.7+
TrendAI API Security 플러그인을 활성화하면 TrendAI Vision One으로 데이터를 보낼 수 있어요.
다음 예제에서는 TrendAI API Security 플러그인이 TrendAI Vision One API 키로 구성되어 매시간 TrendAI Vision One에 구성 데이터를 보내요. TrendAI Vision One 엔드포인트는 TrendAI Vision One 계정의 리전을 기준으로 데이터가 적절한 데이터 센터로 라우팅되도록 해줘요.
Kong Gateway용 TrendAI Vision One 플러그인은 Trend Vision One API 키와 엔드포인트 URL에 의존해요. Trend Vision One의 Kong Gateway Third-Party Integrations 페이지에서 이 파라미터들을 복사해 두었는지 확인하세요. 이 키는 Vault에 저장하고 관리하는 것을 추천해요. 자세한 내용은 시크릿 관리를 참고하세요.
사전 준비
-
TrendAI API Security 플러그인을 다운로드하고 설치하세요.
-
Trend Vision One의 Kong Gateway Third-Party Integrations 페이지에서 Trend Vision One API 키와 엔드포인트 URL(
fqdn)을 복사하세요.
환경 변수
-
V1_ENDPOINT: Trend Vision One의 Kong Gateway Third-Party Integrations 페이지에서 복사한 TrendAI Vision One 엔드포인트 URL(fqdn)이에요. 예를 들어,export V1_ENDPOINT=https://api.xdr.trendmicro.com과 같아요. -
TREND_API_KEY: 환경 변수로 내보낸 Trend Vision One API 키예요. 예를 들어,export TREND_API_KEY={api_key}와 같아요.
플러그인 설정하기
전역
decK
다음 섹션을 kong.yaml 구성 파일에 추가하세요:
_format_version: "3.0"
plugins:
- name: trend-micro-kong-plugin-aps
config:
fqdn: ${{ env "DECK_V1_ENDPOINT" }}
token: ${{ env "DECK_TREND_API_KEY" }}
{: data-file="kong.yaml" data-tool="deck" }
Admin API
다음 요청을 보내세요:
curl -i -X POST http://localhost:8001/plugins/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "trend-micro-kong-plugin-aps",
"config": {
"fqdn": "'$V1_ENDPOINT'",
"token": "'$TREND_API_KEY'"
}
}
'
Konnect API
다음 요청을 보내세요:
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "trend-micro-kong-plugin-aps",
"config": {
"fqdn": "'$V1_ENDPOINT'",
"token": "'$TREND_API_KEY'"
}
}
'
다음 플레이스홀더는 반드시 여러분의 값으로 바꿔야 해요:
-
region: Kong Konnect가 호스팅되고 운영되는 지리적 리전이에요. -
KONNECT_TOKEN: Konnect 계정에 연결된 여러분의 개인 액세스 토큰(PAT)이에요. -
controlPlaneId: 컨트롤 플레인의id예요.
리전별 URL과 개인 액세스 토큰에 대해 알아보려면 Konnect Control Planes Config API 레퍼런스를 참고하세요.
KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name:
namespace: kong
annotations:
kubernetes.io/ingress.class: kong
labels:
global: 'true'
config:
fqdn: '$V1_ENDPOINT'
token: '$TREND_API_KEY'
plugin: trend-micro-kong-plugin-aps
" | kubectl apply -f -
Terraform
사전 준비: 개인 액세스 토큰 구성하기
terraform {
required_providers {
konnect = {
source = "kong/konnect"
}
}
}
provider "konnect" {
personal_access_token = "$KONNECT_TOKEN"
server_url = "https://us.api.konghq.com/"
}
Konnect Gateway Plugin을 생성하려면 Terraform 구성에 다음 내용을 추가하세요:
resource "konnect_gateway_plugin_trend_micro_kong_plugin_aps" "my_trend_micro_kong_plugin_aps" {
enabled = true
config = {
fqdn = var.v1_endpoint
token = var.trend_api_key
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
}
이 예제에서는 다음 변수를 매니페스트에 추가해야 해요. TF_VAR_name=value 형식으로 설정하면 런타임에 값을 지정할 수 있어요.
variable "v1_endpoint" {
type = string
}
variable "trend_api_key" {
type = string
}
관련 리소스
더 알아보기 (Learn more)
- 플러그인 다운로드와 설치 방법을 확인할 수 있어요 — TrendAI API Security plugin
- API 키를 Vault에 안전하게 보관하고 관리하는 방법을 설명해요 — Secrets Management
- decK로 플러그인을 설정할 때 사용하는 kong.yaml 작성법을 배울 수 있어요 —
kong.yaml - Konnect API로 플러그인을 설정할 때 참고할 수 있는 API 레퍼런스예요 — Konnect Control Planes Config API reference