-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11246 from marcusburghardt/audit_rules_privileged…
…_commands_dracut Include dracut filter to audit_rules_privileged_commands
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
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
6 changes: 6 additions & 0 deletions
6
..._commands/audit_rules_privileged_commands/tests/augenrules_extra_rules_configured.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,6 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
# platform = multi_platform_fedora,multi_platform_rhel,Oracle Linux 7,Oracle Linux 8 | ||
|
||
./generate_privileged_commands_rule.sh {{{ uid_min }}} privileged /etc/audit/rules.d/privileged.rules | ||
echo "-a always,exit -F path=/usr/bin/notrelevant -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -F key=privileged" >> /etc/audit/rules.d/privileged.rules |
18 changes: 18 additions & 0 deletions
18
...commands/audit_rules_privileged_commands/tests/augenrules_rules_ignore_dracut_tmp.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,18 @@ | ||
#!/bin/bash | ||
# packages = audit | ||
# platform = multi_platform_fedora,multi_platform_rhel,Oracle Linux 7,Oracle Linux 8 | ||
|
||
./generate_privileged_commands_rule.sh {{{ uid_min }}} privileged /etc/audit/rules.d/privileged.rules | ||
|
||
# Create some files simulating dracut temporary files. See: | ||
# - https://github.com/ComplianceAsCode/content/issues/10938 | ||
# - https://bugzilla.redhat.com/show_bug.cgi?id=1852337 | ||
# - https://bugzilla.redhat.com/show_bug.cgi?id=2230306 | ||
mount -o remount,suid,exec /var/tmp/ | ||
for file in mount umount; do | ||
path="/var/tmp/dracut.ksbFYD/initramfs/usr/bin" | ||
filepath="$path/$file" | ||
mkdir -p $path | ||
touch $filepath | ||
chmod 4755 $filepath | ||
done |