Repository navigation
linux: NixOS/Linux port — sudoers boundary, Nix module, VM test - #7
Merged
Merged
Conversation
…dation, M2 plain-restore guard, M3 changelog, L1-L5 denylists/doc, H1 VM test)
… job moves to ci/base linux-ci.yml)
…estScript string)
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: c71c0114-12ba-4a75-9348-63791a8cdf00) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
Ports
sudo-secretspecto Linux/NixOS with the same privilege boundary the macOS install enforces: an unprivileged service user owns the vault, and a narrowly-grantedsudobroker is the only path to read, add or restore secrets. No Linux Homebrew, no Touch ID — anything that relies on launchd is documented and refused (see "Non-goals").What's in this PR
platform.rs,config.rs): Linux vault dir/var/lib/<svc>/sudo-secretspec,CLIENT_PATHunder/run/current-system/sw,SERVICE_IDENTITY_ALLOWS_HYPHEN, andlinux_identity_validrefusesALL/root/empty/#uid/newline-injected names.install.rs,main.rsPrintSudoers): the Nix module callsprint-sudoersat build time (pkgs.runCommand) withOPERATOR/SERVICE_USERpassed through, and feedssecurity.sudo.extraConfigthe generated text. Invalid identities make the IFD build fail (exit(2)).broker.rs): the broker is a store-pathlibexec/copy;SUDO_SECRETSPEC_BROKER_PATHis baked viabuiltins.placeholder "out"(no/runsymlink). Thesource-restoreverb refuses--all/--forcebefore opening the database (M2).flake.nix,nix/module.nix,nix/package.nix): flake inputnixpkgs.followsthe consumer's; the module derives sudoers, asserts valid identities, and denylistsnixos/systemd/privateand a group denylist under/var/lib.nix/test.nix,testers.nixosTest): proves the grant set is exactly the 11__brokerverbs (NOPASSWD) and thatsource-restore --all --force,source-destroy --all, anddoctorare password-gated; negatives assert"a password is required"on the same broker path, so neither direction is vacuous.CHANGELOG.md,docs/design/dann-deployment-threat-model.md): records the deployment threat model and the Linux build status.CI
linuxfmt/clippy/build/test,macoscompanion crate,nix— which built and ran the NixOS VM test on this head).nixgreen at9ba54fda(the fmt driftdc597ab5later fixed is visible there).Adversary review
Reviewed read-only by
adversaryat headdc597ab5. Blocking findings from the prior BLOCK (H1 VM test, M1 identity validation, M3 changelog) are fixed and proven green; M2 and L1 are fixed with green unit tests. Residual N1–N6 are all LOW (doc-wording and coverage items); N1 and N2 flag two incorrect statements in security prose that I'll fix in an immediate follow-up, not in this merge.Non-goals / documented refusals
install/uninstall/rollback/doctorrefuse on non-macOS viaplatform::lifecycle_refusal(doctor/drift is a macOS-only concern).Note
High Risk
Changes the privilege boundary on a new OS: sudoers generation, compile-time broker paths, and broker authorization gates are security-critical; mistakes could widen NOPASSWD or weaken restore controls.
Overview
Ports
sudo-secretspecto Linux/NixOS while keeping macOS behavior unchanged. Trusted paths (sudo, broker, config, vault parent, sudoers layout) move into a newplatformmodule, with compile-time overrides for the Nix package (SUDO_SECRETSPEC_*).install/uninstall/rollback/doctorrefuse on Linux and point operators atservices.sudo-secretspec.Adds a Nix flake (
packages,nixosModules.default, Linux VM checks) that builds the CLI with a separatelibexec/broker copy (immutable store path, no/runsymlink), generates sudoers via hiddenprint-sudoers+ IFD in the module, and asserts vault/operator/service identity constraints.Sudoers policy is refactored into shared
BROKER_VERBS/operator_grant_lines, pluslinux_sudoers_text(no Touch ID /doctorgrants, NixOSsecure_path) withlinux_identity_validso bad operator/service names fail at generation time. Config validation tightens vault paths (reject./..),rootas service identity, and Linux hyphenated service names.Broker hardening (M2): plain
source-restorerejects--alland--force(exit 2) so NOPASSWD--*globs cannot unattended whole-vault restore; tests switch mass restore tosource-restore-force.Documents the dann deployment threat model (root-equivalent operator, sops vs vault split) and updates CHANGELOG / devenv (CLI builds on Linux; crate tests still macOS-shaped).
Reviewed by Cursor Bugbot for commit dc597ab. Bugbot is set up for automated code reviews on this repo. Configure here.