>From fbf5ca521134803457f78f7e79ff84d7f00ac36a Mon Sep 17 00:00:00 2001 From: Shawn Wells Date: Sun, 10 Nov 2013 02:36:25 -0500 Subject: [PATCH 09/11] Updated OVAL + remediation for accounts_umask_login_defs - XCCDF naming update - OVAL filename->filepath - Added remediation TESTING: [root@SSG-RHEL6 checks]# ./testcheck.py accounts_umask_login_defs.xml external_variable with id : var_accounts_user_umask Evaluating with OVAL tempfile : /tmp/accounts_umask_login_defsTNp_or.xml Writing results to : /tmp/accounts_umask_login_defsTNp_or.xml-results Definition oval:scap-security-guide.testing:def:293: false Evaluation done. [root@SSG-RHEL6 checks]# cd ../fixes/bash/ [root@SSG-RHEL6 bash]# bash accounts_umask_login_defs.sh [root@SSG-RHEL6 bash]# cd - /var/www/html/scap-security-guide/RHEL6/input/checks [root@SSG-RHEL6 checks]# ./testcheck.py accounts_umask_login_defs.xml external_variable with id : var_accounts_user_umask Evaluating with OVAL tempfile : /tmp/accounts_umask_login_defsQf6R3R.xml Writing results to : /tmp/accounts_umask_login_defsQf6R3R.xml-results Definition oval:scap-security-guide.testing:def:293: true Evaluation done. --- RHEL6/input/checks/accounts_umask_login_defs.xml | 3 +-- .../input/fixes/bash/accounts_umask_login_defs.sh | 8 ++++++++ RHEL6/input/profiles/CS2.xml | 2 +- RHEL6/input/profiles/stig-rhel6-server.xml | 2 +- RHEL6/input/profiles/test.xml | 2 +- RHEL6/input/profiles/usgcb-rhel6-server.xml | 2 +- RHEL6/input/system/accounts/session.xml | 2 +- 7 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 RHEL6/input/fixes/bash/accounts_umask_login_defs.sh diff --git a/RHEL6/input/checks/accounts_umask_login_defs.xml b/RHEL6/input/checks/accounts_umask_login_defs.xml index 28f707e..b8552dc 100644 --- a/RHEL6/input/checks/accounts_umask_login_defs.xml +++ b/RHEL6/input/checks/accounts_umask_login_defs.xml @@ -25,8 +25,7 @@ - /etc - login.defs + /etc/login.defs ^[\s]*UMASK[\s]+([^#\s]*) 1 diff --git a/RHEL6/input/fixes/bash/accounts_umask_login_defs.sh b/RHEL6/input/fixes/bash/accounts_umask_login_defs.sh new file mode 100644 index 0000000..20574ff --- /dev/null +++ b/RHEL6/input/fixes/bash/accounts_umask_login_defs.sh @@ -0,0 +1,8 @@ +source ./templates/support.sh +populate var_accounts_user_umask + +grep -q UMASK /etc/login.defs && \ + sed -i "s/UMASK.*/UMASK $var_accounts_user_umask/g" /etc/login.defs +if ! [ $? -eq 0 ]; then + echo "UMASK $var_accounts_user_umask" >> /etc/login.defs +fi diff --git a/RHEL6/input/profiles/CS2.xml b/RHEL6/input/profiles/CS2.xml index 171f701..83b90c6 100644 --- a/RHEL6/input/profiles/CS2.xml +++ b/RHEL6/input/profiles/CS2.xml @@ -85,7 +85,7 @@ + - - -