Conversation
446609e to
d3e982b
Compare
chewi
left a comment
There was a problem hiding this comment.
Thank you very much for this! Apart from the one suggestion and some overquoting (no quotes needed in [[ ]]), this looks fine. I think using environment variables is perfectly valid here, otherwise we'll need to add and remember to use arguments in several places. I ran this under GHA, which had some unrelated issues, so I tried it locally, including Kola's cl.basic test, and it just worked. If you can make that change, I'd be happy to merge without doing another build.
For us, we need to do things differently for official vs unofficial builds because our sources are public, and we obviously cannot publish the official private key. You won't have this problem, but I wondered whether you were satisfied with keeping the private key in a file, as opposed to using a safer PKCS11-based mechanism.
Signed-off-by: Johann Queuniet <sub_code.git@queuniet.fr>
d3e982b to
e48c9ff
Compare
I see, I'm used to
Sure, I made the change
For now we're operating from my Github fork so we're subject to the same constraints, and I would certainly not commit such keys to a git repository, even a private one. You're right that we will definitely not be satisfied by files in the long run, government regulation pressure will very likely steer us toward PKCS11 or similar mechanisms eventually. But I'm not sure yet how that will take place, it could be a remote KMS, a standard smartcard, a full-fledged HSM, etc. The only thing I'm pretty sure of is that it will not be cloud-based. So I'd rather look at this through a separate PR at a later time, once the picture is clear. |
Parameterize Secure Boot keys
The current Secure Boot pipeline uses two different set of keys, one is public, hard-coded in the SDK container filesystem, and intended for test builds, the other is pulled from an Azure KMS and intended for release builds. Neither can be meaningfully parameterized to sign builds with custom keys.
This merge request attempts to parameterize the test keys to allow using custom keys instead. I tried to minimize actual changes to the codebase and as such opted for environment variables, at least to validate the initial approach. I feel they're a bit too "magic" and obscure though, and CLI arguments could be added to the necessary scripts if preferred.
Also, the generation, env preparation and artefact verification could be offloaded to proper scripts (ie,
verify_sbkey_images,generate_sbkeysandset_sbkeys_env) to ease custom key workflow as well as act as documentation for the process.How to use
Generate keys:
Set a proper environment:
Build Flatcar as usual:
Testing done
Verify artefacts have been signed with the correct keys: