-
Notifications
You must be signed in to change notification settings - Fork 705
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 #5756 from vojtapolasek/fix_ansible_grub2_template
fix grub2_bootloader_argument template (cherry picked from commit 3e1fae9)
- Loading branch information
1 parent
9623539
commit 9ade722
Showing
9 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
linux_os/guide/system/auditing/grub2_audit_argument/tests/double_value_rhel7.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,14 @@ | ||
#!/bin/bash | ||
# profiles = xccdf_org.ssgproject.content_profile_ospp | ||
# platform = Red Hat Enterprise Linux 7 | ||
|
||
# Break the audit argument in kernel command line in /boot/grub2/grub.cfg | ||
file="/boot/grub2/grub.cfg" | ||
if grep -q '^.*audit=.*' "$file" ; then | ||
# modify the GRUB command-line if an audit= arg already exists | ||
sed -i 's/\(^.*\)audit=[^[:space:]]*\(.*\)/\1 audit=11 \2/' "$file" | ||
else | ||
# no audit=arg is present, append it | ||
sed -i 's/\(^.*\(vmlinuz\|kernelopts\).*\)/\1 audit=11/' "$file" | ||
fi | ||
|
13 changes: 13 additions & 0 deletions
13
linux_os/guide/system/auditing/grub2_audit_argument/tests/double_value_rhel8.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 | ||
# profiles = xccdf_org.ssgproject.content_profile_ospp | ||
# platform = Red Hat Enterprise Linux 8 | ||
|
||
# Break the audit argument in kernel command line in /boot/grub2/grubenv | ||
file="/boot/grub2/grubenv" | ||
if grep -q '^.*audit=.*' "$file" ; then | ||
# modify the GRUB command-line if an audit= arg already exists | ||
sed -i 's/\(^.*\)audit=[^[:space:]]*\(.*\)/\1 audit=11 \2/' "$file" | ||
else | ||
# no audit=arg is present, append it | ||
sed -i 's/\(^.*\(vmlinuz\|kernelopts\).*\)/\1 audit=11/' "$file" | ||
fi |
13 changes: 13 additions & 0 deletions
13
..._os/guide/system/auditing/grub2_audit_backlog_limit_argument/tests/correct_grubby.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,13 @@ | ||
#!/bin/bash | ||
# platform = Red Hat Enterprise Linux 7 | ||
|
||
# Correct the form of default kernel command line in GRUB /etc/default/grub and applies value through Grubby | ||
if grep -q '^GRUB_CMDLINE_LINUX=.*audit_backlog_limit=.*"' '/etc/default/grub' ; then | ||
# modify the GRUB command-line if an audit_backlog_limit= arg already exists | ||
sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\)audit_backlog_limit=[^[:space:]]*\(.*"\)/\1 audit_backlog_limit=8192 \2/' '/etc/default/grub' | ||
else | ||
# no audit_backlog_limit=arg is present, append it | ||
sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\)"/\1 audit_backlog_limit=8192"/' '/etc/default/grub' | ||
fi | ||
|
||
grubby --update-kernel=ALL --args="audit_backlog_limit=8192" |
4 changes: 4 additions & 0 deletions
4
...os/guide/system/auditing/grub2_audit_backlog_limit_argument/tests/correct_grubenv.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,4 @@ | ||
#!/bin/bash | ||
# platform = Red Hat Enterprise Linux 8 | ||
|
||
grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) audit_backlog_limit=8192" |
11 changes: 11 additions & 0 deletions
11
...stem/auditing/grub2_audit_backlog_limit_argument/tests/wrong_value_etcdefaultgrub.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,11 @@ | ||
#!/bin/bash | ||
# platform = Red Hat Enterprise Linux 7 | ||
|
||
# Break the audit_backlog_limit argument in kernel command line in /etc/default/grub | ||
if grep -q '^GRUB_CMDLINE_LINUX=.*audit_backlog_limit=.*"' '/etc/default/grub' ; then | ||
# modify the GRUB command-line if an audit_backlog_limit= arg already exists | ||
sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\)audit_backlog_limit=[^[:space:]]*\(.*"\)/\1 audit_backlog_limit=123 \2/' '/etc/default/grub' | ||
else | ||
# no audit_backlog_limit=arg is present, append it | ||
sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\)"/\1 audit_backlog_limit=123"/' '/etc/default/grub' | ||
fi |
12 changes: 12 additions & 0 deletions
12
.../guide/system/auditing/grub2_audit_backlog_limit_argument/tests/wrong_value_rhel8.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 | ||
# platform = Red Hat Enterprise Linux 8 | ||
|
||
# Break the audit_backlog_limit argument in kernel command line in /boot/grub2/grubenv | ||
file="/boot/grub2/grubenv" | ||
if grep -q '^.*audit_backlog_limit=.*' "$file" ; then | ||
# modify the GRUB command-line if an audit_backlog_limit= arg already exists | ||
sed -i 's/\(^.*\)audit_backlog_limit=[^[:space:]]*\(.*\)/\1 audit_backlog_limit=123 \2/' "$file" | ||
else | ||
# no audit_backlog_limit=arg is present, append it | ||
sed -i 's/\(^.*\(vmlinuz\|kernelopts\).*\)/\1 audit_backlog_limit=123/' "$file" | ||
fi |
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
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
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