diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/ansible/shared.yml index 730c17f84f8..35128171c14 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/ansible/shared.yml +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/ansible/shared.yml @@ -5,7 +5,7 @@ # disruption = low {{{ ansible_instantiate_variables("var_accounts_user_umask") }}} -{{% if 'sle' in product or 'ubuntu' in product %}} +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} {{% set etc_bash_rc = "/etc/bash.bashrc" %}} {{% else %}} {{% set etc_bash_rc = "/etc/bashrc" %}} diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/bash/shared.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/bash/shared.sh index fe551efc156..3daeddd696d 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/bash/shared.sh +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/bash/shared.sh @@ -2,7 +2,7 @@ {{{ bash_instantiate_variables("var_accounts_user_umask") }}} -{{% if 'sle' in product or 'ubuntu' in product %}} +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} {{% set etc_bash_rc = "/etc/bash.bashrc" %}} {{% else %}} {{% set etc_bash_rc = "/etc/bashrc" %}} diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/oval/shared.xml b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/oval/shared.xml index bf610a8714f..dcb601eb30c 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/oval/shared.xml +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/oval/shared.xml @@ -1,4 +1,4 @@ -{{% if 'sle' in product or 'ubuntu' in product %}} +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} {{% set etc_bash_rc = "/etc/bash.bashrc" %}} {{% else %}} {{% set etc_bash_rc = "/etc/bashrc" %}} diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/rule.yml b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/rule.yml index e744bbb7cb4..f94449e092d 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/rule.yml +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/rule.yml @@ -3,7 +3,7 @@ documentation_complete: true title: 'Ensure the Default Bash Umask is Set Correctly' -{{% if 'sle' in product %}} +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} {{% set etc_bash_rc = "/etc/bash.bashrc" %}} {{% else %}} {{% set etc_bash_rc = "/etc/bashrc" %}} diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/missing.fail.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/missing.fail.sh index fae51a4c152..2a8fd6091e2 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/missing.fail.sh +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/missing.fail.sh @@ -1,7 +1,7 @@ #!/bin/bash # packages = bash -{{% if 'sle' in product or 'ubuntu' in product %}} +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} etc_bash_rc="/etc/bash.bashrc" {{% else %}} etc_bash_rc="/etc/bashrc" diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/ospp_cis_correct.pass.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/ospp_cis_correct.pass.sh index ca5e4620c17..a199eb4e0dd 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/ospp_cis_correct.pass.sh +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/ospp_cis_correct.pass.sh @@ -2,7 +2,7 @@ # profiles = xccdf_org.ssgproject.content_profile_cis, xccdf_org.ssgproject.content_profile_ospp # packages = bash -{{% if 'sle' in product or 'ubuntu' in product %}} +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} etc_bash_rc="/etc/bash.bashrc" {{% else %}} etc_bash_rc="/etc/bashrc" diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/super_compliant.pass.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/super_compliant.pass.sh index 0132769ef24..2780838e364 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/super_compliant.pass.sh +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/super_compliant.pass.sh @@ -1,7 +1,7 @@ #!/bin/bash # packages = bash -{{% if 'sle' in product or 'ubuntu' in product %}} +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} etc_bash_rc="/etc/bash.bashrc" {{% else %}} etc_bash_rc="/etc/bashrc" diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong.fail.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong.fail.sh index d2de70e6b6a..8f504f2cc59 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong.fail.sh +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong.fail.sh @@ -1,6 +1,13 @@ #!/bin/bash # packages = bash -sed -i '/umask/d' /etc/bashrc -echo "umask 000" >> /etc/bashrc +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} +etc_bash_rc="/etc/bash.bashrc" +{{% else %}} +etc_bash_rc="/etc/bashrc" +{{% endif %}} + + +sed -i '/umask/d' $etc_bash_rc +echo "umask 000" >> $etc_bash_rc umask 000 diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_and_mangled_and_not_at_the_begining_of_line.fail.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_and_mangled_and_not_at_the_begining_of_line.fail.sh index e129a6ca988..1f7fe8618d4 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_and_mangled_and_not_at_the_begining_of_line.fail.sh +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_and_mangled_and_not_at_the_begining_of_line.fail.sh @@ -3,6 +3,12 @@ # This TS is a regression test for https://github.com/ComplianceAsCode/content/issues/11937 +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} +etc_bash_rc="/etc/bash.bashrc" +{{% else %}} +etc_bash_rc="/etc/bashrc" +{{% endif %}} + sed -i '/umask/d' /etc/bashrc -echo " [ \`umask\` -eq 0 ] && umask 027022" >> /etc/bashrc +echo " [ \`umask\` -eq 0 ] && umask 027022" >> $etc_bash_rc umask 000 diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_and_not_at_the_begining_of_line.fail.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_and_not_at_the_begining_of_line.fail.sh index bbe2c3db1ce..0409731f019 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_and_not_at_the_begining_of_line.fail.sh +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_and_not_at_the_begining_of_line.fail.sh @@ -1,6 +1,13 @@ #!/bin/bash # packages = bash -sed -i '/umask/d' /etc/bashrc -echo " [ \`umask\` -eq 0 ] && umask 022" >> /etc/bashrc +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} +etc_bash_rc="/etc/bash.bashrc" +{{% else %}} +etc_bash_rc="/etc/bashrc" +{{% endif %}} + + +sed -i '/umask/d' $etc_bash_rc +echo " [ \`umask\` -eq 0 ] && umask 022" >> $etc_bash_rc umask 000 diff --git a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_multiple.fail.sh b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_multiple.fail.sh index de908b20b3a..1b4d00cc868 100644 --- a/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_multiple.fail.sh +++ b/linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_bashrc/tests/wrong_multiple.fail.sh @@ -1,8 +1,15 @@ #!/bin/bash # packages = bash -sed -i '/umask/d' /etc/bashrc -echo "umask 000" >> /etc/bashrc -echo "umask 000" >> /etc/bashrc -echo "umask 000" >> /etc/bashrc +{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}} +etc_bash_rc="/etc/bash.bashrc" +{{% else %}} +etc_bash_rc="/etc/bashrc" +{{% endif %}} + + +sed -i '/umask/d' $etc_bash_rc +echo "umask 000" >> $etc_bash_rc +echo "umask 000" >> $etc_bash_rc +echo "umask 000" >> $etc_bash_rc umask 000