감사 데이터 제외 문법
감사 데이터 제외 문법
Enterprise
적절한 Vault Enterprise 라이선스가 필요합니다.
Vault 1.18.0부터 exclude 옵션으로 감사 디바이스를 활성화해 특정 감사 로그에 기록되는 감사 항목의 특정 필드를 제외하고 감사 과정을 세밀하게 조정할 수 있습니다.
주의하여 진행하세요 — 감사 항목 필드 제외는 고급 기능입니다. 제외 설정을 사용하면 감사 로그에 데이터가 누락될 수 있습니다.
제외를 프로덕션에 배포하기 전에 항상 비프로덕션 환경에서 감사 구성을 테스트하세요. 제외를 사용하는 감사 디바이스를 활성화하기 전에 Vault 보안 모델과 필터링 개요를 읽어 Vault 감사와 필터링 기본을 익히세요.
제외가 있는 감사 디바이스를 활성화하면, Vault가 그 감사 디바이스로 보내는 모든 감사 항목이 조건식 형태의 (선택적) 조건과 비교됩니다. Vault는 디바이스의 감사 로그에 기록하기 전에 제외를 확인합니다. Vault는 제외 표현식과 일치하는 감사 항목을 수정해 해당 조건에 대해 지정된 필드를 제거합니다. 개별 감사 디바이스에 대해 조건과 필드 조합의 여러 세트를 지정할 수 있습니다.
제외를 사용하는 감사 디바이스를 활성화해도 기존 감사 디바이스의 동작과 제외를 사용하지 않는 새 감사 디바이스의 동작은 변경되지 않습니다.
exclude 옵션
exclude 옵션에 제공되는 값은 제외 객체의 파싱 가능한 JSON 배열(즉, JSON 또는 이스케이프된 JSON 문자열)이어야 합니다.
제외 객체(Exclusion object)
condition(string: <optional>)— 필터링 문법을 사용한 조건식입니다. 일치하면 Vault는fields가 식별한 값을 제거합니다.fields(string[] <required>)— 제외할 감사 항목의 필드 모음으로, JSON 포인터 문법으로 식별합니다.
[
{
"condition": "",
"fields": [ "" ]
}
]
Vault는 항상 제외 조건을 원본의 불변인 감사 항목('골든 소스')과 비교합니다. 결과적으로 주어진 조건을 평가한다고 해서 후속 조건의 평가에 영향을 주지 않습니다.
제외 예시
응답 데이터 제외하기 (존재할 때)
응답 data 필드를 포함하는 모든 감사 항목에서 그 필드를 제외합니다.
[
{
"fields": [ "/response/data" ]
}
]
transit 마운트의 요청 데이터 제외하기 (존재할 때)
마운트 유형이 transit인 감사 항목의 요청 data 필드를 제외합니다.
[
{
"condition": "\"/request/mount_type\" == transit",
"fields": [ "/request/data" ]
}
]
여러 제외
여러 JSON 객체를 사용해 다음을 제외합니다.
[
{
"condition": "\"/request/mount_type\" == transit",
"fields": [ "/request/data", "/response/data" ]
},
{
"condition": "\"/auth/client_token\" matches \"hmac.+\"",
"fields": [ "/auth/entity_id" ]
}
]
감사 항목 구조
condition과 fields를 정확히 구성하려면 Vault 운영자는 자신의 감사 항목 구조를 확실히 이해해야 합니다. 높은 수준에서 보면 요청(request) 감사 항목과 응답(response) 감사 항목 단 두 가지뿐이지만, 각 항목은 auth, request, response 같은 서로 다른 객체를 포함할 수 있습니다.
적절한 제외 조건과 필드를 더 잘 식별하기 위해 운영자는 최소 2~4주 기간의 기존 감사 로그를 검토할 것을 강력히 권장합니다.
요청 감사 항목
{
"auth": <auth>,
"error": "",
"forwarded_from": "",
"request": <request>,
"time": "",
"type": ""
}
응답 감사 항목
{
"auth": <auth>,
"error": "",
"forwarded_from": "",
"request": <request>,
"response": <response>,
"time": "",
"type": ""
}
Auth 객체 (<auth>)
다음 auth 객체 정의는 단순 유형(string, bool, int)의 예시 데이터를 포함하며, <auth> 객체가 포함된 다른 JSON 예시에서 사용됩니다.
{
"accessor": "",
"client_token": "",
"display_name": "",
"entity_created": "",
"entity_id": "",
"external_namespace_policies": {
"allowed": true,
"granting_policies": [
{
"name": "",
"namespace_id": "",
"namespace_path": "",
"type": ""
}
]
},
"identity_policies": [
""
],
"metadata": {},
"no_default_policy": false,
"num_uses": 10,
"policies": [
""
],
"policy_results": {
"allowed": true,
"granting_policies": [
{
"name": "",
"namespace_id": "",
"namespace_path": "",
"type": ""
}
]
},
"remaining_uses": 5,
"token_policies": [
""
],
"token_issue_time": "",
"token_ttl": 3600,
"token_type": ""
}
Request 객체 (<request>)
다음 request 객체 정의는 단순 유형(string, bool, int)의 예시 데이터를 포함하며, <request> 객체가 포함된 다른 JSON 예시에서 사용됩니다.
{
"client_certificate_serial_number": "",
"client_id": "",
"client_token": "",
"client_token_accessor": "",
"data": {},
"id": "",
"headers": {},
"mount_accessor": "",
"mount_class": "",
"mount_point": "",
"mount_type": "",
"mount_running_version": "",
"mount_running_sha256": "",
"mount_is_external_plugin": "",
"namespace": {
"id": "",
"path": ""
},
"operation": "",
"path": "",
"policy_override": true,
"remote_address": "",
"remote_port": 1234,
"replication_cluster": "",
"request_uri": "",
"wrap_ttl": 60
}
Response 객체 (<response>)
다음 response 객체 정의는 단순 유형(string, bool, int)의 예시 데이터를 포함하며, <response> 객체가 포함된 다른 JSON 예시에서 사용됩니다.
{
"auth": <auth>,
"data": {},
"headers": {},
"mount_accessor": "",
"mount_class": "",
"mount_is_external_plugin": false,
"mount_point": "",
"mount_running_sha256": "",
"mount_running_plugin_version": "",
"mount_type": "",
"redirect": "",
"secret": {
"lease_id": ""
},
"wrap_info": {
"accessor": "",
"creation_path": "",
"creation_time": "",
"token": "",
"ttl": 60,
"wrapped_accessor": ""
},
"warnings": [
""
]
}
요청 감사 항목 스키마
{
"type": "object",
"properties": {
"auth": {
"type": "object",
"properties": {
"accessor": {
"type": "string"
},
"client_token": {
"type": "string"
},
"display_name": {
"type": "string"
},
"entity_created": {
"type": "boolean"
},
"entity_id": {
"type": "string"
},
"external_namespace_policies": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"identity_policies": {
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"no_default_policy": {
"type": "boolean"
},
"num_uses": {
"type": "integer",
"format": "int32"
},
"policies": {
"type": "array",
"items": {
"type": "string"
}
},
"policy_results": {
"type": "object",
"properties": {
"allowed": {
"type": "boolean"
},
"granting_policies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"namespace_id": {
"type": "string"
},
"namespace_path": {
"type": "string"
},
"type": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"type"
]
}
}
},
"additionalProperties": false,
"required": [
"allowed"
]
},
"remaining_uses": {
"type": "integer",
"format": "int32"
},
"token_issue_time": {
"type": "string"
},
"token_policies": {
"type": "array",
"items": {
"type": "string"
}
},
"token_ttl": {
"type": "integer",
"format": "int64"
},
"token_type": {
"type": "string"
}
},
"additionalProperties": false
},
"error": {
"type": "string"
},
"forwarded_from": {
"type": "string"
},
"request": {
"type": "object",
"properties": {
"client_certificate_serial_number": {
"type": "string"
},
"client_id": {
"type": "string"
},
"client_token": {
"type": "string"
},
"client_token_accessor": {
"type": "string"
},
"data": {
"type": "object",
"additionalProperties": {}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"id": {
"type": "string"
},
"mount_accessor": {
"type": "string"
},
"mount_class": {
"type": "string"
},
"mount_is_external_plugin": {
"type": "boolean"
},
"mount_point": {
"type": "string"
},
"mount_running_sha256": {
"type": "string"
},
"mount_running_version": {
"type": "string"
},
"mount_type": {
"type": "string"
},
"namespace": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"path": {
"type": "string"
}
},
"additionalProperties": false
},
"operation": {
"type": "string"
},
"path": {
"type": "string"
},
"policy_override": {
"type": "boolean"
},
"remote_address": {
"type": "string"
},
"remote_port": {
"type": "integer",
"format": "int32"
},
"replication_cluster": {
"type": "string"
},
"request_uri": {
"type": "string"
},
"wrap_ttl": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
},
"time": {
"type": "string"
},
"type": {
"type": "string"
}
},
"additionalProperties": false
}
응답 감사 항목 스키마
{
"type": "object",
"properties": {
"auth": {
"type": "object",
"properties": {
"accessor": {
"type": "string"
},
"client_token": {
"type": "string"
},
"display_name": {
"type": "string"
},
"entity_created": {
"type": "boolean"
},
"entity_id": {
"type": "string"
},
"external_namespace_policies": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"identity_policies": {
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"no_default_policy": {
"type": "boolean"
},
"num_uses": {
"type": "integer",
"format": "int32"
},
"policies": {
"type": "array",
"items": {
"type": "string"
}
},
"policy_results": {
"type": "object",
"properties": {
"allowed": {
"type": "boolean"
},
"granting_policies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"namespace_id": {
"type": "string"
},
"namespace_path": {
"type": "string"
},
"type": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"type"
]
}
}
},
"additionalProperties": false,
"required": [
"allowed"
]
},
"remaining_uses": {
"type": "integer",
"format": "int32"
},
"token_issue_time": {
"type": "string"
},
"token_policies": {
"type": "array",
"items": {
"type": "string"
}
},
"token_ttl": {
"type": "integer",
"format": "int64"
},
"token_type": {
"type": "string"
}
},
"additionalProperties": false
},
"error": {
"type": "string"
},
"forwarded_from": {
"type": "string"
},
"request": {
"type": "object",
"properties": {
"client_certificate_serial_number": {
"type": "string"
},
"client_id": {
"type": "string"
},
"client_token": {
"type": "string"
},
"client_token_accessor": {
"type": "string"
},
"data": {
"type": "object",
"additionalProperties": {}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"id": {
"type": "string"
},
"mount_accessor": {
"type": "string"
},
"mount_class": {
"type": "string"
},
"mount_is_external_plugin": {
"type": "boolean"
},
"mount_point": {
"type": "string"
},
"mount_running_sha256": {
"type": "string"
},
"mount_running_version": {
"type": "string"
},
"mount_type": {
"type": "string"
},
"namespace": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"path": {
"type": "string"
}
},
"additionalProperties": false
},
"operation": {
"type": "string"
},
"path": {
"type": "string"
},
"policy_override": {
"type": "boolean"
},
"remote_address": {
"type": "string"
},
"remote_port": {
"type": "integer",
"format": "int32"
},
"replication_cluster": {
"type": "string"
},
"request_uri": {
"type": "string"
},
"wrap_ttl": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
},
"time": {
"type": "string"
},
"type": {
"type": "string"
}
},
"additionalProperties": false
}
출처: 문서