-
Notifications
You must be signed in to change notification settings - Fork 14
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 #473 from ferricoxide/Issue_471
Add handler to set `StopIdleSessionSec` to STIG-Mandated Value
- Loading branch information
Showing
3 changed files
with
89 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Ref Doc: STIG - RHEL 8 v1r12 | ||
# Finding ID: V-257258 | ||
# Rule ID: SV-257258r917891_rule | ||
# STIG ID: RHEL-08-020035 | ||
# SRG ID: SRG-OS-000163-GPOS-00072 | ||
# | ||
# Finding Level: medium | ||
# | ||
# Rule Summary: | ||
# The Operating System must terminate idle user sessions | ||
# | ||
# References: | ||
# CCI: | ||
# - CCI-001133 | ||
# NIST SP 800-53 :: SC-10 | ||
# NIST SP 800-53A :: SC-10.1 (ii) | ||
# NIST SP 800-53 Revision 4 :: SC-10 | ||
# | ||
########################################################################### | ||
{%- set stig_id = 'RHEL-08-020035' %} | ||
{%- set helperLoc = 'ash-linux/el8/STIGbyID/cat2/files' %} | ||
{%- set skipIt = salt.pillar.get('ash-linux:lookup:skip-stigs', []) %} | ||
{%- set cfgFile = '/etc/systemd/logind.conf' %} | ||
{%- set cfgParm = 'StopIdleSessionSec' %} | ||
{%- set cfgValu = '900' %} | ||
{%- set svcName = 'systemd-logind' %} | ||
|
||
script_{{ stig_id }}-describe: | ||
cmd.script: | ||
- source: salt://{{ helperLoc }}/{{ stig_id }}.sh | ||
- cwd: /root | ||
|
||
{%- if stig_id in skipIt %} | ||
notify_{{ stig_id }}-skipSet: | ||
cmd.run: | ||
- name: 'printf "\nchanged=no comment=''Handler for {{ stig_id }} has been selected for skip.''\n"' | ||
- stateful: True | ||
- cwd: /root | ||
{%- else %} | ||
Set logind idle-session termination timeout: | ||
file.replace: | ||
- name: '{{ cfgFile }}' | ||
- append_if_not_found: True | ||
- not_found_content: |- | ||
# Inserted per {{ stig_id }} | ||
{{ cfgParm }}={{ cfgValu }} | ||
- pattern: '^(|#)\s*({{ cfgParm }}).*' | ||
- repl: '\g<2>={{ cfgValu }}' | ||
|
||
service_{{ stig_id }}-{{ cfgFile }}: | ||
service.running: | ||
- name: '{{ svcName }}' | ||
- enable: True | ||
- watch: | ||
- file: 'Set logind idle-session termination timeout' | ||
{%- endif %} |
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,31 @@ | ||
#!/bin/bash | ||
# | ||
# Ref Doc: STIG - RHEL 8 v1r12 | ||
# Finding ID: V-257258 | ||
# Rule ID: SV-257258r917891_rule | ||
# STIG ID: RHEL-08-020035 | ||
# SRG ID: SRG-OS-000163-GPOS-00072 | ||
# | ||
# Finding Level: medium | ||
# | ||
# Rule Summary: | ||
# The Operating System must terminate idle user sessions | ||
# | ||
# References: | ||
# CCI: | ||
# - CCI-001133 | ||
# NIST SP 800-53 :: SC-10 | ||
# NIST SP 800-53A :: SC-10.1 (ii) | ||
# NIST SP 800-53 Revision 4 :: SC-10 | ||
# | ||
########################################################################### | ||
# Standard outputter function | ||
diag_out() { | ||
echo "${1}" | ||
} | ||
|
||
diag_out "--------------------------------------" | ||
diag_out "STIG Finding ID: V-257258" | ||
diag_out " The OS must terminate idle user" | ||
diag_out " sessions" | ||
diag_out "--------------------------------------" |
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