Nightfall (나이트폴)
Nightfall 필터는 로그에서 민감한 데이터를 스캔하고, 민감한 부분을 가려서(redact) 줘요. 이 필터는 API 키와 개인 식별 정보(PII)부터 사용자가 정의한 커스텀 정규식까지 다양한 민감 정보를 스캔하는 것을 지원해요.
출처: 문서
본문
지원 이벤트 유형:
logs
Nightfall 필터는 로그에서 민감한 데이터를 스캔하고 민감한 부분을 가려줘요. 이 필터는 API 키와 개인 식별 정보(PII)부터 사용자가 정의한 커스텀 정규식까지 다양한 민감 정보를 스캔하는 것을 지원해요. 무엇을 스캔할지는 Nightfall 대시보드에서 설정할 수 있어요.
이 필터는 1.9.0 버전에서 오타(typo) 때문에 기본으로 활성화되지 않아요. 활성화하려면 빌드할 때 -DFLB_FILTER_NIGHTFALL=ON 플래그를 설정하세요. 이 문제는 1.9.1 이후 버전에서 고쳐졌어요.
Configuration parameters (설정 매개변수)
이 플러그인은 다음 설정 매개변수를 지원해요:
| Key | Description | Default |
|---|---|---|
nightfall_api_key |
The Nightfall API key to scan your logs with, obtainable from the Nightfall Dashboard | none |
policy_id |
The Nightfall developer platform policy to scan your logs with, configurable in the Nightfall Dashboard. | none |
sampling_rate |
The rate controlling how much of your logs you wish to be scanned. Must be a float between (0,1]. 1 means all logs will be scanned. Use this setting to avoid rate limits in conjunction with Fluent Bit match rules. |
1 |
tls.ca_path |
Absolute path to root certificates, required if tls.verify is true. |
none |
tls.debug |
Debug level between 0 (nothing) and 4 (every detail). |
0 |
tls.verify |
When enabled, turns on certificate validation when connecting to the Nightfall API. | true |
tls.vhost |
Set an optional TLS virtual host for the Nightfall API connection. | none |
Configuration file (설정 파일)
다음은 Nightfall 필터 설정 파일의 예시예요:
{% tabs %} {% tab title="fluent-bit.yaml" %}
pipeline:
inputs:
- name: http
host: 0.0.0.0
port: 8000
filters:
- name: nightfall
match: '*'
nightfall_api_key: <API key>
policy_id: 5991946b-1cc8-4c38-9240-72677029a3f7
sampling_rate: 1
tls.ca_path: /etc/ssl/certs
outputs:
- name: stdout
match: '*'
{% endtab %}
{% tab title="fluent-bit.conf" %}
[INPUT]
Name http
Host 0.0.0.0
Port 8000
[FILTER]
Name nightfall
Match *
Nightfall_Api_Key <API key>
Policy_Id 5991946b-1cc8-4c38-9240-72677029a3f7
Sampling_Rate 1
Tls.Ca_Path /etc/ssl/certs
[OUTPUT]
Name stdout
Match *
{% endtab %} {% endtabs %}
Command line (커맨드 라인)
필터를 구성한 뒤에는 다음과 같은 명령을 실행해서 커맨드 라인에서 사용할 수 있어요:
# For YAML configuration.
fluent-bit -c /PATH_TO_CONF_FILE/fluent-bit.yaml
# For classic configuration.
fluent-bit -c /PATH_TO_CONF_FILE/fluent-bit.conf
PATH_TO_CONF_FILE 을 필터 설정 파일이 있는 경로로 바꾸세요.
그러면 다음과 같은 출력이 나와요:
[2022/02/09 19:46:22] [ info] [engine] started (pid=53844)
[2022/02/09 19:46:22] [ info] [storage] version=1.1.5, initializing...
[2022/02/09 19:46:22] [ info] [storage] in-memory
[2022/02/09 19:46:22] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
[2022/02/09 19:46:22] [ info] [cmetrics] version=0.2.2
[2022/02/09 19:46:22] [ info] [input:http:http.0] listening on 0.0.0.0:8000
[2022/02/09 19:46:22] [ info] [sp] stream processor started
[2022/02/09 19:46:30] [ info] [filter:nightfall:nightfall.0] Nightfall request http_do=0, HTTP Status: 200
[0] app.log: [1644464790.280412000, {"A"=>"there is nothing sensitive here", "B"=>[{"A"=>"my credit card number is *******************"}, {"A"=>"*********** is my social security."}], "C"=>false, "D"=>"key ********************"}]
[2022/02/09 19:47:25] [ info] [filter:nightfall:nightfall.0] Nightfall request http_do=0, HTTP Status: 200
[0] app.log: [1644464845.675431000, {"A"=>"a very safe string"}]