49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
tests:
|
|
- name: json-and-attributes-masking
|
|
inputs:
|
|
- insert_at: normalize_logs
|
|
type: log
|
|
log_fields:
|
|
message: '{"message":"synthetic healthy","password":"SYNTH_BODY","level":"info"}'
|
|
timestamp: '2026-11-30T10:00:00Z'
|
|
resources:
|
|
service.name: synthetic-svc
|
|
k8s.namespace.name: synthetic-ns
|
|
k8s.pod.name: synthetic-pod
|
|
attributes:
|
|
token: SYNTH_ATTR
|
|
safe: retained
|
|
outputs:
|
|
- extract_from: normalize_logs
|
|
conditions:
|
|
- type: vrl
|
|
source: 'assert_eq!(.namespace, "synthetic-ns")
|
|
|
|
assert_eq!(.service_name, "synthetic-svc")
|
|
|
|
assert_eq!(.severity, "INFO")
|
|
|
|
assert!(!contains(encode_json(.), "SYNTH_"))
|
|
|
|
assert!(contains!(.attributes_json, "retained"))
|
|
|
|
true'
|
|
- name: bearer-and-jwt-masking
|
|
inputs:
|
|
- insert_at: normalize_logs
|
|
type: log
|
|
log_fields:
|
|
message: healthy Bearer SYNTH_BEARER aaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbb.cccccccccccccccccccc
|
|
resources:
|
|
service.name: synthetic-svc
|
|
k8s.namespace.name: synthetic-ns
|
|
outputs:
|
|
- extract_from: normalize_logs
|
|
conditions:
|
|
- type: vrl
|
|
source: 'assert!(!contains(encode_json(.), "SYNTH_BEARER"))
|
|
|
|
assert!(contains!(.message, "healthy"))
|
|
|
|
true'
|