-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12524 from svet-se/slmicro5-stig-add-rule-account…
…s_tmout Add rule accounts_tmout to SLE Micro 5 STIG profile
- Loading branch information
Showing
7 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
linux_os/guide/system/accounts/accounts-session/accounts_tmout/ansible/slmicro5.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# platform = multi_platform_slmicro | ||
# reboot = false | ||
# strategy = restrict | ||
# complexity = low | ||
# disruption = low | ||
{{{ ansible_instantiate_variables("var_accounts_tmout") }}} | ||
|
||
{{{ ansible_set_config_file(file='/etc/profile.d/autologout.sh', parameter='TMOUT', separator='=', separator_regex='=', value='{{ var_accounts_tmout }}', create='yes') }}} | ||
{{{ ansible_set_config_file(file='/etc/profile.d/autologout.sh', parameter='readonly', separator=' ', value='TMOUT', create='yes') }}} | ||
{{{ ansible_set_config_file(file='/etc/profile.d/autologout.sh', parameter='export', separator=' ', value='TMOUT', create='yes') }}} | ||
|
||
- name: Set the permission for /etc/profile.d/autologout.sh | ||
file: | ||
path: /etc/profile.d/autologout.sh | ||
mode: '0755' | ||
when: lookup('ansible.builtin.file', '/etc/profile.d/autologout.sh', errors='warn') |
20 changes: 20 additions & 0 deletions
20
linux_os/guide/system/accounts/accounts-session/accounts_tmout/bash/slmicro5.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# platform = multi_platform_slmicro | ||
|
||
{{{ bash_instantiate_variables("var_accounts_tmout") }}} | ||
|
||
if [ -f /etc/profile.d/autologout.sh ]; then | ||
if grep --silent '^\s*TMOUT' /etc/profile.d/autologout.sh ; then | ||
sed -i -E "s/^(\s*)TMOUT\s*=\s*(\w|\$)*(.*)$/\1TMOUT=$var_accounts_tmout\3/g" /etc/profile.d/autologout.sh | ||
fi | ||
else | ||
echo -e "\n# Set TMOUT to $var_accounts_tmout per security requirements" >> /etc/profile.d/autologout.sh | ||
echo "TMOUT=$var_accounts_tmout" >> /etc/profile.d/autologout.sh | ||
fi | ||
if ! grep --silent '^\s*readonly TMOUT' /etc/profile.d/autologout.sh ; then | ||
echo "readonly TMOUT" >> /etc/profile.d/autologout.sh | ||
fi | ||
|
||
if ! grep --silent '^\s*export TMOUT' /etc/profile.d/autologout.sh ; then | ||
echo "export TMOUT" >> /etc/profile.d/autologout.sh | ||
fi | ||
chmod +x /etc/profile.d/autologout.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ CCE-93743-3 | |
CCE-93757-3 | ||
CCE-93777-1 | ||
CCE-93783-9 | ||
CCE-93805-0 | ||
CCE-93806-8 | ||
CCE-93807-6 | ||
CCE-93808-4 | ||
|