Skip to content

Commit

Permalink
Added global rules to mask sensitive information using promtail (#48)
Browse files Browse the repository at this point in the history
Added global rules to mask sensitive information such as ssn, creditcard number, email, ip, mobile number using promtail
  • Loading branch information
kaushall authored Jan 27, 2025
1 parent c53d41b commit 9271aa0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/nopo11y-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ dependencies:
description: A Helm chart for observability stack
name: nopo11y-stack
type: application
version: 2.2.0
version: 2.2.1
20 changes: 20 additions & 0 deletions charts/nopo11y-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15786,6 +15786,26 @@ promtail:
snippets:
pipelineStages:
- cri: {}
- replace:
# SSN
expression: '([0-9]{3}-[0-9]{2}-[0-9]{4})'
replace: '*SSN*{{ .Value | Hash "salt" }}*'
- replace:
# IP4
expression: '(\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3})'
replace: '*IP4*{{ .Value | Hash "salt" }}*'
- replace:
# email
expression: '([\w\.=-]+@[\w\.-]+\.[\w]{2,64})'
replace: '*email*{{ .Value | Hash "salt" }}*'
- replace:
# creditcard
expression: '((?:\d[ -]*?){13,16})'
replace: '*creditcard*{{ .Value | Hash "salt" }}*'
- replace:
# mobile number
expression: '(\+?\d{1,3}[-.\s]??\d{5}[-.\s]?\d{5})'
replace: '*mobile*{{ .Value | Hash "salt" }}*'
common:
- action: replace
source_labels:
Expand Down

0 comments on commit 9271aa0

Please sign in to comment.