Skip to content

Commit 34effa6

Browse files
committed
Ensure dot files permissions are 0740 or less.
Update description of those rules to improve the remediation that only removes the undesired bits of the permissions, otherwise any offending file would be set to 0740, no matter which of the offending bits it had. This way it preserves the permissions the file previously had and removes the offending bits only.
1 parent 4485e06 commit 34effa6

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

  • linux_os/guide/system/accounts/accounts-session
    • file_permission_user_init_files_root
    • file_permission_user_init_files

linux_os/guide/system/accounts/accounts-session/file_permission_user_init_files/rule.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ documentation_complete: true
44
title: 'Ensure All User Initialization Files Have Mode 0740 Or Less Permissive'
55

66
description: |-
7-
Set the mode of the user initialization files to <tt>0740</tt> with the
7+
Set the mode of the user initialization files to <tt>0740</tt> or less permissisive with the
88
following command:
9-
<pre>$ sudo chmod 0740 /home/<i>USER</i>/.<i>INIT_FILE</i></pre>
9+
<pre>$ sudo chmod u-s,g-wxs,o= /home/<i>USER</i>/.<i>INIT_FILE</i></pre>
1010
1111
rationale: |-
1212
Local initialization files are used to configure the user's shell environment
@@ -41,10 +41,10 @@ ocil: |-
4141
There should be no output.
4242
4343
fixtext: |-
44-
Set the mode of the local initialization files to "0740" with the following command:
44+
Set the mode of the local initialization files to "0740" or less permissive with the following command:
4545
4646
Note: The example will be for the smithj user, who has a home directory of "/home/smithj".
4747
48-
$ sudo chmod 0740 /home/smithj/.
48+
$ sudo chmod u-s,g-wxs,o= /home/smithj/.<i>INIT_FILE</i>
4949
5050
srg_requirement: 'All {{{ full_name }}} local initialization files must have mode 0740 or less permissive.'

linux_os/guide/system/accounts/accounts-session/file_permission_user_init_files_root/rule.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ title: 'Ensure All User Initialization Files Have Mode 0740 Or Less Permissive'
44

55
description: |-
66
Set the mode of the user initialization files, including the <tt>root</tt> user,
7-
to <tt>0740</tt> with the following commands:
7+
to <tt>0740</tt> or less permissisive with the following commands:
88
<pre>
9-
$ sudo chmod 0740 /root/.<i>INIT_FILE</i>
10-
$ sudo chmod 0740 /home/<i>USER</i>/.<i>INIT_FILE</i>
9+
$ sudo chmod u-s,g-wxs,o= /root/.<i>INIT_FILE</i>
10+
$ sudo chmod u-s,g-wxs,o= /home/<i>USER</i>/.<i>INIT_FILE</i>
1111
</pre>
1212
1313
rationale: |-
@@ -34,10 +34,10 @@ ocil: |-
3434
There should be no output.
3535
3636
fixtext: |-
37-
Set the mode of the local initialization files to "0740" with the following command:
37+
Set the mode of the local initialization files to "0740" or less permissive with the following command:
3838
3939
Note: The example will be for the smithj user, who has a home directory of "/home/smithj".
4040
41-
$ sudo chmod 0740 /home/smithj/.
41+
$ sudo chmod u-s,g-wxs,o= /home/smithj/.<i>INIT_FILE</i>
4242
4343
srg_requirement: 'All {{{ full_name }}} local initialization files must have mode 0740 or less permissive.'

0 commit comments

Comments
 (0)