1.7.4 Ensure GDM screen locks when the user is idle
Audit#
Run the following script to verify that the screen locks when the user is idle:
# gsettings get org.gnome.desktop.screensaver lock-delay
uint32 5
# gsettings get org.gnome.desktop.session idle-delay
uint32 900
Note: - lock-delay=uint32 {n} - should be 5 seconds or less and follow local site policy - idle-delay=uint32 {n} - should be 900 seconds (15 minutes) or less, not 0 (disabled) and follow local site policy
Remediation#
- IF - A user profile is already created run the following commands to enable screen locks when the user is idle:
# gsettings set org.gnome.desktop.screensaver lock-delay 5
# gsettings set org.gnome.desktop.session idle-delay 900
- OR/IF - A user profile does not exist: 1. Create or edit the user profile in the /etc/dconf/profile/gdm with the following lines:
Note: local is the name of a dconf database used in the examples.-
Create the directory /etc/dconf/db/local.d/ if it doesn't already exist:
-
Create the key file /etc/dconf/db/local.d/00-screensaver to provide information for the local database:
Example key file:
# Specify the dconf path
[org/gnome/desktop/session]
# Number of seconds of inactivity before the screen goes blank
# Set to 0 seconds if you want to deactivate the screensaver.
idle-delay=uint32 180
# Specify the dconf path
[org/gnome/desktop/screensaver]
# Number of seconds after the screen is blank before locking the screen
lock-delay=uint32 0
Note: You must include the uint32 along with the integer key values as shown.
-
Run the following command to update the system databases:
-
Users must log out and back in again before the system-wide settings take effect.