Skip to content

Add opt-in sudo authentication policy - #11172

Open
shelldandy wants to merge 1 commit into
omacom:quattrofrom
shelldandy:fix/harden-sudo
Open

shelldandy wants to merge 1 commit into
omacom:quattrofrom
shelldandy:fix/harden-sudo

Conversation

@shelldandy

@shelldandy shelldandy commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Managed Omarchy devices can now require authentication for all routine privilege escalation without losing DNS, browser theme, or timezone menu actions. The new opt-in compliance policy removes Omarchy's 3 persistent NOPASSWD files from the active sudoers directory, preserves their exact package contents for restoration, and leaves the default experience unchanged.

screenshot-2026-09-10_09-53-44

Sad Kolide is sad

Design

  • Adds Setup > Security > Require Sudo Authentication and a matching Remove action.
  • Stores system-wide opt-in state under /etc/omarchy/security and moves only omarchy-dns, omarchy-theme-browser, and omarchy-tzupdate into a root-only disabled directory.
  • Reapplies the policy immediately after settings package transactions during updates and channel changes, while dropping preserved rules that a newer package no longer ships.
  • Validates every preserved rule with visudo, publishes changes atomically, and keeps the policy enabled when a mutation or restoration fails.
  • Routes timezone changes through Polkit when the passwordless grant is absent. DNS and browser policy helpers already provide the same fallback.
  • Keeps temporary passwordless sudo, which users explicitly request and which expires automatically, outside this compliance policy.

Testing

  • Added focused coverage for enable, update reapplication, package retirement, restoration, symlink rejection, mutation failure, and fail-closed behavior.
  • Updated timezone, update sequence, channel, and menu coverage.
  • ./test/cli passes.
  • ./test/all was also run. Its CLI suite passed; the shell suite's 6 failures were unrelated environment prerequisites: a missing omarchy-pkgs checkout, unavailable test GPG keys, and a locale decode failure.

@omarchybot omarchybot added the enhancement New feature or request label Sep 27, 2026
@jandrusk

Copy link
Copy Markdown

Thanks for the careful sudoers staging (visudo -cf, cmp, refuse symlinks, keep policy marker on failed restore).

This is a product call for managed devices rather than a default-security change. A couple of review asks:

Happy to see this land if DHH wants the menu toggle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants