-
Notifications
You must be signed in to change notification settings - Fork 36
removes ignore everything else audit rule #2545
base: main
Are you sure you want to change the base?
removes ignore everything else audit rule #2545
Conversation
Thanks!
Can you give the exact file name you used and what the rule was/how to trigger it? |
Sure @pothos. setupStart with an empty cd /etc/audit
mv rules.d rules.d.old
mkdir rules.d add a file in
Restart the rules.
Output:
open second terminal and run:
run any command in the first terminal:
Result without ignore everything else rule:logs are being written to audit.log Add in ignore everything else rule:add in 99-default.rules
Output:
hit enter a few times in your tail terminal run any command:
Resultno output to your audit.log file. FixComment out rule:
Output:
Now look at the tail terminal. Logs start showing up. SummaryThis is the intended behavior of the ignore everything rule because once a rule triggers, the event then goes to the exclude filter for processing. Since the ignore everything rule is excluding everything no rules are being triggered. |
|
||
# Ignore everything else. | ||
-a exclude,always -F msgtype>0 | ||
-a exclude,never -F msgtype=CONFIG_CHANGE |
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.
-a exclude,never -F msgtype=CONFIG_CHANGE | |
-a exclude,never -F msgtype=CONFIG_CHANGE | |
A newline here would be good since these files are concatenated and one may want to run cat rules.d/*
Thanks, so the issue is that one would need to add an explicit rule to "not exclude this and that", making it harder/error prone to use, or? |
As @jepio pointed out, the rule was there because by default too much gets logged. That's also what I see when removing only this rule. |
Hey @pothos. Thanks for looking into this. The To clarify, the With no rules (the rules.d directory is empty) it seems we just get the hard coded audit rules in auditd and the linux kernel. I think the hard coded rules are the most important audit rules. auditd is disabled by default in flatcar IIRC. If users enables auditd and want to exclude specific audit rules then those users can modify the audit rules to their use cases. I'd suggest removing the If that is not an option then I'd suggest renaming the rule to Thoughts? |
Yes, it's not that many log entries but still it creates a couple of lines in dmesg for every container start and one As for docs, I think this Butane(→Ignition) config should work to overwrite the default rules:
|
3ca21db
to
cfa0b18
Compare
The default ignore rule is tricky because it needs to be removed first when setting up own rules. We should at least document this. We can also tweak the defaults independently from having docs (as long as the docs are updated). See flatcar-archive/coreos-overlay#2545
Ok, I've prepared a docs PR: flatcar-archive/flatcar-docs#296 But I'm still interested in having better defaults – e.g., could we maybe tweak the ignore filter to only suppress the PAM rules while letting your example rule through? |
The default ignore rule is tricky because it needs to be removed first when setting up own rules. We should at least document this. We can also tweak the defaults independently from having docs (as long as the docs are updated). See flatcar-archive/coreos-overlay#2545
@pothos i'll take a look at tweaking the ignore filter. |
@pothos the |
Thanks, for reaching out, I've commented in flatcar/Flatcar#1023 (comment) |
Removes ignore everything else rule
The ignore everything else rule in
/etc/audit/rules.d/99-default.rules
ignores all audit rules added before the ignore everything else rule.Once a rule triggers, the event then goes to the exclude filter for processing. So, if you told it to drop all events, you will not see any events.
How to use
Add a rule to audit rules and trigger the rule. You should see the log entry in
/var/log/audit/audit.log
e.g.
auditctl -A exit,always -S all
Testing done
Removed the ignore everything else rule and the audit rules started logging to audit.log.
Posted issue in auditd-userspace repo. linux-audit/audit-userspace#302
changelog/
directory (user-facing change, bug fix, security fix, update)/boot
and/usr
size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.