Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement redaction filters #2243

Merged
merged 1 commit into from
Mar 28, 2024
Merged

Conversation

willfindlay
Copy link
Contributor

@willfindlay willfindlay commented Mar 20, 2024

Implement a new field filter type, the redaction filter. Redaction filters use regular expressions to suppress sensitive information in string fields in Tetragon events. When a regular expression in a redaction filter matches a string, everything inside of its capture groups is replaced with *****, effectively censoring the output. For example, the regular expression (?:--password|-p)(?:\s+|=)(\S*) will convert the string "--password=foo" into "--password=*****".

In some cases, it is not desirable to apply a redaction filter to all events. For this use case, redaction filters also include an event filter which can be used to select events to redact. This event filter is configured with the same syntax as an export filter. As a more concrete example:

{"match": {"binary_regex": ["^foo$"]}, "redact": ["\W(qux)\W"]}

The above filter would redact any occurrences of the word "qux" in events with the binary name "foo".

Due to the sensitive nature of redaction, these filters are applied as configured in the
agent, regardless of whether an event is exported via gRPC or the JSON exporter. In other
words, redaction filter configuration always happens at the agent config level, not in the
gRPC client CLI.

Introduce redaction filters for censoring sensitive string data in process events.

Fixes: #2241

@willfindlay willfindlay added area/userspace Related to userspace Tetragon logic area/filters labels Mar 20, 2024
@willfindlay willfindlay requested a review from a team as a code owner March 20, 2024 19:57
Copy link

netlify bot commented Mar 20, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit c30f58d
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/660195cb1f168a0008120f81
😎 Deploy Preview https://deploy-preview-2243--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@willfindlay willfindlay added the release-note/major This PR introduces major new functionality label Mar 20, 2024
@willfindlay willfindlay force-pushed the pr/willfindlay/redaction-filters branch from 319340d to 28d0254 Compare March 21, 2024 13:53
@willfindlay willfindlay force-pushed the pr/willfindlay/redaction-filters branch from 05b0c6d to 1721427 Compare March 21, 2024 15:38
@willfindlay willfindlay marked this pull request as draft March 22, 2024 17:28
@willfindlay
Copy link
Contributor Author

marking as draft while I fix an oversight with empty redaction filters

@willfindlay willfindlay force-pushed the pr/willfindlay/redaction-filters branch 5 times, most recently from c7d0e91 to 2df1703 Compare March 25, 2024 19:29
@willfindlay willfindlay marked this pull request as ready for review March 25, 2024 19:32
Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

cmd/tetragon/main.go Outdated Show resolved Hide resolved
install/kubernetes/tetragon/values.yaml Show resolved Hide resolved
@willfindlay willfindlay force-pushed the pr/willfindlay/redaction-filters branch from 2df1703 to 797d729 Compare March 26, 2024 17:36
Implement a new field filter type, the refaction filter. Redaction filters use regular
expressions to suppress sensitive information in string fields in Tetragon events. When
a regular expression in a redcation filter matches a string, everything inside of its
capture groups is replaced with `*****`, effectively censoring the output. For example,
the regular expression `(?:--password|-p)(?:\s+|=)(\S*)` will convert the string
"--password=foo" into "--password=*****".

In some cases, it is not desirable to apply a redaction filter to all events. For this use
case, redaction filters also include an event filter which can be used to select events to
redact. This event filter is configured with the same syntax as an export filter. As
a more concrete example:

    {"match": {"binary_regex": ["^foo$"]}, "redact": ["\W(qux)\W"]}

The above filter would redact any occurrences of the word "qux" in events with the binary
name "foo".

Due to the sensitive nature of redaction, these filters are applied as configured in the
agent, regardless of whether an event is exported via gRPC or the JSON exporter. In other
words, redaction filter configuration always happens at the agent config level, not in the
gRPC client CLI.

Signed-off-by: William Findlay <[email protected]>
@willfindlay willfindlay force-pushed the pr/willfindlay/redaction-filters branch from 797d729 to 5f748fe Compare March 26, 2024 17:49
@willfindlay willfindlay merged commit 69a4743 into main Mar 28, 2024
37 checks passed
@willfindlay willfindlay deleted the pr/willfindlay/redaction-filters branch March 28, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/filters area/userspace Related to userspace Tetragon logic release-note/major This PR introduces major new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filters: Introduce Redaction Field Filter
3 participants