Skip to content

Commit

Permalink
Clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
harelmo-lumigo committed Jun 9, 2024
1 parent ee613eb commit 4fc23a9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ The tracer will automatically scrub values for keys in payload objects such as H
- `x-amz-security-token`
- `Signature`
- `Authorization`
This behavior can be overridden by setting the `LUMIGO_SECRET_MASKING_REGEX` environment variable to a JSON array of regex patterns to match, e.g.: `[".+top.secret.+", ".pazzword.+"]`.
This behavior can be overridden by setting the `LUMIGO_SECRET_MASKING_REGEX` environment variable to a JSON array of regex patterns to match, e.g.: `[".+top.secret.+", ".+pazzword.+"]`.

**Note:** providing a bad regex pattern (e.g., invalid JSON string) will result in an error and fallback to the default patterns.
#### Notes
1. providing a bad regex pattern (e.g., invalid JSON string) will result in an error and fallback to the default patterns.
2. Only values that are strings are redacted - objects, numbers etc. will stay intact even though their keys match the patterns.

#### Escaping special characters
When the patterns contain special characters such as double quotes (`"`) or backslashes (`\`), those should be escaped with a backslash (`\`).
Expand All @@ -155,7 +157,7 @@ For example, the pattern for keys with whitespaces and quotes like `"key\s+space

#### Examples

`LUMIGO_SECRET_MASKING_REGEX` set to `[".+top\\\\s+secret.+", ".+password.+"]` for a payload object like:
`LUMIGO_SECRET_MASKING_REGEX` set to `[".*top\\\\s+secret.*", ".*password.*"]` for a payload object like:
```json
{
"top secret": {
Expand Down

0 comments on commit 4fc23a9

Please sign in to comment.