Secure flake sources before privileged updates #1

Merged
astaranix merged 4 commits from jom/secure-flake-source into main 2026-08-11 10:13:16 -04:00 AGit
Owner

Defaults nixos-updater.secured to true, migrates the configured source tree to root ownership, rejects unsafe ownership, writable permissions or ACLs, symlink targets, and local lock-file inputs before privileged updates, and preserves an explicit secured=false compatibility mode. Includes module and runtime regression coverage plus migration documentation.

Defaults nixos-updater.secured to true, migrates the configured source tree to root ownership, rejects unsafe ownership, writable permissions or ACLs, symlink targets, and local lock-file inputs before privileged updates, and preserves an explicit secured=false compatibility mode. Includes module and runtime regression coverage plus migration documentation.
Default nixos-updater.secured to true and migrate the configured source tree to root ownership during activation.

Before invoking Nix, secured services now reject unsafe source ownership, writable modes or ACLs, symlink targets, and local lock-file inputs. secured=false retains compatibility with user-owned development checkouts.

Add module and shell regression coverage and document the migration behavior.
Migrate user-owned source trees through an atomic copy/exchange so retained descriptors cannot mutate the configured source.

Validate raw symlink chains and normalized paths, reject control-character lock fields, and validate secured apply candidates before atomically installing them. Keep unsecured apply behavior unchanged and add focused migration/apply regressions.
Propagate symlink-enumeration failures, normalize raw symlink targets, and create the pending-rebuild marker before installing a validated lock.

Use the option schema default without a competing policy definition so downstream mkDefault false compositions remain valid. Add regressions for each review finding.
Require explicit migration opt-in for custom flake paths while retaining automatic /etc/nixos migration, and reject migration targets without flake.nix.

Synchronize pending-rebuild state before installing a validated lock so power loss across filesystems cannot leave an unapplied lock with no retry marker. Add regression coverage and update the security documentation.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
astaranix/nixos-updater!1
No description provided.