Skip to content

Commit

Permalink
Merge pull request #12929 from vojtapolasek/umask_interactive_users_l…
Browse files Browse the repository at this point in the history
…imit_depth

Umask interactive users limit depth
  • Loading branch information
Mab879 authored Jan 29, 2025
2 parents 1bd83d3 + d0f6923 commit d7e934c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<!-- #### creation of object #### -->
<ind:textfilecontent54_object id="object_accounts_umask_interactive_users"
comment="Umask value from initialization files" version="1">
<ind:behaviors max_depth="0" recurse_direction="down" />
<ind:path var_ref="var_accounts_umask_interactive_users_dirs" var_check="at least one"/>
<ind:filename operation="pattern match">^\..*</ind:filename>
<ind:pattern operation="pattern match">^[\s]*umask\s*</ind:pattern>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ checktext: |-
Note: The example is for a system that is configured to create users home directories in the "/home" directory.
$ sudo grep -ir umask /home
$ sudo find /home -maxdepth 2 -type f -name ".[^.]*" -exec grep -iH -d skip --exclude=.bash_history umask {} \;
/home/smithj/.bash_history:grep -i umask /etc/bashrc /etc/csh.cshrc /etc/profile
/home/smithj/.bash_history:grep -i umask /etc/login.defs
/home/wadea/.bash_history:grep -i umask /etc/bashrc /etc/csh.cshrc /etc/profile
/home/wadea/.bash_history:grep -i umask /etc/login.defs
If any local interactive user initialization files are found to have a umask statement that sets a value less restrictive than "077", this is a finding.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ ocil: |-
Note: The example is for a system that is configured to create users home directories in the "/home" directory.
# grep -ri umask /home/
$ sudo find /home -maxdepth 2 -type f -name ".[^.]*" -exec grep -iH -d skip --exclude=.bash_history umask {} \;
/home/smithj/.bash_history:grep -i umask /etc/bashrc /etc/csh.cshrc /etc/profile
/home/smithj/.bash_history:grep -i umask /etc/login.defs
/home/wadea/.bash_history:grep -i umask /etc/bashrc /etc/csh.cshrc /etc/profile
/home/wadea/.bash_history:grep -i umask /etc/login.defs
fixtext: |-
Remove the umask statement from all local interactive user's initialization files.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

USER="cac_user"
useradd -m $USER
mkdir -p /home/"${USER}"/folder
echo "umask 022" > /home/"${USER}"/folder/.bashrc

0 comments on commit d7e934c

Please sign in to comment.