From fdb43620373d71f59e4df90d9cb5bfe5ae3c2057 Mon Sep 17 00:00:00 2001 From: teacup-on-rockingchair <315160+teacup-on-rockingchair@users.noreply.github.com> Date: Sun, 20 Sep 2026 17:02:16 +0300 Subject: [PATCH 1/2] Make sudo related rules compatible with transactional based sle/slmicro platforms Make sure distro default config is used as basis for configuration and oval, bash and ansible take this into account --- .../sudo_remove_no_authenticate/ansible/shared.yml | 13 +++++++++++++ .../sudo/sudo_remove_no_authenticate/bash/shared.sh | 4 ++++ .../sudo_remove_no_authenticate/oval/shared.xml | 9 +++++++++ .../tests/correct_value.pass.sh | 1 + .../tests/wrong_value.fail.sh | 7 +------ .../tests/wrong_value_include_dir.fail.sh | 6 ++++++ .../sudo/sudo_remove_nopasswd/ansible/shared.yml | 13 +++++++++++++ .../sudo/sudo_remove_nopasswd/bash/shared.sh | 4 ++++ .../sudo/sudo_remove_nopasswd/oval/shared.xml | 10 ++++++++++ .../tests/correct_value.pass.sh | 2 +- .../sudo_remove_nopasswd/tests/wrong_value.fail.sh | 6 +----- .../tests/wrong_value_include_dir.fail.sh | 8 ++++++++ .../tests/wrong_value_specific_commands.fail.sh | 2 +- .../tests/correct_value.pass.sh | 1 + .../tests/wrong_value.fail.sh | 2 +- .../oval/shared.xml | 12 ++++++++++-- .../sudo/sudoers_validate_passwd/ansible/shared.yml | 13 +++++++++++++ .../sudo/sudoers_validate_passwd/bash/shared.sh | 5 +++++ .../sudo/sudoers_validate_passwd/oval/shared.xml | 10 ++++++++++ .../tests/sudoers_d_duplicate.pass.sh | 2 +- ...doers_validate_passwd_conflicting_values.fail.sh | 2 +- .../sudoers_validate_passwd_duplicates.fail.sh | 2 +- .../sudoers_validate_passwd_duplicates.pass.sh | 2 +- .../sudoers_validate_passwd_multiple_files.pass.sh | 2 +- .../tests/sudoers_validate_runaspw.fail.sh | 2 +- .../tests/sudoers_validate_targetpw.fail.sh | 4 ++-- 26 files changed, 120 insertions(+), 24 deletions(-) create mode 100644 linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/wrong_value_include_dir.fail.sh create mode 100644 linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value_include_dir.fail.sh diff --git a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/ansible/shared.yml b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/ansible/shared.yml index 66d9cdac057e..de967b1c2f0d 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/ansible/shared.yml +++ b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/ansible/shared.yml @@ -4,4 +4,17 @@ # complexity = low # disruption = low +{{% if product in [ 'sle16', 'slmicro6' ] %}} +{{{ ansible_copy_distro_defaults('/usr/etc/sudoers', '/etc/sudoers', rule_title=rule_title) }}} +{{{ + ansible_lineinfile( + rule_title + " - Remove /usr/etc/sudoers.d include directive from /etc/sudoers", + path="/etc/sudoers", + regex='^\s*@includedir\s+/usr/etc/sudoers.d', + state="absent", + when="not ansible_check_mode" + ) +}}} +{{% endif %}} + {{{ ansible_sudo_remove_config("!authenticate", "\!authenticate") }}} diff --git a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/bash/shared.sh b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/bash/shared.sh index 187c4063ff1f..3c4c3eeb0487 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/bash/shared.sh +++ b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/bash/shared.sh @@ -4,4 +4,8 @@ # complexity = low # disruption = low +{{% if product in [ 'sle16', 'slmicro6' ] %}} +{{{ bash_copy_distro_defaults("/usr/etc/sudoers", "/etc/sudoers") }}} +{{{ lineinfile_absent("/etc/sudoers", "^\s*@includedir\s*/usr/etc/sudoers\.d", sed_path_separator="#", rule_id=rule_id) }}} +{{% endif %}} {{{ bash_sudo_remove_config("!authenticate", "\!authenticate") }}} diff --git a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/oval/shared.xml b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/oval/shared.xml index 3534c9de1d32..6bc575746872 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/oval/shared.xml +++ b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/oval/shared.xml @@ -4,9 +4,18 @@ + {{% if product in [ 'sle16', 'slmicro6' ] %}} + + {{% endif %}} + {{% if product in [ 'sle16', 'slmicro6' ] %}} + {{{ oval_config_file_exists_test('/etc/sudoers', rule_id=rule_id) }}} + {{{ oval_config_file_exists_object('/etc/sudoers', rule_id=rule_id) }}} + {{% endif %}} diff --git a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/correct_value.pass.sh b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/correct_value.pass.sh index 0e185f75c15e..b9c314d173bb 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/correct_value.pass.sh +++ b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/correct_value.pass.sh @@ -1,4 +1,5 @@ #!/bin/bash +# packages = sudo rm -f /etc/sudoers echo "Defaults authenticate" > /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/wrong_value.fail.sh b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/wrong_value.fail.sh index ddfef81b9195..8a5664bcdb4c 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/wrong_value.fail.sh +++ b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/wrong_value.fail.sh @@ -1,8 +1,3 @@ #!/bin/bash - +# packages = sudo echo "Defaults !authenticate" >> /etc/sudoers -chmod 440 /etc/sudoers - -mkdir -p /etc/sudoers.d -echo "Defaults !authenticate" >> /etc/sudoers.d/sudoers -chmod 440 /etc/sudoers.d/sudoers diff --git a/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/wrong_value_include_dir.fail.sh b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/wrong_value_include_dir.fail.sh new file mode 100644 index 000000000000..59bcd8ca9a38 --- /dev/null +++ b/linux_os/guide/system/software/sudo/sudo_remove_no_authenticate/tests/wrong_value_include_dir.fail.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# packages = sudo +echo "Defaults authenticate" > /etc/sudoers + +mkdir -p /etc/sudoers.d +echo "Defaults !authenticate" >> /etc/sudoers.d/sudoers diff --git a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/ansible/shared.yml b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/ansible/shared.yml index 37937aeda723..3fdf4e7502ae 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/ansible/shared.yml +++ b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/ansible/shared.yml @@ -4,4 +4,17 @@ # complexity = low # disruption = low +{{% if product in [ 'sle16', 'slmicro6' ] %}} +{{{ ansible_copy_distro_defaults('/usr/etc/sudoers', '/etc/sudoers', rule_title=rule_title) }}} +{{{ + ansible_lineinfile( + rule_title + " - Remove /usr/etc/sudoers.d include directive from /etc/sudoers", + path="/etc/sudoers", + regex='^\s*@includedir\s+/usr/etc/sudoers.d', + state="absent", + when="not ansible_check_mode" + ) +}}} +{{% endif %}} + {{{ ansible_sudo_remove_config("NOPASSWD", "NOPASSWD[\s]*\:") }}} diff --git a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/bash/shared.sh b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/bash/shared.sh index cd4f8294829f..5211922e07b3 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/bash/shared.sh +++ b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/bash/shared.sh @@ -4,4 +4,8 @@ # complexity = low # disruption = low +{{% if product in [ 'sle16', 'slmicro6' ] %}} +{{{ bash_copy_distro_defaults("/usr/etc/sudoers", "/etc/sudoers") }}} +{{{ lineinfile_absent("/etc/sudoers", "^\s*@includedir\s*/usr/etc/sudoers\.d", sed_path_separator="#", rule_id=rule_id) }}} +{{% endif %}} {{{ bash_sudo_remove_config("NOPASSWD", "NOPASSWD[\s]*\:") }}} diff --git a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/oval/shared.xml b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/oval/shared.xml index f93586db2d88..592cf32fa657 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/oval/shared.xml +++ b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/oval/shared.xml @@ -4,9 +4,19 @@ + {{% if product in [ 'sle16', 'slmicro6' ] %}} + + {{% endif %}} + {{% if product in [ 'sle16', 'slmicro6' ] %}} + {{{ oval_config_file_exists_test('/etc/sudoers', rule_id=rule_id) }}} + {{{ oval_config_file_exists_object('/etc/sudoers', rule_id=rule_id) }}} + {{% endif %}} + diff --git a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/correct_value.pass.sh b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/correct_value.pass.sh index 1c8dd81ab135..6f0cc680dceb 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/correct_value.pass.sh +++ b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/correct_value.pass.sh @@ -1,5 +1,5 @@ #!/bin/bash - +# packages = sudo rm -f /etc/sudoers echo "%wheel ALL=(ALL) ALL" > /etc/sudoers chmod 440 /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value.fail.sh b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value.fail.sh index fa821e9dc3c2..32a05422b4b6 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value.fail.sh +++ b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value.fail.sh @@ -1,8 +1,4 @@ #!/bin/bash - +# packages = sudo echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers chmod 440 /etc/sudoers - -mkdir -p /etc/sudoers.d -echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/sudoers -chmod 440 /etc/sudoers.d/sudoers diff --git a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value_include_dir.fail.sh b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value_include_dir.fail.sh new file mode 100644 index 000000000000..69150fe39ce8 --- /dev/null +++ b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value_include_dir.fail.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# packages = sudo +echo "%wheel ALL=(ALL) ALL" > /etc/sudoers +chmod 440 /etc/sudoers + +mkdir -p /etc/sudoers.d +echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/sudoers +chmod 440 /etc/sudoers.d/sudoers diff --git a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value_specific_commands.fail.sh b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value_specific_commands.fail.sh index baf84bf66ee7..2f659afb6599 100644 --- a/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value_specific_commands.fail.sh +++ b/linux_os/guide/system/software/sudo/sudo_remove_nopasswd/tests/wrong_value_specific_commands.fail.sh @@ -1,5 +1,5 @@ #!/bin/bash - +# packages = sudo echo "%wheel ALL=(ALL) NOPASSWD: /bin/systemctl, /bin/lsof, /bin/date" >> /etc/sudoers chmod 440 /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudo_require_authentication/tests/correct_value.pass.sh b/linux_os/guide/system/software/sudo/sudo_require_authentication/tests/correct_value.pass.sh index 2091be2939ed..e51c6e6bf2b4 100644 --- a/linux_os/guide/system/software/sudo/sudo_require_authentication/tests/correct_value.pass.sh +++ b/linux_os/guide/system/software/sudo/sudo_require_authentication/tests/correct_value.pass.sh @@ -1,4 +1,5 @@ #!/bin/bash +# packages = sudo rm -f /etc/sudoers echo "%wheel ALL=(ALL) ALL" > /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudo_require_authentication/tests/wrong_value.fail.sh b/linux_os/guide/system/software/sudo/sudo_require_authentication/tests/wrong_value.fail.sh index 3c661e2902ea..b12cdcbd1225 100644 --- a/linux_os/guide/system/software/sudo/sudo_require_authentication/tests/wrong_value.fail.sh +++ b/linux_os/guide/system/software/sudo/sudo_require_authentication/tests/wrong_value.fail.sh @@ -1,5 +1,5 @@ #!/bin/bash - +# packages = sudo echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers echo "Defaults !authenticate" >> /etc/sudoers chmod 440 /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudo_restrict_privilege_elevation_to_authorized/oval/shared.xml b/linux_os/guide/system/software/sudo/sudo_restrict_privilege_elevation_to_authorized/oval/shared.xml index de5852dd2ec3..721dd4be5aaa 100644 --- a/linux_os/guide/system/software/sudo/sudo_restrict_privilege_elevation_to_authorized/oval/shared.xml +++ b/linux_os/guide/system/software/sudo/sudo_restrict_privilege_elevation_to_authorized/oval/shared.xml @@ -12,16 +12,24 @@ 1 {{% endmacro %}} - + {{{ oval_metadata("Check that sudoers doesn't allow all users to run commands via sudo", rule_title=rule_title) }}} + {{% if product in [ 'sle16', 'slmicro6' ] %}} + + {{% endif %}} {{{ check_sudoers(scope='users',pattern='^\s*ALL\s+ALL\=\(ALL\)\s+ALL\s*$') }}} {{{ check_sudoers(scope='group',pattern='^\s*ALL\s+ALL\=\(ALL\:ALL\)\s+ALL\s*') }}} - + {{% if product in [ 'sle16', 'slmicro6' ] %}} + {{{ oval_config_file_exists_test('/etc/sudoers', rule_id=rule_id) }}} + {{{ oval_config_file_exists_object('/etc/sudoers', rule_id=rule_id) }}} + {{% endif %}} diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml index e688c181f9b6..441bf6d5f201 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/ansible/shared.yml @@ -30,6 +30,19 @@ register: sudoers_file_defaults {{%- endmacro %}} +{{% if product in [ 'sle16', 'slmicro6' ] %}} +{{{ ansible_copy_distro_defaults('/usr/etc/sudoers', '/etc/sudoers', rule_title=rule_title) }}} +{{{ + ansible_lineinfile( + rule_title + " - Remove /usr/etc/sudoers.d include directive from /etc/sudoers", + path="/etc/sudoers", + regex='^\s*@includedir\s+/usr/etc/sudoers.d', + state="absent", + when="not ansible_check_mode" + ) +}}} +{{% endif %}} + {{{- delete_line_in_sudoers_d("Defaults targetpw") }}} {{{- delete_line_in_sudoers_d("Defaults rootpw") }}} {{{- delete_line_in_sudoers_d("Defaults runaspw") }}} diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/bash/shared.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/bash/shared.sh index 2825819d4268..59f9eb3a1801 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/bash/shared.sh +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/bash/shared.sh @@ -9,6 +9,11 @@ if grep -x '^{{{line}}}$' /etc/sudoers.d/*; then fi {{%- endmacro %}} +{{% if product in [ 'sle16', 'slmicro6'] %}} +{{{ bash_copy_distro_defaults("/usr/etc/sudoers", "/etc/sudoers") }}} +{{{ lineinfile_absent("/etc/sudoers", "^\s*@includedir\s*/usr/etc/sudoers\.d", sed_path_separator="#", rule_id=rule_id) }}} +{{% endif %}} + {{{- delete_line_in_sudoers_d("Defaults targetpw") }}} {{{- delete_line_in_sudoers_d("Defaults rootpw") }}} {{{- delete_line_in_sudoers_d("Defaults runaspw") }}} diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/oval/shared.xml b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/oval/shared.xml index 3cb57c53f929..9f7d07f4579a 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/oval/shared.xml +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/oval/shared.xml @@ -8,9 +8,19 @@ + {{% if product in [ 'sle16', 'slmicro6' ] %}} + + {{% endif %}} + {{% if product in [ 'sle16', 'slmicro6' ] %}} + {{{ oval_config_file_exists_test('/etc/sudoers', rule_id=rule_id) }}} + {{{ oval_config_file_exists_object('/etc/sudoers', rule_id=rule_id) }}} + {{% endif %}} + diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_d_duplicate.pass.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_d_duplicate.pass.sh index e2db331bdac8..160b7b06ab3d 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_d_duplicate.pass.sh +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_d_duplicate.pass.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15,multi_platform_slmicro,multi_platform_almalinux +# platform = SUSE Linux Enterprise 15,multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_opensuse,multi_platform_rhel,multi_platform_slmicro # packages = sudo echo 'Defaults !targetpw' >> /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_conflicting_values.fail.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_conflicting_values.fail.sh index 6e9d5c094f1b..a6a0ba3d6f09 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_conflicting_values.fail.sh +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_conflicting_values.fail.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15,multi_platform_slmicro,multi_platform_almalinux +# platform = SUSE Linux Enterprise 15,multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_opensuse,multi_platform_rhel,multi_platform_slmicro # packages = sudo echo 'Defaults !targetpw' >> /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.fail.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.fail.sh index 75c6ad83ce81..7e5981e3f9fc 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.fail.sh +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.fail.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = SUSE Linux Enterprise 15,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_slmicro,multi_platform_almalinux +# platform = SUSE Linux Enterprise 15,multi_platform_fedora,multi_platform_ol,multi_platform_opensuse,multi_platform_rhel,multi_platform_slmicro,multi_platform_almalinux # packages = sudo echo 'Defaults !targetpw' >> /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.pass.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.pass.sh index 80d19430c551..66cb88e1e486 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.pass.sh +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_duplicates.pass.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15,multi_platform_slmicro,multi_platform_almalinux +# platform = SUSE Linux Enterprise 15,multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_opensuse,multi_platform_rhel,multi_platform_slmicro # packages = sudo echo 'Defaults !targetpw' >> /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_multiple_files.pass.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_multiple_files.pass.sh index 598f9988f0fd..b35dcf4b39ed 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_multiple_files.pass.sh +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_passwd_multiple_files.pass.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15,multi_platform_slmicro,multi_platform_almalinux +# platform = SUSE Linux Enterprise 15,multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_opensuse,multi_platform_rhel,multi_platform_slmicro # packages = sudo echo 'Defaults !targetpw' >> /etc/sudoers diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_runaspw.fail.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_runaspw.fail.sh index c82588545e30..a5473c7114a2 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_runaspw.fail.sh +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_runaspw.fail.sh @@ -1,5 +1,5 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15,multi_platform_slmicro,multi_platform_almalinux +# platform = SUSE Linux Enterprise 15,multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_opensuse,multi_platform_rhel,multi_platform_slmicro # packages = sudo touch /etc/sudoers.d/empty diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_targetpw.fail.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_targetpw.fail.sh index 7c3fb4233dbe..e83518458820 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_targetpw.fail.sh +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_targetpw.fail.sh @@ -1,6 +1,6 @@ #!/bin/bash -# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15,multi_platform_slmicro,multi_platform_almalinux -# packages = sudo +# platform = SUSE Linux Enterprise 15,multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_opensuse,multi_platform_rhel,multi_platform_slmicro +# # packages = sudo touch /etc/sudoers.d/empty if [ $(grep -Ei '(!targetpw)' /etc/sudoers /etc/sudoers.d/* | grep -v '#' | wc -l) -ne 0 ] From f84340602224cfc62217d5675287d8a26d0706f8 Mon Sep 17 00:00:00 2001 From: teacup-on-rockingchair <315160+teacup-on-rockingchair@users.noreply.github.com> Date: Sun, 20 Sep 2026 19:02:05 +0300 Subject: [PATCH 2/2] Fix packages field syntax --- .../tests/sudoers_validate_targetpw.fail.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_targetpw.fail.sh b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_targetpw.fail.sh index e83518458820..51f8e8fceff4 100644 --- a/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_targetpw.fail.sh +++ b/linux_os/guide/system/software/sudo/sudoers_validate_passwd/tests/sudoers_validate_targetpw.fail.sh @@ -1,6 +1,6 @@ #!/bin/bash # platform = SUSE Linux Enterprise 15,multi_platform_almalinux,multi_platform_fedora,multi_platform_ol,multi_platform_opensuse,multi_platform_rhel,multi_platform_slmicro -# # packages = sudo +# packages = sudo touch /etc/sudoers.d/empty if [ $(grep -Ei '(!targetpw)' /etc/sudoers /etc/sudoers.d/* | grep -v '#' | wc -l) -ne 0 ]