[CWS-5004] Add overlayfs path operator override #40392
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add a new operator override that looks at whether a file is access through an overlay mount point when evaluating rules.
To do so this PR allows setting multiple operator overrides on the same field by chaining each operator using a logic OR.
One notable drawback of this solution is that some fields (e.g.
exec.file.path
) might end up being evaluated multiple times against the exact same value if none of the overrides apply to the event (no symlink, no overlayfs).Motivation
The goal is to trigger rules such as
open.file.path == "/tmp/foo"
when the/tmp/foo
container file is access through an overlay mount point (e.g.touch /var/lib/docker/overlay2/0123456789abcdef/merged/tmp/foo
).Describe how you validated your changes
Additional Notes