diff --git a/linux_os/guide/auditing/grub2_audit_argument/tests/arg_not_there_etcdefaultgrub_recovery_disabled.fail.sh b/linux_os/guide/auditing/grub2_audit_argument/tests/arg_not_there_etcdefaultgrub_recovery_disabled.fail.sh deleted file mode 100644 index 9581952235f5..000000000000 --- a/linux_os/guide/auditing/grub2_audit_argument/tests/arg_not_there_etcdefaultgrub_recovery_disabled.fail.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# platform = Oracle Linux 7 -# Removes audit argument from kernel command line in /etc/default/grub -if grep -q '^GRUB_CMDLINE_LINUX_DEFAULT=.*audit=.*"' '/etc/default/grub' ; then - sed -i 's/\(^GRUB_CMDLINE_LINUX_DEFAULT=".*\)audit=[^[:space:]]*\(.*"\)/\1 \2/' '/etc/default/grub' -fi - -# removing the parameter from the no recovery kernel parameters as well -sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\)audit=[^[:space:]]*\(.*"\)/\1 \2/' '/etc/default/grub' - -# disabling recovery -sed -i 's/\(^.*GRUB_DISABLE_RECOVERY=\).*/\1true/' '/etc/default/grub' - -#if the line is not present at all, add it -if ! grep -q '^GRUB_CMDLINE_LINUX_DEFAULT=.*$' '/etc/default/grub'; then - echo 'GRUB_CMDLINE_LINUX_DEFAULT=""' >> /etc/default/grub -fi diff --git a/linux_os/guide/auditing/grub2_audit_argument/tests/arg_not_there_rhel7.fail.sh b/linux_os/guide/auditing/grub2_audit_argument/tests/arg_not_there_grub_cfg.fail.sh similarity index 100% rename from linux_os/guide/auditing/grub2_audit_argument/tests/arg_not_there_rhel7.fail.sh rename to linux_os/guide/auditing/grub2_audit_argument/tests/arg_not_there_grub_cfg.fail.sh diff --git a/linux_os/guide/auditing/grub2_audit_argument/tests/blank_grubenv_rhel8.fail.sh b/linux_os/guide/auditing/grub2_audit_argument/tests/blank_grubenv_rhel8.fail.sh deleted file mode 100644 index 4a03a2117f31..000000000000 --- a/linux_os/guide/auditing/grub2_audit_argument/tests/blank_grubenv_rhel8.fail.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# platform = Oracle Linux 8,Red Hat Enterprise Linux 8 -# remediation = none - -# Removes audit argument from kernel command line in /boot/grub2/grubenv -file="/boot/grub2/grubenv" -# the file needs to have exactly 1024 bytes. The grubenv files add a newline -# when it gets copied, hence we need to strip the last byte of the file so -# the command grub2-editenv doesn't end with "/usr/bin/grub2-editenv: error: environment block too small." -head -c -1 grubenv > "$file" diff --git a/linux_os/guide/auditing/grub2_audit_argument/tests/double_value_rhel7.fail.sh b/linux_os/guide/auditing/grub2_audit_argument/tests/double_value_ol7.fail.sh similarity index 100% rename from linux_os/guide/auditing/grub2_audit_argument/tests/double_value_rhel7.fail.sh rename to linux_os/guide/auditing/grub2_audit_argument/tests/double_value_ol7.fail.sh diff --git a/linux_os/guide/auditing/grub2_audit_argument/tests/wrong_value_rhel7.fail.sh b/linux_os/guide/auditing/grub2_audit_argument/tests/wrong_value_ol7.fail.sh similarity index 100% rename from linux_os/guide/auditing/grub2_audit_argument/tests/wrong_value_rhel7.fail.sh rename to linux_os/guide/auditing/grub2_audit_argument/tests/wrong_value_ol7.fail.sh diff --git a/linux_os/guide/auditing/grub2_audit_argument/tests/wrong_value_rhel8.fail.sh b/linux_os/guide/auditing/grub2_audit_argument/tests/wrong_value_rhel8.fail.sh deleted file mode 100644 index 35034f242349..000000000000 --- a/linux_os/guide/auditing/grub2_audit_argument/tests/wrong_value_rhel8.fail.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# platform = Oracle Linux 8,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=0 \2/' "$file" -else - # no audit=arg is present, append it - sed -i 's/\(^.*\(vmlinuz\|kernelopts\).*\)/\1 audit=0/' "$file" -fi