forked from ComplianceAsCode/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created test cases covering /etc/audit/rules.d/privileged.rules and /…
…etc/audit/audit.rules
- Loading branch information
Showing
22 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...itd_configure_rules/audit_rules_suid_privilege_function/tests/correct_value.audit.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
|
||
{{% if product == "ol8" %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid" | ||
OTHER_FILTERS_EGID=" -C gid!=egid" | ||
{{% else %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid -F euid=0" | ||
OTHER_FILTERS_EGID=" -C gid!=egid -F egid=0" | ||
{{% endif %}} | ||
|
||
echo "-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EGID} -k setgid" > /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EGID} -k setgid" >> /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EUID} -k setuid" >> /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EUID} -k setuid" >> /etc/audit/audit.rules |
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
.../auditd_configure_rules/audit_rules_suid_privilege_function/tests/miss_arch.audit.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
|
||
{{% if product == "ol8" %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid" | ||
OTHER_FILTERS_EGID=" -C gid!=egid" | ||
{{% else %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid -F euid=0" | ||
OTHER_FILTERS_EGID=" -C gid!=egid -F egid=0" | ||
{{% endif %}} | ||
|
||
echo "-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EGID} -k setgid" > /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EUID} -k setuid" >> /etc/audit/audit.rules |
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
...ing/auditd_configure_rules/audit_rules_suid_privilege_function/tests/miss_c.audit.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
|
||
{{% if product != "ol8" %}} | ||
OTHER_FILTERS_EUID=" -F euid=0" | ||
OTHER_FILTERS_EGID=" -F egid=0" | ||
{{% endif %}} | ||
|
||
echo "-a always,exit -F arch=b32 -S execve -C gid!=guid${OTHER_FILTERS_EGID} -k setgid" > /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EGID} -k setgid" >> /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EUID} -k setuid" >> /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b64 -S execve -C uid!=euid${OTHER_FILTERS_EUID} -k setuid" >> /etc/audit/audit.rules |
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
...g/auditd_configure_rules/audit_rules_suid_privilege_function/tests/no_rules.audit.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
|
||
rm -rf /etc/audit/audit.rules |
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
.../auditd_configure_rules/audit_rules_suid_privilege_function/tests/other_key.audit.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
|
||
# This tests situation where key value is not std. And also situation where there is extra spaces in rules. | ||
|
||
{{% if product == "ol8" %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid" | ||
OTHER_FILTERS_EGID=" -C gid!=egid" | ||
{{% else %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid -F euid=0" | ||
OTHER_FILTERS_EGID=" -C gid!=egid -F egid=0" | ||
{{% endif %}} | ||
|
||
echo " -a always,exit -F arch=b32 -S execve ${OTHER_FILTERS_EGID} -F key=my_setgid-audit-rule " > /etc/audit/audit.rules | ||
echo " -a always,exit -F arch=b64 -S execve ${OTHER_FILTERS_EGID} -k my_setgid-audit-rule " >> /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b32 -S execve ${OTHER_FILTERS_EUID} -k my_setuid-audit-rule" >> /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b64 -S execve ${OTHER_FILTERS_EUID} -F key=my_setuid-audit-rule" >> /etc/audit/audit.rules |
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
.../auditd_configure_rules/audit_rules_suid_privilege_function/tests/use_f_key.audit.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
|
||
|
||
{{% if product == "ol8" %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid" | ||
OTHER_FILTERS_EGID=" -C gid!=egid" | ||
{{% else %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid -F euid=0" | ||
OTHER_FILTERS_EGID=" -C gid!=egid -F egid=0" | ||
{{% endif %}} | ||
|
||
echo "-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EGID} -F key=setgid" > /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EGID} -F key=setgid" >> /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EUID} -F key=setuid" >> /etc/audit/audit.rules | ||
echo "-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EUID} -F key=setuid" >> /etc/audit/audit.rules |
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
...ng/auditd_configure_rules/audit_rules_suid_privilege_function/tests/wrong_a.audit.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
|
||
{{% if product == "ol8" %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid" | ||
OTHER_FILTERS_EGID=" -C gid!=egid" | ||
{{% else %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid -F euid=0" | ||
OTHER_FILTERS_EGID=" -C gid!=egid -F egid=0" | ||
{{% endif %}} | ||
|
||
echo "-a never,exit -F arch=b32 -S execve${OTHER_FILTERS_EGID} -k setgid" > /etc/audit/audit.rules | ||
echo "-a never,exit -F arch=b64 -S execve${OTHER_FILTERS_EGID} -k setgid" >> /etc/audit/audit.rules | ||
echo "-a never,exit -F arch=b32 -S execve${OTHER_FILTERS_EUID} -k setuid" >> /etc/audit/audit.rules | ||
echo "-a never,exit -F arch=b64 -S execve${OTHER_FILTERS_EUID} -k setuid" >> /etc/audit/audit.rules |
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
...ditd_configure_rules/audit_rules_suid_privilege_function/tests/wrong_c_egid.audit.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
|
||
{{% if product == "ol8" %}} | ||
OTHER_FILTERS_EUID=" -C uid!=egid" | ||
OTHER_FILTERS_EGID=" -C gid!=egid" | ||
{{% else %}} | ||
OTHER_FILTERS_EUID=" -C uid!=egid -F euid=0" | ||
OTHER_FILTERS_EGID=" -C gid!=egid -F egid=0" | ||
{{% endif %}} | ||
|
||
echo '-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EGID} -k setgid' > /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EGID} -k setgid' >> /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EGID} -k setuid' >> /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EGID} -k setuid' >> /etc/audit/audit.rules |
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
...ditd_configure_rules/audit_rules_suid_privilege_function/tests/wrong_c_euid.audit.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
|
||
{{% if product == "ol8" %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid" | ||
OTHER_FILTERS_EGID=" -C gid!=euid" | ||
{{% else %}} | ||
OTHER_FILTERS_EUID=" -C uid!=euid -F euid=0" | ||
OTHER_FILTERS_EGID=" -C gid!=euid -F egid=0" | ||
{{% endif %}} | ||
|
||
echo '-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EGID} -k setgid' > /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EGID} -k setgid' >> /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b32 -S execve${OTHER_FILTERS_EGID} -k setuid' >> /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b64 -S execve${OTHER_FILTERS_EGID} -k setuid' >> /etc/audit/audit.rules |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
...ditd_configure_rules/audit_rules_suid_privilege_function/tests/wrong_f_egid.audit.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
{{% if product == "ol8" %}} | ||
# platform = Not Applicable | ||
{{% endif %}} | ||
|
||
echo '-a always,exit -F arch=b32 -S execve -C gid!=egid -F euid=0 -k setgid' > /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b64 -S execve -C gid!=egid -F euid=0 -k setgid' >> /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -k setuid' >> /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k setuid' >> /etc/audit/audit.rules |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
...ditd_configure_rules/audit_rules_suid_privilege_function/tests/wrong_f_euid.audit.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
{{% if product == "ol8" %}} | ||
# platform = Not Applicable | ||
{{% endif %}} | ||
|
||
echo '-a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -k setgid' > /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -k setgid' >> /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b32 -S execve -C uid!=euid -F egid=0 -k setuid' >> /etc/audit/audit.rules | ||
echo '-a always,exit -F arch=b64 -S execve -C uid!=euid -F egid=0 -k setuid' >> /etc/audit/audit.rules |
File renamed without changes.