-
Notifications
You must be signed in to change notification settings - Fork 247
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 LUKS #960
*: add LUKS #960
Conversation
We could have this inject kernel arguments right? Then we can reuse the standard dracut crypt module. Basically we just inject the usual Though of course this links together Ignition with dracut, but right now ignition-dracut is a separate project. But I don't know of any Ignition users that aren't using dracut today, and in the end any true successor is probably going to need to parse at least a subset of the same kernel arguments anyways to gain adoption. |
As soon as we inject a |
Does anyone oppose merging ignition-dracut into ignition? Today it's pretty weird because the other projects we maintain like ostree and afterburn have them merged, and we really want to be able to do things like "add an ignition stage" as an atomic commit. Plus, in this PR I don't see how to avoid at least somewhat tying Ignition rootfs reprovisioning into dracut logic. |
I am a strong advocate of this idea. |
This came up a few times already: coreos/fedora-coreos-config#70 (comment). We just didn't have the cycles at the time to weed out the few remaining CoreOS-specific bits from the repo. (To be clear: I do still think this is where we should be heading.) |
c6e3f17
to
f069f2f
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.
So if I'm following this right, then design is:
- Ignition setups the LUKS volumes
- The opening will rely on Clevis-Dracut and Dracut to do the opening? Or is there another Ignition-Dracut piece?
Overall this looks goods. I'm just unclear of the mechanics of how the volume gets opened.
The initramfs on first boot works like so:
Inside of the real root non-root devices will be unlocked by Inside of the initramfs on subsequent boots the real root will be unlocked before sysroot is mounted. Only clevis devices would really make sense here (as non-clevis would imply that we're storing a key-file in non-encrypted |
Okay, that's what I was afraid of. I think we need to be very explicit about the Clevis path here.
So the boot path is:
So that means that we are going to implicitly allow user-input on boot. During the RHCOS implementation of LUKs, the group decided that this path was not desirable. I'm not saying that its not the path that we should take, just making the point. My concern to this point is that the failure of LUKS to open will have users asking "what is the passphrase?" (And why the RHCOS implementation just used its own util to open up the device. I think that we'll need to make sure that |
From OOB discussions it sounds like the plan going forward for real root
Some additional clarifications about First boot, there will likely be a new unit in |
I don't think in any cases with this we should support prompting for a traditional LUKS passphrase. It basically just doesn't make sense for servers. The MVP here is binding to a TPM 2 device right? Clevis/Tang/NBDE is definitely a very nice to have too. |
Yeah, this implementation won't have any prompting.
The MVP here is key-file based devices & TPM/Tang (via clevis). |
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.
Overall is looking sane! Thanks so much for working on this.
* **device** (string): the absolute path to the device. Devices are typically referenced by the `/dev/disk/by-*` symlinks. | ||
* **_cipher_** (string): the cipher specification string. | ||
* **_hash_** (string): the hash used in LUKS key setup scheme & volume key digest. | ||
* **_keyFile_** (string): the contents to use as a key file. |
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.
This probably needs some warnings/docs. For the root volume, it really doesn't make sense right? For non-root volumes...hmm, I guess one could store key files in e.g. /etc/luks/$volumename
or so, i.e. unlocking subsequent volumes is bound to the rootfs binding. That could be nicer than binding each volume to the tpm2 maybe in that if e.g. one chooses to later add a passphrase in addition to the tpm2 binding to allow moving the disk later, one would only need to do it for the root?
(There may be a "how to use keyfiles well" doc upstream but I didn't see one in a brief search)
cdd77ce
to
9402c81
Compare
Ignition LUKS Overview: PR Links: Ignition now supports configuring LUKS devices that can be unlocked via either key-files, TPM2, or tang. TPM2 & tang based devices are handled internally via clevis while key-file based devices are entirely handled via cryptsetup. First boot workflow:
This set of changes will require updates to the Ignition specfile. In the ignition-dracut change set the
&
|
Updates pushed, marked ready for review. |
Yeah, I think all testing should probably be in kola to avoid having to require a ton of crypto binaries on the blackbox host and we'll be blocked until either 3.2 stabilizes or we land experiemental Ignition versions into kola. |
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.
Nice work!
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.
Update pushed.
args = append(args, luks.Device) | ||
|
||
if _, err := s.Logger.LogCmd( | ||
exec.Command(distro.CryptsetupCmd(), args...), |
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.
Yes, at the moment it does not re-use devices. My thought was to add that in a follow-up.
For keyfile based devices it should be pretty simple to unlock the device and check it, would need to dive further in for clevis based devices.
Updated! |
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, nice work!
@@ -2,6 +2,12 @@ package types | |||
|
|||
// generated by "schematyper --package=types config/v3_2_experimental/schema/ignition.json -o config/v3_2_experimental/types/schema.go --root-type=Config" -- DO NOT EDIT | |||
|
|||
type Clevis struct { | |||
Tang []Tang `json:"tang,omitempty"` |
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.
Let's not block on this, but I think fetch-offline
should probably also check whether any Tang pins are present and SignalNeedNet()
in that case. We can do that in a follow-up though!
Hmm, and then the rootmap code could also check if LUKS devices in the root block device tree are Tang-pinned and adds rd.neednet=1
to the BLS for subsequent boots.
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.
Whoops, yeah, forgot about fetch-offline
.
The `platform.Conf` type allows abstracting over the different Ignition versions so that different tests can use different versions. Using it instead of the Ignition type directly means that we can now use the 3.2-experimental spec in external tests. This is needed for testing the new LUKS support in Ignition[1] and the related rootfs-on-complex-devices work[2]. [1] coreos/ignition#960 [2] coreos/fedora-coreos-config#503
The `platform.Conf` type allows abstracting over the different Ignition versions so that different tests can use different versions. Using it instead of the Ignition type directly means that we can now use the 3.2-experimental spec in external tests. This is needed for testing the new LUKS support in Ignition[1] and the related rootfs-on-complex-devices work[2]. [1] coreos/ignition#960 [2] coreos/fedora-coreos-config#503 Closes: coreos#1589
The `platform.Conf` type allows abstracting over the different Ignition versions so that different tests can use different versions. Using it instead of the Ignition type directly means that we can now use the 3.2-experimental spec in external tests. This is needed for testing the new LUKS support in Ignition[1] and the related rootfs-on-complex-devices work[2]. [1] coreos/ignition#960 [2] coreos/fedora-coreos-config#503 Closes: coreos#1589
The `platform.Conf` type allows abstracting over the different Ignition versions so that different tests can use different versions. Using it instead of the Ignition type directly means that we can now use the 3.2-experimental spec in external tests. This is needed for testing the new LUKS support in Ignition[1] and the related rootfs-on-complex-devices work[2]. [1] coreos/ignition#960 [2] coreos/fedora-coreos-config#503 Closes: coreos#1589
The `platform.Conf` type allows abstracting over the different Ignition versions so that different tests can use different versions. Using it instead of the Ignition type directly means that we can now use the 3.2-experimental spec in external tests. This is needed for testing the new LUKS support in Ignition[1] and the related rootfs-on-complex-devices work[2]. [1] coreos/ignition#960 [2] coreos/fedora-coreos-config#503 Closes: coreos#1589
The `platform.Conf` type allows abstracting over the different Ignition versions so that different tests can use different versions. Using it instead of the Ignition type directly means that we can now use the 3.2-experimental spec in external tests. This is needed for testing the new LUKS support in Ignition[1] and the related rootfs-on-complex-devices work[2]. [1] coreos/ignition#960 [2] coreos/fedora-coreos-config#503 Closes: #1589
Still will need some coordination with ignition-dracut to re-open said devices (both on first-boot before Ignition files & on subsequent boots).
Additionally needs a udev rule similar to https://github.com/lucab/bootengine/blob/40a7918874ced2a6a4008dcab556f1eba61309a3/dracut/99cryptsetup/99-xx-coreos-systemd-cryptsetup.rules as systemd ignores unformatted crypto devices.