Noma Runtime Protection 활성화
Noma Runtime Protection 활성화 (Enable Noma Runtime Protection)
이 문서에서는 Noma Runtime Protection 플러그인을 활성화하는 방법을 설명해요. 모니터 모드를 사용하면 공격을 모니터링하고 로그만 기록할 수 있고, 차단을 원하면 모니터 모드를 비활성화하면 돼요. 플러그인을 설정하기 전에 AI Gateway 설정, Consumer 생성, Consumer Group 생성(선택 사항)이 필요해요. 환경 변수와 decK, Admin API, Konnect API를 통한 설정 방법도 알려드려요.
출처: 문서
본문
Noma Runtime Protectionv3.12+ 활성화
Noma Runtime Protection 플러그인을 활성화해요.
이 예제에서는 모니터 모드가 활성화되어 있어요. 즉, 플러그인이 공격을 모니터링하고 로그만 기록한다는 뜻이에요.
차단을 활성화하려면 monitor_mode를 false로 설정하세요.
이 플러그인은 또한 다음 Kong Gateway 엔티티 구성이 필요해요.
- AI Gateway 설정하기 — Service, Route를 생성하고 AI Proxy 플러그인을 활성화하세요.
- Consumer 및 인증 키 생성하기 — API를 호출하는 애플리케이션/클라이언트를 식별해요.
- Consumer 그룹화하기 (선택 사항): 공유 런타임 정책을 설정하려면 Consumer를 Consumer Group으로 그룹화하세요.
사전 요구 사항
-
(선택 사항) Noma에서 애플리케이션을 생성하고 해당 애플리케이션 ID를 복사했어요. 애플리케이션 ID를 지정하지 않으면 자동으로 Kong Gateway Consumer 이름을 사용해요.
-
Noma Runtime Protection 플러그인이 설치되어 있어요.
환경 변수
-
https://api.noma.security: Noma API의 기본 URL이에요. 기본값은https://api.noma.security예요. -
NOMA_APPLICATION_ID: Noma 애플리케이션 ID예요. -
NOMA_CLIENT_ID: Noma 클라이언트 ID예요. 이 값을 받으려면 Noma 기술 계정 관리자에게 문의하세요. -
NOMA_CLIENT_SECRET: Noma 클라이언트 시크릿이에요. 이 값을 받으려면 Noma 기술 계정 관리자에게 문의하세요.
플러그인 설정하기
Global
decK
이 섹션을 kong.yaml 구성 파일에 추가하세요:
_format_version: "3.0"
plugins:
- name: noma-runtime-protection
config:
API_base: https://api.noma.security
monitor_mode: true
application_id: ${{ env "DECK_NOMA_APPLICATION_ID" }}
client_id: ${{ env "DECK_NOMA_CLIENT_ID" }}
client_secret: ${{ env "DECK_NOMA_CLIENT_SECRET" }}
{: 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": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
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": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요:
-
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:
API_base: https://api.noma.security
monitor_mode: true
application_id: '$NOMA_APPLICATION_ID'
client_id: '$NOMA_CLIENT_ID'
client_secret: '$NOMA_CLIENT_SECRET'
plugin: noma-runtime-protection
" | 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_noma_runtime_protection" "my_noma_runtime_protection" {
enabled = true
config = {
API_base = "https://api.noma.security"
monitor_mode = true
application_id = var.noma_application_id
client_id = var.noma_client_id
client_secret = var.noma_client_secret
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
}
이 예제에서는 매니페스트에 다음 변수를 추가해야 해요. 런타임에 TF_VAR_name=value를 설정하여 값을 지정할 수 있어요.
variable "https://api.noma.security" {
type = string
}
variable "noma_application_id" {
type = string
}
variable "noma_client_id" {
type = string
}
variable "noma_client_secret" {
type = string
}
Service
decK
이 섹션을 kong.yaml 구성 파일에 추가하세요:
_format_version: "3.0"
plugins:
- name: noma-runtime-protection
service: serviceName|Id
config:
API_base: https://api.noma.security
monitor_mode: true
application_id: ${{ env "DECK_NOMA_APPLICATION_ID" }}
client_id: ${{ env "DECK_NOMA_CLIENT_ID" }}
client_secret: ${{ env "DECK_NOMA_CLIENT_SECRET" }}
{: data-file="kong.yaml" data-tool="deck" }
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요:
serviceName|Id: 플러그인 구성이 대상으로 하는 서비스의id또는name이에요.
Admin API
다음 요청을 보내세요:
curl -i -X POST http://localhost:8001/services/{serviceName|Id}/plugins/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요:
serviceName|Id: 플러그인 구성이 대상으로 하는 서비스의id또는name이에요.
Konnect API
다음 요청을 보내세요:
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/services/{serviceId}/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요:
-
region: Kong Konnect가 호스팅되고 운영되는 지리적 리전이에요. -
KONNECT_TOKEN: Konnect 계정과 연결된 개인 액세스 토큰(PAT)이에요. -
controlPlaneId: 컨트롤 플레인의id예요. -
serviceId: 플러그인 구성이 대상으로 하는 서비스의id예요.
리전별 URL 및 개인 액세스 토큰에 대한 자세한 내용은 Konnect Control Planes Config API 참조를 확인하세요.
KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name:
namespace: kong
annotations:
kubernetes.io/ingress.class: kong
config:
API_base: https://api.noma.security
monitor_mode: true
application_id: '$NOMA_APPLICATION_ID'
client_id: '$NOMA_CLIENT_ID'
client_secret: '$NOMA_CLIENT_SECRET'
plugin: noma-runtime-protection
" | kubectl apply -f -
다음으로, service 리소스에 주석을 추가하여 KongPlugin 리소스를 적용하세요:
kubectl annotate -n kong service SERVICE_NAME konghq.com/plugins=
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_noma_runtime_protection" "my_noma_runtime_protection" {
enabled = true
config = {
API_base = "https://api.noma.security"
monitor_mode = true
application_id = var.noma_application_id
client_id = var.noma_client_id
client_secret = var.noma_client_secret
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
service = {
id = konnect_gateway_service.my_service.id
}
}
이 예제에서는 매니페스트에 다음 변수를 추가해야 해요. 런타임에 TF_VAR_name=value를 설정하여 값을 지정할 수 있어요.
variable "https://api.noma.security" {
type = string
}
variable "noma_application_id" {
type = string
}
variable "noma_client_id" {
type = string
}
variable "noma_client_secret" {
type = string
}
Route
decK
이 섹션을 kong.yaml 구성 파일에 추가하세요:
_format_version: "3.0"
plugins:
- name: noma-runtime-protection
route: routeName|Id
config:
API_base: https://api.noma.security
monitor_mode: true
application_id: ${{ env "DECK_NOMA_APPLICATION_ID" }}
client_id: ${{ env "DECK_NOMA_CLIENT_ID" }}
client_secret: ${{ env "DECK_NOMA_CLIENT_SECRET" }}
{: data-file="kong.yaml" data-tool="deck" }
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요:
routeName|Id: 플러그인 구성이 대상으로 하는 라우트의id또는name이에요.
Admin API
다음 요청을 보내세요:
curl -i -X POST http://localhost:8001/routes/{routeName|Id}/plugins/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요:
routeName|Id: 플러그인 구성이 대상으로 하는 라우트의id또는name이에요.
Konnect API
다음 요청을 보내세요:
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/routes/{routeId}/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요:
-
region: Kong Konnect가 호스팅되고 운영되는 지리적 리전이에요. -
KONNECT_TOKEN: Konnect 계정과 연결된 개인 액세스 토큰(PAT)이에요. -
controlPlaneId: 컨트롤 플레인의id예요. -
routeId: 플러그인 구성이 대상으로 하는 라우트의id예요.
리전별 URL 및 개인 액세스 토큰에 대한 자세한 내용은 Konnect Control Planes Config API 참조를 확인하세요.
KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name:
namespace: kong
annotations:
kubernetes.io/ingress.class: kong
config:
API_base: https://api.noma.security
monitor_mode: true
application_id: '$NOMA_APPLICATION_ID'
client_id: '$NOMA_CLIENT_ID'
client_secret: '$NOMA_CLIENT_SECRET'
plugin: noma-runtime-protection
" | kubectl apply -f -
다음으로, httproute 또는 ingress 리소스에 주석을 추가하여 KongPlugin 리소스를 적용하세요:
Gateway API
kubectl annotate -n kong httproute konghq.com/plugins=
Ingress
kubectl annotate -n kong ingress konghq.com/plugins=
Terraform
사전 요구 사항: Personal Access Token을 설정하세요
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_noma_runtime_protection" "my_noma_runtime_protection" {
enabled = true
config = {
API_base = "https://api.noma.security"
monitor_mode = true
application_id = var.noma_application_id
client_id = var.noma_client_id
client_secret = var.noma_client_secret
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
route = {
id = konnect_gateway_route.my_route.id
}
}
이 예제에서는 매니페스트에 다음 변수를 추가해야 해요. 런타임에 TF_VAR_name=value를 설정하여 값을 지정할 수 있어요.
variable "https://api.noma.security" {
type = string
}
variable "noma_application_id" {
type = string
}
variable "noma_client_id" {
type = string
}
variable "noma_client_secret" {
type = string
}
소비자
decK
이 섹션을 kong.yaml 구성 파일에 추가하세요.
_format_version: "3.0"
plugins:
- name: noma-runtime-protection
consumer: consumerName|Id
config:
API_base: https://api.noma.security
monitor_mode: true
application_id: ${{ env "DECK_NOMA_APPLICATION_ID" }}
client_id: ${{ env "DECK_NOMA_CLIENT_ID" }}
client_secret: ${{ env "DECK_NOMA_CLIENT_SECRET" }}
{: data-file="kong.yaml" data-tool="deck" }
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요.
consumerName|Id: 플러그인 구성이 대상으로 하는 소비자의id또는name이에요.
Admin API
다음 요청을 보내세요.
curl -i -X POST http://localhost:8001/consumers/{consumerName|Id}/plugins/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요.
consumerName|Id: 플러그인 구성이 대상으로 하는 소비자의id또는name이에요.
Konnect API
다음 요청을 보내세요.
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/consumers/{consumerId}/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요.
region: Kong Konnect가 호스팅되고 운영되는 지리적 지역이에요.KONNECT_TOKEN: Konnect 계정과 연결된 Personal Access Token(PAT)이에요.controlPlaneId: 컨트롤 플레인의id예요.consumerId: 플러그인 구성이 대상으로 하는 소비자의id예요.
지역별 URL과 Personal Access Token에 대한 자세한 내용은 Konnect Control Planes Config API 참조를 확인하세요.
KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name:
namespace: kong
annotations:
kubernetes.io/ingress.class: kong
config:
API_base: https://api.noma.security
monitor_mode: true
application_id: '$NOMA_APPLICATION_ID'
client_id: '$NOMA_CLIENT_ID'
client_secret: '$NOMA_CLIENT_SECRET'
plugin: noma-runtime-protection
" | kubectl apply -f -
다음으로, KongConsumer 리소스에 주석을 추가하여 KongPlugin 리소스를 적용하세요.
kubectl annotate -n kong kongconsumer CONSUMER_NAME konghq.com/plugins=
Terraform
사전 요구 사항: Personal Access Token을 설정하세요
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_noma_runtime_protection" "my_noma_runtime_protection" {
enabled = true
config = {
API_base = "https://api.noma.security"
monitor_mode = true
application_id = var.noma_application_id
client_id = var.noma_client_id
client_secret = var.noma_client_secret
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
consumer = {
id = konnect_gateway_consumer.my_consumer.id
}
}
이 예제에서는 매니페스트에 다음 변수를 추가해야 해요. 런타임에 TF_VAR_name=value를 설정하여 값을 지정할 수 있어요.
variable "https://api.noma.security" {
type = string
}
variable "noma_application_id" {
type = string
}
variable "noma_client_id" {
type = string
}
variable "noma_client_secret" {
type = string
}
소비자 그룹
decK
이 섹션을 kong.yaml 구성 파일에 추가하세요.
_format_version: "3.0"
plugins:
- name: noma-runtime-protection
consumer_group: consumerGroupName|Id
config:
API_base: https://api.noma.security
monitor_mode: true
application_id: ${{ env "DECK_NOMA_APPLICATION_ID" }}
client_id: ${{ env "DECK_NOMA_CLIENT_ID" }}
client_secret: ${{ env "DECK_NOMA_CLIENT_SECRET" }}
{: data-file="kong.yaml" data-tool="deck" }
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요.
consumerGroupName|Id: 플러그인 구성이 대상으로 하는 소비자 그룹의id또는name이에요.
Admin API
다음 요청을 보내세요.
curl -i -X POST http://localhost:8001/consumer_groups/{consumerGroupName|Id}/plugins/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요.
consumerGroupName|Id: 플러그인 구성이 대상으로 하는 소비자 그룹의id또는name이에요.
Konnect API
다음 요청을 보내세요.
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{consumerGroupId}/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "noma-runtime-protection",
"config": {
"API_base": "https://api.noma.security",
"monitor_mode": true,
"application_id": "'$NOMA_APPLICATION_ID'",
"client_id": "'$NOMA_CLIENT_ID'",
"client_secret": "'$NOMA_CLIENT_SECRET'"
}
}
'
다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요.
region: Kong Konnect가 호스팅되고 운영되는 지리적 지역이에요.KONNECT_TOKEN: Konnect 계정과 연결된 Personal Access Token(PAT)이에요.controlPlaneId: 컨트롤 플레인의id예요.consumerGroupId: 플러그인 구성이 대상으로 하는 소비자 그룹의id예요.
지역별 URL과 Personal Access Token에 대한 자세한 내용은 Konnect Control Planes Config API 참조를 확인하세요.
KIC
echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name:
namespace: kong
annotations:
kubernetes.io/ingress.class: kong
config:
API_base: https://api.noma.security
monitor_mode: true
application_id: '$NOMA_APPLICATION_ID'
client_id: '$NOMA_CLIENT_ID'
client_secret: '$NOMA_CLIENT_SECRET'
plugin: noma-runtime-protection
" | kubectl apply -f -
다음으로, KongConsumerGroup 리소스에 주석을 추가하여 KongPlugin 리소스를 적용하세요.
kubectl annotate -n kong kongconsumergroup CONSUMERGROUP_NAME konghq.com/plugins=
Terraform
사전 요구 사항: Personal Access Token을 설정하세요
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_noma_runtime_protection" "my_noma_runtime_protection" {
enabled = true
config = {
API_base = "https://api.noma.security"
monitor_mode = true
application_id = var.noma_application_id
client_id = var.noma_client_id
client_secret = var.noma_client_secret
}
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
consumer_group = {
id = konnect_gateway_consumer_group.my_consumer_group.id
}
}
이 예제에서는 매니페스트에 다음 변수를 추가해야 해요. 런타임에 TF_VAR_name=value를 설정하여 값을 지정할 수 있어요.
variable "https://api.noma.security" {
type = string
}
variable "noma_application_id" {
type = string
}
variable "noma_client_id" {
type = string
}
variable "noma_client_secret" {
type = string
}
더 알아보기 (Learn more)
- AI Gateway를 설정하는 방법을 알아보세요. — Set up AI Gateway
- Consumer와 인증 키를 생성하는 방법을 알아보세요. — Create a Consumer and an auth key
- Consumer Group을 생성하여 공유 런타임 정책을 설정하는 방법을 알아보세요. — Group Consumers
- Noma Runtime Protection 플러그인을 설치하는 방법을 알아보세요. — installed
- decK를 사용한 설정 방법을 알아보세요. —
kong.yaml - Konnect Control Planes Config API 참조를 확인하세요. — Konnect Control Planes Config API reference