5.2.6 Ensure sudo authentication timeout is configured

Information

sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies.

A timeout value reduces the window of opportunity for unauthorized privileged sudo access.

Solution

- IF - the currently configured timeout is a negative number (disabled), greater than 15 minutes, or doesn't follow local site polity:

Run the visudo command and edit or add the following line:

Defaults timestamp_timeout=<N>

Example:

Defaults timestamp_timeout=15

See Also

https://workbench.cisecurity.org/benchmarks/21369