Description
- GNOME locks the screen when it blanks and before the system suspends (lid close, suspend
key, idle suspend) when
org.gnome.desktop.screensaver lock-enabledistrue, and lets users lock at all whenorg.gnome.desktop.lockdown disable-lock-screenisfalse. Both keys are set in the system dconf databaselocaland locked. - KDE Plasma locks on resume when
LockOnResumeis not false in the[Daemon]group ofkscreenlockerrc; the system file/etc/xdg/kscreenlockerrcmust mark the group immutable ([Daemon][$i]).
These are Debian's defaults, but users can change them unless the keys are locked. With Xfce,
check by hand that xfce4-power-manager locks the screen on suspend (setting
lock-screen-suspend-hibernate). The KDE check was written from the KDE documentation and
not tested in a lab; it has no automated fix.
Rationale
Mobile machines are mostly left suspended, not idle. If the session is not locked at suspend, anyone who gets the laptop resumes into the user's open session, without a password, and the idle lock never triggers.
Impact
Users type their password after resume. They cannot disable the screen lock.
Setting
| Location | /etc/dconf/db/local.d/ (GNOME); /etc/xdg/kscreenlockerrc (KDE) |
| Default | Lock enabled, not locked |
| Recommended | lock-enabled=true and disable-lock-screen=false, locked; KDE [Daemon][$i] LockOnResume=true |
Audit
- GNOME:
dconf read /org/gnome/desktop/screensaver/lock-enabledmust printtrueanddconf read /org/gnome/desktop/lockdown/disable-lock-screenmust printfalse; both keys must be listed in/etc/dconf/db/local.d/locks/. - KDE Plasma:
/etc/xdg/kscreenlockerrcmust have a[Daemon][$i]group that does not setLockOnResume=false.
Automated: every check must pass. Scanners report each check by its id.
gnome-lock-enabled
GNOME locks the screen when it blanks and before suspend.
key: /org/gnome/desktop/screensaver/lock-enabled
value: 'true'
gnome-lock-allowed
GNOME users cannot disable the lock screen.
key: /org/gnome/desktop/lockdown/disable-lock-screen
value: 'false'
kde
The KDE screen locker locks on resume and users cannot change it.
script: |
f=/etc/xdg/kscreenlockerrc
[ -f "$f" ] || { echo "$f missing"; exit 1; }
o=$(awk '/^[ \t]*\[/ { s = ($0 ~ /^[ \t]*\[Daemon\]\[\$i\][ \t]*$/); if (s) imm = 1; next }
s && /^[ \t]*LockOnResume[ \t]*=/ { v = $0; sub(/^[^=]*=[ \t]*/, "", v) }
END { printf "immutable=%d LockOnResume=%s\n", imm, v }' "$f")
echo "$o"
case $o in *immutable=1*) ;; *) exit 1 ;; esac
case $o in *LockOnResume=false*) exit 1 ;; esac
Remediation
- GNOME: make sure
/etc/dconf/profile/usercontainsuser-db:userandsystem-db:local, then create/etc/dconf/db/local.d/00-lock-screen:
list both keys in[org/gnome/desktop/screensaver] lock-enabled=true [org/gnome/desktop/lockdown] disable-lock-screen=false/etc/dconf/db/local.d/locks/00-lock-screenand rundconf update. - KDE Plasma: add
LockOnResume=trueto the[Daemon][$i]group of/etc/xdg/kscreenlockerrc(see CB-DEB-DESK-008).
| Restart | users must log in again |
| Disruption | low |
Rollback
Delete the files written in /etc/dconf/db/local.d/ and its locks/ directory, then run
dconf update.
gnome-lock-enabled
Generated from check gnome-lock-enabled: the engine writes the fix for every output, it sets the expected value and the check runs again after.
gnome-lock-allowed
Generated from check gnome-lock-allowed: the engine writes the fix for every output, it sets the expected value and the check runs again after.
Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.
References
- GNOME System Administration Guide - Lock the screen when the user is idle The GNOME Project, vendor-doc, accessed 2026-10-18
- gsettings-desktop-schemas - org.gnome.desktop.screensaver schema The GNOME Project, vendor-doc, accessed 2026-10-18
- kscreenlocker - kscreenlockerrc settings (kscreenlockersettings.kcfg) KDE, vendor-doc, accessed 2026-10-18
- ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R32) ANSSI, guide, accessed 2026-10-18
Mappings
| Framework | ID | Relation | Note |
|---|---|---|---|
| ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0 | R32 | partial | Covers locking at suspend; the idle delay is CB-DEB-DESK-003 and CB-DEB-DESK-008. |
| NIST SP 800-53 Rev. 55.1.1 | AC-11 | partial |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
| Taxonomy | ID |
|---|---|
| Common Weakness Enumeration | CWE-613 |
Related controls
- related
CB-DEB-DESK-003Lock GNOME sessions after a short inactivity delay - related
CB-DEB-DESK-008Lock idle sessions outside GNOME, through logind and the KDE screen locker
People and lifecycle
| Authors |
|
| Verified | 2026-10-18 by Sn0wAlice on 12, Proxmox VM with minimal GNOME (gdm3, gnome-shell), Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64. GNOME dconf checks and fixes tested (desktop-hardened); lock-enabled and disable-lock-screen confirmed non-writable for a user; state kept after reboot. The KDE check was not tested (no KDE machine). |
| Verified | 2026-10-18 by Sn0wAlice on 13, Proxmox VM with minimal GNOME (gdm3, gnome-shell), Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. GNOME dconf checks and fixes tested (desktop-hardened); lock-enabled and disable-lock-screen confirmed non-writable for a user; state kept after reboot. The KDE check was not tested (no KDE machine). |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-18, 2026-10-18 |
| Translations | fr |