4.1.2.5 Ensure access to /etc/security is configured

Information

The /etc/security directory contains multiple files and directories used to keep the targeted AIX system secure.Most subsystems are owned by root:security (UID:GID). However, additional systems such as AUDIT and AIXPERT have their own permissions (and recommendations).

Traditionally, /etc/security has been identified as USER administration - including the shadow password file. But there is much more under /etc/security. Normal installations also have configuration files for security subsystems including: aixpert tsd ice ldap rbac audit ipsec fpm and trusted computing (tscd)

While these subsystems may not be enabled - their configuration files need to be secured to ensure no unauthorized access.

The /etc/security directory contains sensitive files for multiple security systems. For the USER subsystem there are files such as /etc/security/passwd /etc/security/user that must be secured from unauthorized access and modification.

Solution

Ensure correct access control settings for security subsystem configuration files installed in /etc/security :

#!/usr/bin/ksh -e
# security_subsys:4.8.1.5
# Provided to CIS by AIXTools
# Copyright AIXTools, 2022

EXCLUDE="security/(aixpert|audit|ice)"

find /etc/security -type d |
/usr/bin/egrep -v ${EXCLUDE} |
/usr/bin/sort | xargs ls -led |
/usr/bin/awk '{print $1 " " $3 " " $4 " " $9}' |
/usr/bin/grep -v drwxr-s---- |
awk '{print $NF}' | while read SECDIR; do
find ${SECDIR} | grep -v ${EXCLUDE} | xargs chown root:security
find ${SECDIR} -type d | grep -v ${EXCLUDE} | xargs chmod g-w,o-rwx
find ${SECDIR} -type f | grep -v ${EXCLUDE} | xargs chmod u-x,g-wx,o-rwx
done

See Also

https://workbench.cisecurity.org/benchmarks/10385

Item Details

Category: ACCESS CONTROL, MEDIA PROTECTION

References: 800-53|AC-3, 800-53|AC-5, 800-53|AC-6, 800-53|MP-2, CSCv7|14.6

Plugin: Unix

Control ID: f141b31153714876034fb575438d150a4ad642b31c9bd5c2199233313508bf50