-
Notifications
You must be signed in to change notification settings - Fork 169
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
s390x: generate GPG keys for Ignition config protection #3055
Conversation
0abed72
to
e365bf0
Compare
e365bf0
to
1156dd3
Compare
1156dd3
to
ceee648
Compare
ceee648
to
6933cec
Compare
84245e0
to
4addcbc
Compare
4addcbc
to
7d683e7
Compare
7d683e7
to
acb9fa3
Compare
7a3f0be
to
a1715f1
Compare
338d019
to
7899463
Compare
7899463
to
03940c3
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.
Sorry, typed Enter too fast, will retry! :)
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.
LGTM! Two thoughts:
- I wish we didn't have to support both the external genprotimg flow and the "local dev" one. Maybe we can get rid of the latter and add instructions on how to create your own genprotimg qcow2 for local testing. Though that's probably actually more complex to support than this. Let me know if you have ideas around this.
- How are we planning to test this? If this isn't tested by CI, we could easily regress on it. Ideally we'd have something like
kola run -p qemu-secex
, but maybe easier is to keep relying on theqemu
platform code, but add a--qemu-secex
flag which tells kola to encrypt the Ignition config and present it as the expected virtio device? I guess the hurdle there is that we need to inject the host key in the Ignition config, which depends on whatever the builder we're testing on. We could define some APIs for that to wire it through, though short-term, we could just inject a bogus key; as long as we run tests that don't require regenerating the initramfs, it should work. (Honestly, even just runningbasic
to start would be really helpful since it still exercises the Ignition config path.)
I was thinking about it, but removing external VM seems more attractive (
That's smth to discuss with IBM team. As far as i remember, we were discussing P.S.: thank you for the help and review ) |
During `cosa buildextend-secex` a pair of GPG keys is randomly generated, where private key becomes part of `sdboot` image, and public key becomes part of build artifacts. User than can encrypt his Ignition config: ``` gpg --recipient-file /path/to/ignition.gpg.pub --output /path/to/config.ign.gpg --armor --encrypt /path/to/config.ign ``` And attach it to `qemu-kvm` as a disk: ``` -drive if=none,id=ignition,format=raw,file=/path/to/config.ign.gpg,readonly=on \ -device virtio-blk,serial=ignition.gpg,iommu_platform=on,drive=ignition ```
Signed-off-by: Nikita Dubrovskii <[email protected]>
Signed-off-by: Nikita Dubrovskii <[email protected]>
03940c3
to
788f1c9
Compare
I agree that doing it via rdcore would be awesome. But i don't think the restrictions on the universal hostkey are going to be lifted, so the genprotimgvm is not going away... |
LGTM |
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.
To be clear, I don't think we should consider this feature completed until we've fleshed out the testing story. But I think this is in a good state now to get in and we can iterate from there.
Nice work!
Opened a follow-up in #3362. |
This is a proof-of-concept, part of coreos/fedora-coreos-config#1939.
During
cosa buildextend-secex
a pair of GPG keys is randomly generated,where private key becomes part of
sdboot
image, and public key becomespart of build artifacts.
User than can encrypt his Ignition config:
And attach it to
qemu-kvm
as a disk: