-
Notifications
You must be signed in to change notification settings - Fork 214
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
[RFE] rules.d: please support overlaying and merging rules from /usr, /run, and /etc #111
Comments
I don't know if there is anything to do here. |
@stevegrubb thanks for the quick feedback! If you don't mind I'll quote-reply, as your terse answer makes that easier. Before getting to specific points, I fear I used ambiguous wording so there is possibly a fundamental misalignment to clear. Here "vendor" means "whoever is assembling an OS image according to their specific requirements", which in many cases is a third-party (i.e. neither me nor you). To be explicit, I'm not requesting anybody here to define a set of generically-ok rules.
I'm not expecting auditd upstream developers to define universal defaults (see comment above).
Fair feedback. To my experience, I've had to use runtime-volatile tweaks for systemd services only on few and odd occasions. I trust your assertion that no odd cases exist for auditd, and I'm fine if you prefer to take this point out of this discussion.
Indeed, and appreciated! The first part of this statement however is not as strict as it seems. The current |
The sysctl.d system that you describe is additive. You can add sysctl settings. But there are some people that do not want audit at all. How would you override system defaults to be nothing? Or if the vendor defaults have 4 rules, how do you express to delete just one? Also, the audit system rule ordering matters. Meaning that you need to stick specific rules in front of general rules to get the right match. For example, -a always,exit -F arch=b64 -S openat,open_by_handle_at -F a2&0100 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-create Now what if the vendor loads the second rule in /usr? How could you fix that? Then what if rules almost match but not quite. For example, the first one has 3 syscalls and the last one has 4. How do we know the intent is to override when the match is fuzzy? And if we just insert the rule, then 3 out of 4 times, it will match the first and get whatever key is associated with that. This could throw off scripts that do analysis. Or what if the vendor has 10 rules and the admin wants to insert 1 rule in the middle of that list? The only way to straighten this out and make it predictable by the system admin would be to delete all rules. But since each set of rules tends to start with -D, then do we match that or is it implied that means discard everything already processed? To be honest, I am very skeptical that adding something this complex will have the same amount of benefit as the effort it takes to add this feature. |
@stevegrubb the way the override logic works in systemd should be able to accommodate what you describe. If the distro ships rules The overall goal (the way I see it) is for distros only to ship config in |
I left this open because I wanted to reconsider this in the future. After thinking about this, there really are no vendor presets. Every setup is different. Because of that, if there were vendor presets, they'd be completely overridden in /etc. So, I'd like to just stay with the current setup. |
This is a feature request for some new userspace logic doing rules-lookup in a more advanced way, in
augenrules
ORauditd
.In the context of stateless systems and immutables OS (e.g. CoreOS flavors of Redhat and Fedora, RHCOS/FCOS), it is worth to leave the content of
/etc
under exclusive ownership of the user, and move all system defaults to an immutable and OS-owned location under/usr
.To exploit the full potential of that, it would be helpful that
auditd
ORausgenrule
would start looking up rules fragments in the following hierarchies (in order of increasing priority):Individual fragments would be ordered lexicographically by filename. Files with same name in higher priority directories can override those in lower directories.
For an example of software already having this kind of fragments-lookup logic you can have a look at the systemd suite, e.g.
sysctl.d
: https://www.freedesktop.org/software/systemd/man/sysctl.d.html#confdThe text was updated successfully, but these errors were encountered: