Closed pyllyukko closed 2 years ago
Installing tmout.sh into /etc/profile.d is necessarily not enough. E.g. if sudo is invoked without -i, it doesn't apply.
tmout.sh
/etc/profile.d
sudo
-i
autologout.csh
sudoers
sudo_env
autolog.conf
Examples from different guides:
2.3.5.5 Implement Inactivity Time-out for Login Shells
/etc/profile.d/tmout.sh:
/etc/profile.d/tmout.sh
TMOUT=900 readonly TMOUT export TMOUT
/etc/profile:
/etc/profile
# Logout if a root terminal is not being used if [ `id -u` = "0" ]; then export TMOUT=1200 fi
5.4.4 Ensure default user shell timeout is configured (Automated)
profile
/etc/bashrc
/etc/bash.bashrc
We could add TMOUT to sudo_env.
TMOUT
Value should be no more than 15 minutes.
99a5e25f4a6d0e04574d45cda908c0ccc9f9404c
Related issue: #72
The timeout value should be a variable and used consistently across various configs.
Installing
tmout.sh
into/etc/profile.d
is necessarily not enough. E.g. ifsudo
is invoked without-i
, it doesn't apply.autologout.csh
sudoers
,sudo_env
,tmout.sh
,autologout.csh
&autolog.conf
Examples from different guides:
NSA RHEL guide
2.3.5.5 Implement Inactivity Time-out for Login Shells
/etc/profile.d/tmout.sh
:system-hardening-10.2.txt
/etc/profile
:CIS CentOS Linux 7 Benchmark v3.0.0
5.4.4 Ensure default user shell timeout is configured (Automated)
profile
/etc/bashrc
CIS Debian Linux 10 Benchmark v1.0.0
/etc/bash.bashrc
profile