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

Allow exe exclude rules #97

Merged
merged 6 commits into from
Feb 5, 2022

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Jan 25, 2022

Not all kernels will support this, but Auditbeat will allow trying to set them.
I bumped the OS provided by Vagrant to test with auditd 3.0 which allows
setting the exe filter.

While comparing the binary rule representation generated by go-libaudit and
the binary rule from the kernel listing there was a 2 byte difference in the
syscall mask. I modified go-libaudit to match the kernel output. IIUC these values
shouldn't matter because they are outside the range of any existing syscall
numbers.

This was the diff I observed and accounted for.

  Diff:
  --- Expected
  +++ Actual
  @@ -17,3 +17,3 @@
    000000f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
  - 00000100  ff ff ff ff ff ff ff ff  ff ff 00 00 67 00 00 00  |............g...|
  + 00000100  ff ff ff ff ff ff ff ff  ff ff ff ff 67 00 00 00  |............g...|
    00000110  d2 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Not all kernels will support this, but Auditbeat will allow trying to set them.
I bumped the OS provided by Vagrant to test with auditd 3.0 which allows
setting the exe filter.

While comparing the binary rule representation generated by go-libaudit and
the binary rule from the kernel listing there was a 2 byte difference in the
syscall mask. I modified go-libaudit to match the kernel output. IIUC these values
shouldn't matter because they are outside the range of any existing syscall
numbers.

This was the diff I observed and accounted for.

  Diff:
  --- Expected
  +++ Actual
  @@ -17,3 +17,3 @@
    000000f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
  - 00000100  ff ff ff ff ff ff ff ff  ff ff 00 00 67 00 00 00  |............g...|
  + 00000100  ff ff ff ff ff ff ff ff  ff ff ff ff 67 00 00 00  |............g...|
    00000110  d2 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Fixes elastic#78
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 25, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-02-04T16:45:54.412+0000

  • Duration: 5 min 57 sec

Test stats 🧪

Test Results
Failed 0
Passed 378
Skipped 40
Total 418

@andrewkroh andrewkroh added the Team:Security-External Integrations Label for the Security External Integrations team label Jan 25, 2022
@andrewkroh andrewkroh requested a review from a team January 27, 2022 13:27
rule/rule.go Outdated Show resolved Hide resolved
rule/rule.go Show resolved Hide resolved
rule/testdata/20-dont-audit.rules Outdated Show resolved Hide resolved
rule/rule.go Outdated Show resolved Hide resolved
@andrewkroh andrewkroh changed the title Allow file/dir/exe exclude rules Allow exe exclude rules Feb 4, 2022
@andrewkroh andrewkroh requested a review from efd6 February 4, 2022 17:04
@andrewkroh andrewkroh merged commit 7c19a0e into elastic:main Feb 5, 2022
renini pushed a commit to renini/go-libaudit that referenced this pull request Jun 26, 2024
Not all kernels will support this, but Auditbeat will allow trying to set them.
I bumped the OS provided by Vagrant to test with auditd 3.0 which allows
setting the exe filter.

While comparing the binary rule representation generated by go-libaudit and
the binary rule from the kernel listing there was a 2 byte difference in the
syscall mask. I modified go-libaudit to match the kernel output. IIUC these values
shouldn't matter because they are outside the range of any existing syscall
numbers.

This was the diff I observed and accounted for.

  Diff:
  --- Expected
  +++ Actual
  @@ -17,3 +17,3 @@
    000000f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
  - 00000100  ff ff ff ff ff ff ff ff  ff ff 00 00 67 00 00 00  |............g...|
  + 00000100  ff ff ff ff ff ff ff ff  ff ff ff ff 67 00 00 00  |............g...|
    00000110  d2 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Team:Security-External Integrations Label for the Security External Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants