Fail closed when passwordless sudo expiry cannot arm - #9387
Open
ErikMelton wants to merge 1 commit into
Open
Conversation
Remove stale passwordless sudo grants during boot and revoke a live grant immediately if its transient expiry timer cannot be created. Exercise both failure paths and the shipped tmpfiles rule against a disposable root. Co-authored-by: Adolanium <94890352+Adolanium@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds fail-closed expiry handling and boot cleanup for temporary passwordless sudo grants.
Changes:
- Revokes grants when timer creation fails.
- Removes stale grants during boot.
- Adds documentation and shell tests for expiry behavior.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bin/omarchy-sudo-passwordless |
Adds timer failure cleanup. |
etc/tmpfiles.d/omarchy-nopasswd-sudo.conf |
Removes stale grants at boot. |
manual/48-security.md |
Documents restart cleanup. |
test/shell.d/nopasswd-sudo-expiry-test.sh |
Tests timer failures and boot cleanup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #7990 and closes #8218.
This keeps the boot cleanup proposed by @Adolanium in #7990, while closing the fail-open path where the unrestricted sudoers grant was already live before
systemd-runhad successfully armed its expiry. The commit credits @Adolanium as co-author. The original reboot-persistence report came from @lbonvarl in #8218.Changes
rm -fin the transient service so successful expiry units do not remain failed--bootTesting
bash test/shell.d/nopasswd-sudo-expiry-test.sh./test/cli./test/shell— the new test passes; the aggregate retains five unrelated environment failures inconfig-test.sh,launch-about-test.sh,network-qr-test.sh,snapper-test.sh, andunowned-system-paths-test.shReported-by: @Adolanium , _SiCk // afflicted.sh