-
Notifications
You must be signed in to change notification settings - Fork 681
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
rework auditd_rules resource #312
Comments
Currently, the resource just exposes the lines it reads. The user experience would be way better if this supported something handier. I'd also propose renaming the resource to describe audit.syscall('openat') do
its('action') { should eq('always') }
its('list') { should eq('exit') }
end
describe audit.file('/etc/passwd') do
its('action') { should eq('always') }
its('perms') { should match('.*w.*') }
end |
Since there can be multiple rules relating to one syscall (or one file), I wonder what a good strategy for writing tests would be. For example, two rules for
Now e.g. [
{ action: 'always', list: 'exit', fields: { arch: 'b64', success: 0 } },
{ action: 'always', list: 'exit', fields: { arch: 'b64', auid: 1001 } }
] but then we cannot use RSpec's default At the same time, we cannot use something like @chris-rock @arlimus: What's your take on this? |
I fully agree with your assessment of multiple rules, especially the part about the include matcher and similar ones. We should find a better way to expose those. I also think it's conceptually similar to other areas that have multiple very similar looking lines (e.g. iptables to a limited degree). Let's consider use-cases:
(^^ first thoughts, naming prone to change; but the idea is to further specify the resource for what we are interested in ) Naming: Imho audit can quickly be confused with other mechanisms, while auditd is very specific. Let's tackle that separately. |
A typical use-case will have multiple rules listed. If we can find a better matcher than checking for a regex and also making giving the user nice output if the rule isn't found in the list. Let's find real-life LIST_RULES examples and use them for our docs. The current format may lead to confusion.
The text was updated successfully, but these errors were encountered: