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

fix(file-system-monitor): De-duplicate FileOpen alerts for containers #239

Closed
wants to merge 1 commit into from

Conversation

vadorovsky
Copy link
Member

When reading files inside container, the file_open LSM hook gets triggered twice. Before this change, it resulted in threat alerts being issued twice in case the opened file matched a rule.

The only difference which can be spotted between struct file instances in both calls of file_open is an additional bit in file->f_flags during the second call.

When calling cat /etc/shadow inside container, the f_flags are respectively:

  • 131072 (0x1000000000000000000)
  • 393216 (0x1100000000000000000)

When reading files inside container, the `file_open` LSM hook gets
triggered twice. Before this change, it resulted in threat alerts
being issued twice in case the opened file matched a rule.

The only difference which can be spotted between `struct file`
instances in both calls of `file_open` is an additional bit in
`file->f_flags` during the second call.

When calling `cat /etc/shadow` inside container, the `f_flags` are
respectively:

* `131072` (`0x1000000000000000000`)
* `393216` (`0x1100000000000000000`)
@banditopazzo
Copy link
Member

closed as it seems the normal behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants