diff --git a/linux_os/guide/system/software/sudo/sudo_custom_logfile/rule.yml b/linux_os/guide/system/software/sudo/sudo_custom_logfile/rule.yml index 1e6d346709b..5bc09fde527 100644 --- a/linux_os/guide/system/software/sudo/sudo_custom_logfile/rule.yml +++ b/linux_os/guide/system/software/sudo/sudo_custom_logfile/rule.yml @@ -78,7 +78,7 @@ template: # # Finally, we check for regular word boundary (with \b), ensuring the # next character isn't yet another word character. - option_regex_suffix: '=("(?:\\"|\\\\|[^"\\\n])*"\B|[^"](?:(?:\\,|\\"|\\ |\\\\|[^", \\\n])*)\b)' + option_regex_suffix: '\s*=\s*("(?:\\"|\\\\|[^"\\\n])*"\B|[^"](?:(?:\\,|\\"|\\ |\\\\|[^", \\\n])*)\b)' variable_name: var_sudo_logfile platform: package[sudo] diff --git a/linux_os/guide/system/software/sudo/sudo_custom_logfile/tests/logfile_enabled_spaces.pass.sh b/linux_os/guide/system/software/sudo/sudo_custom_logfile/tests/logfile_enabled_spaces.pass.sh new file mode 100644 index 00000000000..cea8e4f617d --- /dev/null +++ b/linux_os/guide/system/software/sudo/sudo_custom_logfile/tests/logfile_enabled_spaces.pass.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# platform = multi_platform_all +# packages = sudo + +# Test that OVAL check allows spaces around the equal sign +# This test scenario is a regression test of https://issues.redhat.com/browse/RHEL-1904 + +echo "Defaults logfile = /var/log/sudo.log" >> /etc/sudoers