>From 7450369eaaa2f6cf1c4581454653eefcb19f3e52 Mon Sep 17 00:00:00 2001 From: Shawn Wells Date: Sat, 28 Sep 2013 15:37:15 -0400 Subject: [PATCH 5/8] New OVAL: file_permissions_binary_dirs - net-new OVAL, though based off file_permissions_libary* - Added remediation script - Mapped XCCDF to OVAL - OVAL signoff --- .../input/checks/file_permissions_binary_dirs.xml | 115 ++++++++++++++++++++ .../fixes/bash/file_permissions_binary_dirs.sh | 4 + RHEL6/input/system/permissions/files.xml | 1 + 3 files changed, 120 insertions(+), 0 deletions(-) create mode 100644 RHEL6/input/checks/file_permissions_binary_dirs.xml create mode 100644 RHEL6/input/fixes/bash/file_permissions_binary_dirs.sh diff --git a/RHEL6/input/checks/file_permissions_binary_dirs.xml b/RHEL6/input/checks/file_permissions_binary_dirs.xml new file mode 100644 index 0000000..1b16414 --- /dev/null +++ b/RHEL6/input/checks/file_permissions_binary_dirs.xml @@ -0,0 +1,115 @@ + + + + Verify that System Executables Have Restrictive Permissions + + Red Hat Enterprise Linux 6 + + Checks that /bin, /usr/bin, /usr/local/bin, /sbin, /usr/sbin, /usr/local/sbin, and objects therein, + are not group-writable or world-writable. + + + + + + + + + + + + + + + + + + + + /bin + ^.*$ + state_perms_nogroupwrite_noworldwrite + state_symlink + + + + + + + + + + + /usr/bin + ^.*$ + state_perms_nogroupwrite_noworldwrite + state_symlink + + + + + + + + + + + /usr/local/bin + ^.*$ + state_perms_nogroupwrite_noworldwrite + state_symlink + + + + + + + + + + + /sbin + ^.*$ + state_perms_nogroupwrite_noworldwrite + state_symlink + + + + + + + + + + + /usr/sbin + ^.*$ + state_perms_nogroupwrite_noworldwrite + state_symlink + + + + + + + + + + + /usr/local/sbin + ^.*$ + state_perms_nogroupwrite_noworldwrite + state_symlink + + + + + symbolic link + + + + true + true + + + diff --git a/RHEL6/input/fixes/bash/file_permissions_binary_dirs.sh b/RHEL6/input/fixes/bash/file_permissions_binary_dirs.sh new file mode 100644 index 0000000..8eeca3e --- /dev/null +++ b/RHEL6/input/fixes/bash/file_permissions_binary_dirs.sh @@ -0,0 +1,4 @@ +DIRS="/bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin" +for dirPath in $DIRS; do + find $dirPath -perm /022 -exec chmod go-w '{}' \; +done diff --git a/RHEL6/input/system/permissions/files.xml b/RHEL6/input/system/permissions/files.xml index 5a4f616..7d4add9 100644 --- a/RHEL6/input/system/permissions/files.xml +++ b/RHEL6/input/system/permissions/files.xml @@ -291,6 +291,7 @@ and restrictive permissions are necessary to ensure execution of these programs cannot be co-opted. + -- 1.7.1