Skip to content

Commit f770821

Browse files
Merge pull request #14630 from jan-cerny/hummingbird_umask
Add rule accounts_umask_etc_bashrc and accounts_umask_etc_profile to Hummingbird
2 parents 8a582ef + 81e4ed5 commit f770821

File tree

10 files changed

+48
-5
lines changed

10 files changed

+48
-5
lines changed

components/tcsh.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: tcsh
2+
packages:
3+
- tcsh
4+
rules:
5+
- accounts_umask_etc_csh_cshrc
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# platform = multi_platform_all
2+
3+
{{{ bash_instantiate_variables("var_accounts_user_umask") }}}
4+
5+
if grep -q "^[^#]*\bumask" "$NEWROOT/etc/bashrc" ; then
6+
sed -i -E -e "s/^([^#]*\bumask)[[:space:]]+[[:digit:]]+/\1 $var_accounts_user_umask/g" "$NEWROOT/etc/bashrc"
7+
else
8+
echo "umask $var_accounts_user_umask" >> "$NEWROOT/etc/bashrc"
9+
fi

linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_csh_cshrc/rule.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,5 @@ fixtext: |-
6262
umask {{{ xccdf_value("var_accounts_user_umask") }}}
6363
6464
srg_requirement: '{{{ full_name }}} must define default permissions for the c shell.'
65+
66+
platform: package[tcsh]

linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_etc_login_defs/rule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ocil: |-
5050
5151
UMASK {{{ xccdf_value("var_accounts_user_umask") }}}</pre>
5252
53-
platform: package[shadow-utils]
53+
platform: package[shadow-utils] and system_with_kernel
5454

5555
checktext: |-
5656
Verify {{{ full_name }}} defines default permissions for all authenticated users in such a way that the user can only read and modify their own files with the following command:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# platform = multi_platform_all
2+
# reboot = false
3+
# strategy = restrict
4+
# complexity = low
5+
# disruption = low
6+
7+
{{{ bash_instantiate_variables("var_accounts_user_umask") }}}
8+
9+
readarray -t profile_files < <(find $NEWROOT/etc/profile.d/ -type f -name '*.sh' -or -name 'sh.local')
10+
11+
for file in "${profile_files[@]}" $NEWROOT/etc/profile; do
12+
grep -qE '^[^#]*umask' "$file" && sed -i -E "s/^(\s*umask\s*)[0-7]+/\1$var_accounts_user_umask/g" "$file"
13+
done
14+
15+
if ! grep -qrE '^[^#]*umask' $NEWROOT/etc/profile*; then
16+
echo "umask $var_accounts_user_umask" >> $NEWROOT/etc/profile
17+
fi

linux_os/guide/system/accounts/accounts-session/user_umask/accounts_umask_interactive_users/rule.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ fixtext: |-
4747
If the account is for an application, the requirement for a umask less restrictive than "077" can be documented with the Information System Security Officer, but the user agreement for access to the account must specify that the local interactive user must log on to their account first and then switch the user to the application account with the correct option to gain the account's environment variables.
4848
4949
srg_requirement: '{{{ full_name }}} must set the umask value to 077 for all local interactive user accounts.'
50+
51+
platform: system_with_kernel

linux_os/guide/system/accounts/accounts-session/user_umask/group.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ description: |-
1818
easy to intentionally share files with groups of which the user is
1919
a member.
2020
<br /><br />
21-
22-
platform: system_with_kernel

products/hummingbird/controls/cis_hummingbird.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,11 @@ controls:
16821682
levels:
16831683
- l1_server
16841684
- l1_workstation
1685-
status: not applicable
1685+
status: automated
1686+
rules:
1687+
- accounts_umask_etc_bashrc
1688+
- accounts_umask_etc_profile
1689+
- var_accounts_user_umask=027
16861690

16871691
- id: 6.1.1
16881692
title: Ensure AIDE is installed (Automated)

products/hummingbird/controls/stig_hummingbird.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,11 @@ controls:
12091209
levels:
12101210
- medium
12111211
title: 'Red Hat Hummingbird must limit the ability of non-privileged users to grant other users direct access to the contents of their home directories/folders.'
1212-
status: does not meet
1212+
status: automated
1213+
rules:
1214+
- accounts_umask_etc_bashrc
1215+
- accounts_umask_etc_profile
1216+
- var_accounts_user_umask=027
12131217

12141218
- id: SRG-OS-000590-GPOS-00110
12151219
levels:

shared/applicability/package.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,5 @@ args:
172172
pkgname: rsyslog
173173
rootfiles:
174174
pkgname: rootfiles
175+
tcsh:
176+
pkgname: tcsh

0 commit comments

Comments
 (0)