| name | cis-ubuntu1804-v220-4-5-5 |
| description | Ensure default user shell timeout is configured |
| category | cis-iam |
| version | 2.2.0 |
| author | cyberstrike-official |
| tags | ["cis","ubuntu","linux","ubuntu-18.04","users","account-security"] |
| cis_id | 4.5.5 |
| cis_benchmark | CIS Ubuntu Linux 18.04 LTS Benchmark v2.2.0 |
| tech_stack | ["ubuntu","linux"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
CIS Ubuntu Linux 18.04 LTS Benchmark v2.2.0 - Control 4.5.5
Profile Applicability
- Level 1 - Server
- Level 1 - Workstation
Description
TMOUT is an environmental setting that determines the timeout of a shell in seconds.
TMOUT=n - Sets the shell timeout to n seconds. A setting of TMOUT=0 disables timeout.
readonly TMOUT - Sets the TMOUT environmental variable as readonly, preventing unwanted modification during run-time.
export TMOUT - exports the TMOUT variable
System Wide Shell Configuration Files:
/etc/profile - used to set system wide environmental variables on users shells. Is only executed for interactive login shells, or shells executed with the --login parameter.
/etc/profile.d - /etc/profile will execute the scripts within /etc/profile.d/*.sh. It is recommended to place your configuration in a shell script within /etc/profile.d to set your own system wide environmental variables.
/etc/bash.bashrc - System wide version of .bashrc. /etc/bash.bashrc also invokes /etc/profile.d/*.sh if non-login shell, but redirects output to /dev/null if non-interactive. Is only executed for interactive shells or if BASH_ENV is set to /etc/bash.bashrc.
Rationale
Setting a timeout value reduces the window of opportunity for unauthorized user access to another user's shell session that has been left unattended. It also ends the inactive session and releases the resources associated with that session.
Audit Procedure
Command Line
Run the following script to verify TMOUT is configured:
- as multiple lines, or a single line
- once, and only once
- in one and only one of the following locations:
- A file in the
/etc/profile.d/ directory ending in .sh
/etc/profile
/etc/bash.bashrc
- Follows local site policy:
- Not to exceed
900
- Not equal to
0