-
Notifications
You must be signed in to change notification settings - Fork 71
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
Rule deletion #128
base: main
Are you sure you want to change the base?
Rule deletion #128
Conversation
5d08e23
to
feed65b
Compare
deleteAll uint8 | ||
fileWatchFlags uint8 | ||
addFileWatch uint8 | ||
deleteFileWatch uint8 | ||
syscallFlags uint8 | ||
addSyscall uint8 | ||
deleteSyscall uint8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like this should be a bitset at this point. Maybe later.
8aac899
to
64b0760
Compare
Although the implementation for AuditClient.Delete is only used to back AuditClient.DeleteAll, we'd like to be able to delete individual rules. This commit adds checking of the netlink error field and reports when the deletion has failed. When DeleteAll is called, we ignore the ENOENT return since it could've raced somewhere and we don't actually care since we're deleting all of the rules.
Rule.Build assumes that if no syscalls are specified they all are set. This is really only the case when the exit list is used since the syscall numbers aren't available in the other lists. When we assume that all of the syscalls are enabled, we end up generating wireformat rules for e.g. 'task,never' that have all of the syscall bits set. That doesn't match what is already used when 'auditctl -a task,never' is used. It may be ignored by the kernel when such a rule is added, but it would cause problems when that rule is deleted.
64b0760
to
9b6cd62
Compare
Thanks for the review. I've implemented your suggestions and have rebased on the current HEAD. It should be good to go. |
9b6cd62
to
57b0496
Compare
We currently don't handle the '-d' or '-W' options that would remove list rules or file watches. This commit adds support to handle those properly. rule.ToCommandLine still returns the expected result, but I've added a rule.ToCommandLineAddRemove that takes a bool indicating whether the rule would be added or removed. This was required to do testing of deletion rules.
57b0496
to
b0c2227
Compare
@andrewkroh This doesn't appear to be triggering the buildkite build. How do we bump it? |
/test |
/test |
💔 Build Failed
Failed CI StepsHistory |
This PR adds the ability to delete rules from the running system.