mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
audit_flags_fm_configure fails in dev_sonoma because of the ^fm #152
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cipineda on GitHub.
Summary
I did find a similar issue (#73) but it is way too old.
audit_flags_fm_configure fails all the time even if the -fm flag is in the file and I think it is because of the
'^fm'code.Steps to reproduce
In Sonoma 14.0 Beta 7 (23A5337a) one running the following code it always returns 0.
Run: /usr/bin/awk -F':' '/^flags/ { print $NF }' /etc/security/audit_control | /usr/bin/tr ',' '\n' | /usr/bin/grep -Ec '^fm'
Operating System version
Sonoma 14.0 Beta 7 (23A5337a)
Intel or Apple Silicon
Silicon and Intel
What is the current bug behavior?
validation script returns 0 even if the audit file does have the -fm flag
What is the expected correct behavior?
Validation script should return 1
Relevant logs and/or screenshots
Output of checks
/usr/bin/awk -F':' '/^flags/ { print $NF }' /etc/security/audit_control | /usr/bin/tr ',' '\n' | /usr/bin/grep -Ec '^fm'0Possible fixes
/usr/bin/awk -F':' '/^flags/ { print $NF }' /etc/security/audit_control | /usr/bin/tr ',' '\n' | /usr/bin/grep -Ec 'fm'OR
/usr/bin/awk -F':' '/^flags/ { print $NF }' /etc/security/audit_control | /usr/bin/tr ',' '\n' | /usr/bin/grep -Ec '-fm'@cipineda commented on GitHub:
Here it is.
P4: //depot/projects/trustedbsd/openbsm/etc/audit_control#8dir:/var/audit
flags:lo,aa,ad,-ex,-fd,-fm,-fr,-fw
minfree:25
naflags:lo,aa
policy: ahlt,argv
filesz:2M
expire-after:7d
superuser-set-sflags-mask:has_authenticated,has_console_access
superuser-clear-sflags-mask:has_authenticated,has_console_access
member-set-sflags-mask:
member-clear-sflags-mask:has_authenticated
@cipineda commented on GitHub:
The rule Im using and reporting in this issue is
audit_flags_fm_configureand it failed as coded, until I modified the proposed code above, then it marked the finding as passed.@brodjieski commented on GitHub:
Can you share your configuration in
/etc/security/audit_control?@brodjieski commented on GitHub:
That configuration does not contain the
fmflag, and will fail the check foraudit_flags_fm_configure.I see you have
-fmwhich will pass the check foraudit_flags_fm_failed_configure, but will not pass the other. With audit flagsfmis not the same as-fm.@brodjieski commented on GitHub:
There are 2 different rules that touch upon the
fmflag for auditing. One isaudit_flags_fm_configureand the other isaudit_flags_fm_failed_configure.The rule referenced in this issue is
audit_flags_fm_configurewhich is looking forfmin the flags, and will fail if only-fmexists in the flags.The other rule
audit_flags_fm_failed_configureis checking for-fm.Depending on which rule you are including in your baseline, it should pass if configured correctly as written.
@cipineda commented on GitHub:
Are you saying that the flags: should not have a dash at all?
@brodjieski commented on GitHub:
Flags can include a dash, along with other modifiers, according to the
audit_controlman page. Flags with a-indicate it will only log failed events. We have 2 rules in the project that cover the file modification (fm) events. One is to capture all audit events, and the other is to capture failed.The rule
audit_flags_fm_configureis to capture them all...fmThe rule
audit_flags_fm_failed_configureis to capture the failed...-fmDepending on which rule you want to include in your baseline, that will result in which configuration you need to pass the check.
If you want to pass the
audit_flags_fm_configurerule, your configuration needs to includefmin the flags.If you want to pass the
audit_flags_fm_failed_configurerule, your configuration needs to include-fmin the flags.