Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STIG Alignment for RHEL-08-020352 #9816

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
cmd: |
for dir in $(awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != 65534) print $6}' /etc/passwd); do
for file in $(find $dir -maxdepth 1 -type f -name ".*"); do
sed -i 's/^\([\s]*umask\s*\)/#\1/g' $file
if [ "$(basename $file)" != ".bash_history" ]; then
sed -i 's/^\([\s]*umask\s*\)/#\1/g' $file
fi
done
done
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

{{% call iterate_over_command_output("dir", "awk -F':' '{ if ($3 >= " ~ uid_min ~ " && $3 != 65534) print $6}' /etc/passwd") -%}}
{{% call iterate_over_find_output("file", '$dir -maxdepth 1 -type f -name ".*"') -%}}
sed -i 's/^\([\s]*umask\s*\)/#\1/g' "$file"
if [ "$(basename $file)" != ".bash_history" ]; then
sed -i 's/^\([\s]*umask\s*\)/#\1/g' "$file"
fi
{{%- endcall %}}
{{%- endcall %}}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@
<ind:filename operation="pattern match">^\..*</ind:filename>
<ind:pattern operation="pattern match">^[\s]*umask\s*</ind:pattern>
<ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
<filter action="exclude">state_accounts_umask_interactive_users_bash_history</filter>
</ind:textfilecontent54_object>

<ind:textfilecontent54_state id="state_accounts_umask_interactive_users_bash_history"
version="1">
<ind:filename operation="pattern match">^\.bash_history</ind:filename>
</ind:textfilecontent54_state>

<!-- #### creation of test #### -->
<ind:textfilecontent54_test id="test_accounts_umask_interactive_users" check="all"
check_existence="none_exist" version="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ checktext: |-

Note: The example is for a system that is configured to create users home directories in the "/home" directory.

# grep -ri umask /home/
$ sudo grep -ir ^umask --exclude=.bash_history /home

/home/smithj/.bash_history:grep -i umask /etc/bashrc /etc/csh.cshrc /etc/profile
/home/smithj/.bash_history:grep -i umask /etc/login.defs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

USER="cac_user"
useradd -m $USER
echo "umask 022" > /home/$USER/.bash_history