Add regexes to filter out PII

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
This commit is contained in:
Michel Hollands 2023-07-07 14:04:56 +01:00 committed by Michel Hollands
parent a1cd5d36b0
commit fa2b01708c
3 changed files with 26 additions and 1 deletions

View File

@ -17,6 +17,14 @@
{{- join ", " $list }}
{{- end }}
{{- define "agent.loki_process_targets" -}}
{{- if empty .Values.logs.piiregexes }}
{{- include "agent.loki_write_targets" . }}
{{- else }}
{{- printf "loki.process.PII.receiver" }}
{{- end }}
{{- end }}
{{- define "agent.prometheus_write_targets" -}}
{{- $list := list }}
{{- if .Values.local.metrics.enabled }}

View File

@ -40,8 +40,22 @@ data:
{{- if or .Values.local.logs.enabled .Values.cloud.logs.enabled }}
loki.source.kubernetes "pods" {
targets = discovery.relabel.rename_meta_labels.output
forward_to = [ {{ include "agent.loki_write_targets" . }} ]
forward_to = [ {{ include "agent.loki_process_targets" . }} ]
}
{{- if not (empty .Values.logs.piiregexes) }}
loki.process "PII" {
forward_to = [ {{ include "agent.loki_write_targets" . }} ]
{{- range .Values.logs.piiregexes }}
stage.replace {
expression = "{{ . }}"
replace = "*****"
}
{{- end }}
}
{{- end }}
{{- end }}
{{- if or .Values.local.metrics.enabled .Values.cloud.metrics.enabled }}

View File

@ -32,6 +32,9 @@ cloud:
username:
password:
logs:
PIIregexes:
global:
minio:
rootUser: "rootuser"