-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for building fully dm-verity protected images with systemd-repart #343252
add support for building fully dm-verity protected images with systemd-repart #343252
Conversation
Co-authored-by: nikstur <[email protected]> Co-authored-by: WilliButz <[email protected]>
@ofborg test appliance-repart-image-verity-store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I will test it and report.
29f5911
to
9c414e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff LGTM otherwise, but I'd also love to give it some testing with my own use-cases before approving. Will do so now
hmm, was the ofborg test cancelled because of the force-push with the formatting change? 👀 @ofborg test appliance-repart-image-verity-store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ NixOS test works
✅ My own read-only-root use-case works
✅ Personal non-NixOS-test usage test of the usr-scaffolded integrity-protected Nix store works
Great PR! Thank you so much for picking this up. Will approve once the remaining nits of mine are addressed.
ea2b97b
to
6c03e64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an infrec architectural loop.
If you are using image repart to create an ESP with a UKI reference, the intermediate image will reference that UKI reference which is overriden to point to the new UKI with the intermediate image reference.
Causing an infinite recursion. I am not sure what is the easiest here.
This module provides some abstraction for a multi-stage build to create a dm-verity protected NixOS repart image. The opinionated approach realized by this module is to first create an immutable, verity-protected nix store partition, then embed the root hash of the corresponding verity hash partition in a UKI, that is then injected into the ESP of the resulting image. The UKI can then precisely identify the corresponding data from which the entire system is bootstrapped. The module comes with a script that checks the UKI used in the final image corresponds to the intermediate image created in the first step. This is necessary to notice incompatible substitutions of non-reproducible store paths, for example when working with distributed builds, or when offline-signing the UKI.
This test should illustrate how to build a verity-protected NixOS image with systemd-repart, using the opinionated image.repart.verityStore module.
6c03e64
to
56d038e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo documentation, all good!
Description of changes
Please see the commit messages for more details.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)