Skip to content

Commit 1a97c6c

Browse files
new feautre tmout in a new pr (#516)
Signed-off-by: Ludwig Bayerlein <[email protected]> Co-authored-by: Ludwig Bayerlein <[email protected]>
1 parent 73d319c commit 1a97c6c

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

roles/os_hardening/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ We know that this is the case on Raspberry Pi.
250250
- `os_profile_enabled`
251251
- Default: `true`
252252
- Description: Set to false to disable installing and configuring profile.
253+
- `os_security_auto_logout`
254+
- Default: `0`
255+
- Description: Set timeout in seconds for logout users automatically after time. Setting this to `0` disables the timeout.
253256
- `os_securetty_enabled`
254257
- Default: `true`
255258
- Description: Set to false to disable installing and configuring securetty.

roles/os_hardening/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ os_profile_enabled: true
364364
# Set to false to disable installing and configuring securetty.
365365
os_securetty_enabled: true
366366

367+
# Set timeout in seconds for logout users automatically after time. Setting this to `0` disables the timeout.
368+
os_security_auto_logout: 0
369+
367370
# Set to false to disable installing and configuring sysctl.
368371
os_sysctl_enabled: true
369372

roles/os_hardening/tasks/profile.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@
1313
path: /etc/profile.d/pinerolo_profile.sh
1414
state: absent
1515
when: os_security_kernel_enable_core_dump | bool
16+
17+
- name: Add autologout to profile env
18+
template:
19+
src: 'etc/profile.d/tmout.sh.j2'
20+
dest: '/etc/profile.d/tmout.sh'
21+
owner: 'root'
22+
group: 'root'
23+
mode: '0750'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Logout Timeout
2+
export TMOUT={{ os_security_auto_logout }}
3+
readonly TMOUT

0 commit comments

Comments
 (0)