-
Notifications
You must be signed in to change notification settings - Fork 121
Description
Describe the Bug
I posted this bug over in the ato-toolkit repo but later realized that project uses the output (configuration files) from this project.
This Powershell module incorrectly defines several STIG rules for Ubuntu, specifically for the audit service. Currently STIG rules are defined by comparing against the wrong auid value (-1
instead of 4294967295
). Please see the issue linked above for the full list.
To illustrate this bug, please review this STIG rule very carefully. When the audit rule is defined in the file /etc/audit/rules.d/audit.rules
, it should contain the lines:
-a always,exit -F arch=b32 -S setxattr -F auid>=1000 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b32 -S setxattr -F auid=0 -k perm_mod
-a always,exit -F arch=b64 -S setxattr -F auid>=1000 -F auid!=4294967295 -k perm_mod
-a always,exit -F arch=b64 -S setxattr -F auid=0 -k perm_mod
However this module defines the rules as:
-a always,exit -F arch=b32 -S setxattr -F auid>=1000 -F auid!=-1 -k perm_mod
-a always,exit -F arch=b32 -S setxattr -F auid=0 -k perm_mod
-a always,exit -F arch=b64 -S setxattr -F auid>=1000 -F auid!=-1 -k perm_mod
-a always,exit -F arch=b64 -S setxattr -F auid=0 -k perm_mod
Note: the minute difference is the text auid!=4294967295
vs auid!=-1
.
Once audit loads rules from /etc/audit/rules.d/audit.rules
, those rules are queried for and verified by external software via auditctl
. The output of auditctl would display the above rules as
-a always,exit -F arch=b32 -S setxattr -F auid>=1000 -F auid!=-1 -k perm_mod
-a always,exit -F arch=b32 -S setxattr -F auid=0 -k perm_mod
-a always,exit -F arch=b64 -S setxattr -F auid>=1000 -F auid!=-1 -k perm_mod
-a always,exit -F arch=b64 -S setxattr -F auid=0 -k perm_mod
Expected behavior
audit rules should be defined using the auid!=4294967295
format. This powershell module uses the auid!=-1
format though (as seen here).
Additional context
Popular STIG compliance checkers (such as Nessus) perform a regex comparison against audit rules. They usually check both the output of auditctl
and the audit rule definitions file. While audit interprets the -1
value and 4294967295
value interchangeably, this leads to hundreds of false positive findings in compliance reports when customers are applying automated STIG deployments (via the ato-toolkit
).