Description
Two settings lock idle sessions independently of GNOME (covered by CB-DEB-DESK-003):
- systemd-logind:
IdleAction=lockwithIdleActionSecasks every session to lock once the system has been idle that long. Desktops that report idleness to logind (GNOME, KDE Plasma) honor it; - KDE Plasma: the screen locker reads
Autolock,Timeout(minutes) andLockfrom the[Daemon]group ofkscreenlockerrc. The system file/etc/xdg/kscreenlockerrcsets them and marks the group immutable with[Daemon][$i], so user files cannot override them.
Xfce has no setting a script can lock reliably: configure xfce4-screensaver (lock enabled,
delay at most {{ idle_minutes }} minutes) or light-locker and check it by hand. The logind
setting applies at the next boot (systemd 252 in Debian 12 cannot reload logind). The KDE
check was written from the KDE documentation and not tested in a lab; it has no automated
fix.
Rationale
An unattended unlocked session gives its access to anyone passing by. The logind idle action is a safety net that does not depend on each desktop's own settings, and the KDE lock keeps users from extending or disabling the delay.
Impact
Sessions lock after {{ idle_minutes }} minutes without input. Users of KDE Plasma cannot change the lock settings.
Setting
| Location | /etc/systemd/logind.conf.d/60-cirsec.conf; /etc/xdg/kscreenlockerrc |
| Default | IdleAction=ignore; KDE locks after 5 minutes, user can change it |
| Recommended | IdleAction=lock, IdleActionSec at most {{ idle_minutes }} min; KDE [Daemon][$i] Autolock=true, Timeout at most {{ idle_minutes }} |
Parameters
| Parameter | Core | Server | Server hardened | Desktop | Desktop hardened | Bounds |
|---|---|---|---|---|---|---|
idle_minutesinteger, minutes. Maximum minutes of inactivity before the session locks. | 15 | 15 | 15 | 15 | 15 | 1 to 15 |
The value used is your override (tailoring file), else the profile's, else the one of the profile it extends, else the default. Bounds limit what an override may set.
Audit
systemd-analyze cat-config systemd/logind.confmust end up withIdleAction=lockandIdleActionSecat most {{ idle_minutes }} minutes.- With KDE Plasma,
/etc/xdg/kscreenlockerrcmust contain a[Daemon][$i]group withAutolockandLocknot set to false andTimeoutat most {{ idle_minutes }}. - With Xfce, check the screen saver settings of each user.
Automated: every check must pass. Scanners report each check by its id.
logind
logind locks sessions after the idle delay.
script: |
conf=$(systemd-analyze cat-config systemd/logind.conf 2>/dev/null) || exit 3
a=$(printf '%s\n' "$conf" | sed -n 's/^[[:space:]]*IdleAction[[:space:]]*=[[:space:]]*//p' | tail -n 1)
s=$(printf '%s\n' "$conf" | sed -n 's/^[[:space:]]*IdleActionSec[[:space:]]*=[[:space:]]*//p' | tail -n 1)
us=$(systemd-analyze timespan "${s:-30min}" 2>/dev/null | awk '/s:/ { print $2; exit }')
echo "IdleAction=${a:-ignore} IdleActionSec=${s:-30min (default)}"
[ "$a" = lock ] || exit 1
[ -n "$us" ] || exit 3
[ "$us" -gt 0 ] && [ "$us" -le $((CB_IDLE_MINUTES * 60000000)) ]
kde
The KDE screen locker settings are locked and lock within the delay.
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 && /=/ { k = $0; sub(/[ \t]*=.*/, "", k); v = $0; sub(/^[^=]*=[ \t]*/, "", v); val[k] = v }
END { printf "immutable=%d Autolock=%s Lock=%s Timeout=%s\n", imm, val["Autolock"], val["Lock"], val["Timeout"] }' "$f")
echo "$o"
case $o in *immutable=1*) ;; *) exit 1 ;; esac
case $o in *Autolock=false* | *Lock=false*) exit 1 ;; esac
t=$(printf '%s' "$o" | sed -n 's/.*Timeout=\([0-9]*\).*/\1/p')
[ "${t:-5}" -ge 1 ] && [ "${t:-5}" -le "$CB_IDLE_MINUTES" ]
Remediation
- Create
/etc/systemd/logind.conf.d/60-cirsec.conf:
It applies at the next boot.[Login] IdleAction=lock IdleActionSec={{ idle_minutes }}min - With KDE Plasma, create
/etc/xdg/kscreenlockerrc:[Daemon][$i] Autolock=true Lock=true LockOnResume=true Timeout={{ idle_minutes }} - With Xfce, enable locking in the screen saver settings of each user.
| Restart | system reboot |
| Disruption | low |
Rollback
Delete /etc/systemd/logind.conf.d/60-cirsec.conf and /etc/xdg/kscreenlockerrc.
logind
f=/etc/systemd/logind.conf.d/60-cirsec.conf
cb_backup "$f"
mkdir -p /etc/systemd/logind.conf.d
printf '%s\n' '# Written by CIRSEC Baselines CB-DEB-DESK-008' '[Login]' 'IdleAction=lock' \
"IdleActionSec=${CB_IDLE_MINUTES}min" >"$f"
Handwritten code reads parameters from CB_<NAME> environment variables. 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
- logind.conf(5), Debian manual pages Debian, vendor-doc, accessed 2026-10-18
- KDE Developer - Kiosk, introduction (immutable settings) KDE, vendor-doc, accessed 2026-10-18
- kscreenlocker - kscreenlockerrc settings (kscreenlockersettings.kcfg) KDE, vendor-doc, accessed 2026-10-18
- Xfce documentation - xfce4-screensaver Xfce, 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 graphical sessions outside GNOME; GNOME is CB-DEB-DESK-003. |
| 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-009Lock the session when the screen saver starts and when the system suspends
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. logind check and fix tested (desktop-hardened); IdleAction=lock and IdleActionSec=900s read back from logind over D-Bus after reboot. The KDE check was not tested (no KDE machine), only reported not applicable. |
| 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. logind check and fix tested (desktop-hardened); IdleAction=lock and IdleActionSec=900s read back from logind over D-Bus after reboot. The KDE check was not tested (no KDE machine), only reported not applicable. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-18, 2026-10-18 |
| Translations | fr |