Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
1.8.4 Ensure GDM screen locks when the user is idle (Automated)
Profile Applicability
Level 1 - Server
Level 1 - Workstation
Description
GNOME Desktop Manager can make the screen lock automatically whenever the user is idle for some amount of time.
idle-delay=uint32 {n} - Number of seconds of inactivity before the screen goes blank
lock-delay=uint32 {n} - Number of seconds after the screen is blank before locking the screen
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 900
# Specify the dconf path
[org/gnome/desktop/screensaver]
# Number of seconds after the screen is blank before locking the screen
lock-delay=uint32 5
Rationale
Setting a lock-out value reduces the window of opportunity for unauthorized user access to another user's session that has been left unattended.
Audit Procedure
Command Line
Run the following script to verify that the screen locks when the user is idle:
#!/usr/bin/env bash
{
# Check if GNOME Desktop Manager is installed. If package isn't installed, recommendation is Not Applicable\n# determine system's package manager
l_pkgoutput=""ifcommand -v dpkg-query > /dev/null 2>&1; then
l_pq="dpkg-query -s"elifcommand -v rpm > /dev/null 2>&1; then
l_pq="rpm -q"fi# Check if GDM is installed
l_pcl="gdm gdm3"# Space separated list of packages to checkfor l_pn in$l_pcl; do$l_pq"$l_pn" > /dev/null 2>&1 && l_pkgoutput="\n - Package: \"\" exists on the system\n - checking configuration"
[ -n ];
l_output= l_output2=
l_idmv=
l_ldmv=
l_kfile=
[ -n ];
l_profile=.
l_pdbdir=
l_idv=
[ -n ];
[ -gt -a -le ] && l_output=
[ = ] && l_output2=
[ -gt ] && l_output2=
l_output2=
l_ldv=
[ -n ];
[ -ge -a -le ] && l_output=
[ -gt ] && l_output2=
l_output2=
grep -Psq /etc/dconf/profile/*;
l_output=
l_output2=
[ -f ];
l_output=
l_output2=
l_output2=
l_output=
[ -n ] && -e
[ -z ];
-e
-e
[ -n ] && -e
}
$l_pkgoutput
$l_pn
done
# Check configuration (If applicable)
if
"$l_pkgoutput"
then
""
""
"900"
# Set for max value for idle-delay in seconds
"5"
# Set for max value for lock-delay in seconds
# Look for idle-delay to determine profile in use, needed for remaining tests
Create the directory /etc/dconf/db/{NAME_OF_DCONF_DATABASE}.d/ if it doesn't already exist:
Example:
mkdir /etc/dconf/db/local.d
Create the key file /etc/dconf/db/{NAME_OF_DCONF_DATABASE}.d/{FILE_NAME} to provide information for the {NAME_OF_DCONF_DATABASE} database:
Example script:
#!/usr/bin/env bash
{
l_key_file="/etc/dconf/db/local.d/00-screensaver"
l_idmv="900"# Set max value for idle-delay in seconds (between 1 and 900)
l_ldmv="5"# Set max value for lock-delay in seconds (between 0 and 5)
{
echo'# Specify the dconf path'echo'[org/gnome/desktop/session]'echo''echo'# Number of seconds of inactivity before the screen goes blank'echo'# Set to 0 seconds if you want to deactivate the screensaver.'echo"idle-delay=uint32 $l_idmv"echo''echo'# Specify the dconf path'echo'[org/gnome/desktop/screensaver]'echo''echo'# Number of seconds after the screen is blank before locking the screen'echo"lock-delay=uint32 $l_ldmv"
} > "$l_key_file"
}
Note: You must include the uint32 along with the integer key values as shown.
Run the following command to update the system databases:
dconf update
Note: Users must log out and back in again before the system-wide settings take effect.