Skip to content

Add opt-in administrator lock restrictions - #3869

Merged
bbedward merged 6 commits into
duxlabs-dev:masterfrom
alvarosth:admin-lock-policy
Oct 22, 2026
Merged

bbedward merged 6 commits into
duxlabs-dev:masterfrom
alvarosth:admin-lock-policy

Conversation

@alvarosth

Copy link
Copy Markdown
Contributor

Implements #3868 with five opt-in keys in cli-policy.json: disable_lock_ipc_unlock, disable_logind_unlock, disable_custom_lock_pam, disable_user_plugins and disable_settings_ipc_set. All default to off. A malformed or unreadable policy file enables all five restrictions.

The logind backend change is gated on disable_logind_unlock because applying it unconditionally would change the default unlock behavior. Settings “managed by policy” notices are deferred during the i18n term freeze.

With disable_custom_lock_pam, passwords use /etc/pam.d/dankshell and fall back to /etc/pam.d/login if it is absent. Fingerprint and U2F require their respective /etc/pam.d stacks. If dankshell-u2f is absent in U2F “and” mode, the password alone unlocks and a warning is logged, avoiding lockout from the missing second-factor stack.

Validation at each of the six commits: Go race tests for internal/clipolicy and internal/server/loginctl, the QML lock suite, and the Node tests pass. The Lock.qml guards have no direct tests because AGENTS.md forbids tests from loading, slicing or mocking Modules/.

Export all five policy switches to the shell at launch. Refuse unlock,
forceReset and demo when disable_lock_ipc_unlock is set, and remove the
demo keybind choice. A policy read error enables every restriction.
With disable_logind_unlock enabled, a sessionUnlocked signal leaves
both an active lock and a queued lock request in place.
With disable_custom_lock_pam, password authentication uses
/etc/pam.d/dankshell, falling back to /etc/pam.d/login when absent.
Fingerprint and U2F are available only when their /etc/pam.d stacks,
dankshell-fprint and dankshell-u2f, exist. Ignore custom PAM paths,
inline factors and generated user stacks.

If dankshell-u2f is absent in U2F and mode, accept the password alone
and warn so the missing stack cannot leave the user locked out.
With disable_user_plugins enabled, load only the system plugin tree at
/etc/xdg/quickshell/dms-plugins. Do not read or watch user plugins.
Browser installs still reach the user tree and remain unloaded.
Return SETTINGS_SET_DISABLED for settings.set when
disable_settings_ipc_set is enabled. Read requests remain available.
Gate the backend change on disable_logind_unlock: read Locked and
LockedHint from logind on Unlock, retaining cached state on a read
error. Leave the default path intact because applying this change
unconditionally would change existing unlock behavior.
@bbedward

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.
Checked: clipolicy loading/precedence and fail-closed ShellEnv, loginctl keepLockOnUnlock path and its server wiring, AdminPolicy singleton and its imports, Lock.qml IPC/logind guards and other unlock paths, Pam.qml system-stack selection for password/fprint/U2F, PluginService user-tree exclusion (scan, resync, rescan, install), settings IPC set guard, keybind action filter, tests and mocks. Model: claude-opus-5-5.

@bbedward
bbedward merged commit 7781c20 into duxlabs-dev:master Oct 22, 2026
4 checks passed
bbedward pushed a commit that referenced this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants