-
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
Support encrypting LUKS devices using CEX secure keys on s390x #1693
Comments
From my understanding, this looks like something that should be added to Clevis, not Ignition. |
Hi @travier , As recommened by @cgwalters i raised an issue in upstream ignition. to discuss further on this. If it is not here i'll raise it in Clevis then. |
Hi @travier @cgwalters , Since there is no response from clevis side. So I decided to do some research on with Rhcos qcow2 image. I am using CEX card for luks encryption. Here is the command I am using to spin up the kvm guest.
here is my ignition file which I infuse on the qcow2 image before the above command. The The guest vm spins up and I am able to login and the root device get luks encrypted. However whilst rebooting I am getting passphrase prompt. I think the passphrase is getting generated by luks itself. Is there anyway we can derive or pass as an argument in ignition?.
IGNITION FILE
The SecureKey Generated from the CEX card .
The key file encrypted in the Guest system.
|
It's asking for a password because the keyfile is not accessible since it's on the encrypted rootfs. (The key data provided is written to a file and stored in I'd agree with @travier; this looks like support needs to go in Clevis instead, and then it could be exposed in Ignition via something like: luks:
name: root,
label: luks-root
device: /dev/disk/by-partlabel/root
clevis:
cex: true (This isn't strictly necessary, since Ignition does support custom Clevis pins too, i.e. Adding it to Clevis means it would also be supported by traditional RHEL and in theory any other environment where Clevis is supported. |
Hi @jlebon and @travier , Whilst using the CEX card for encryption the administrator are limited to issue few commands generating the secure keys, reencipher etc with certain parameters. As there is no specific command we can use to interact to decrypt or encrypt via the device. It is taken care by the dmcrypt that pass to PAES kernel module which internally generate a protected key for data encryption. The following images shows the work flow. As I understood from the TPM2 is the encryption and decryption can be done with TPM2 device where we can seal and unseal generating keys etc can be interacted with tpm device with commands. However when we do similar concept to create Generate the secure key Format the volume
Similarly we can open the device with There is no specific command or method we can use these keys to encrypt or decrypt a The other problem is the secure key is getting generated from a single command which is XTS key that can only be reside in a file because it contain null bytes (gibberish). Something like below this is getting wrapped by CRYPTO master key in the Crypto Card Controller. [root@fedora ~]# cat secure_xtskey1.skey Certainly, we can convert that to base64 encrypted but decryption must be to a file not on a variable. But the issue here is secure key file processing happened at kernel level as explained in the work flow. Looking for your valuable input. |
Hi @jlebon , The prerequisites are
IBM Crypto Card must be present in the system.
Generate the Secure Keys with following commands
Listing the key
Formatting the luks volume with the secure key generated above. On debug for granularity.
Before running the
Setting the verification pattern.
Opening the luks Device on debug mode.
Create filesystem
Mount the volume
Closing the luks Device.
To validate the device that is luks encrypted with crypto card.
============================================================================================ ============================================================================================ With Single command we can execute above procedure till verification pattern.
Cryptsetup dump after the luksformat.
Validation
|
Hi @jlebon, I've given the details above for the data volume encryption process with IBM CEX card. Could you direct me how can i achieve to test this in FCOS qcow image with |
Summary of the discussion:
(Translates in Ignition to e.g.
|
@travier @jlebon , here is the video on How to do pervasive volume encryption with IBM CEX card. |
Hi, I've two questions,
So Something like.
|
For this issue, I would start off implementing the Ignition side of this. We can look at adding Butane sugar afterwards (but to answer your question, yes I think this would belong in the base spec which models the Ignition spec closely, but then we'd probably also want to support it in the
This would need to be done in Ignition first, but yes we could mirror it as needed in the base Butane spec when we get there. That said, I'm not even sure we need to expose these to start since Do you have more information about CCAES-CIPHER vs CCAAES-DATA? |
Thanks @travier , Here is the snippet from IBM regards to CCA-AESDATA, CCA-AESCIPHER or EP11 is another crypto controller where both comes in same CEX card( It may use in future). Using the --key-type parameter of the zkey command, you can decide between various types of secure keys: a CCA AES DATA key, a CCA AES CIPHER key, or an EP11 AES key for use with pervasive volume encryption. An AES DATA secure key is generated as the default, if you omit this parameter. With an AES CIPHER secure key, certain attributes are cryptographically bound to the key. These attributes may limit the usage of the key, for example, restrict the export or the usability scope. So this key type is assumed to be even more secure than the default AES DATA key. To generate an AES CIPHER secure key, a CEX6C or later coprocessor is required.
eg:
|
Hi, I am bit stuck of following.
The above command automatically run the |
We can create it in
I think for this level of detail, it would be better to open a PR with what you came up with and we can discuss there. |
Hi, I've completed the required changes in ignition for what i have done is updated The following is the translate Any hint where to troubleshoot or any per-requisite i am missing? |
It'd be easier to debug this in a PR. |
Hi @jlebon , |
Hi, Is it something we need to create in files stages? RHCOS test.
|
I guess for the root disk we don't really need to save it, but for data volumes we do and it'd be awkward to try to special-case the root case.
Yes. Search for |
Hi @jlebon , |
Sorry, I think I got confused earlier. Once the LUKS device is created with the secure volume key, is there any need to have the key in |
Oops, I lately see this message. i did not include any method added to save the secure key. In production mode the crypto controller master key gets managed by TKE (key management workstation) using different smart cards. Note: CCA-AESDATA can be exported to the zkey repository, but in case of CCA-AESCIPHER is not possible, only we can dump the volume key from the Luks Header. I will check with IBM crypto team whether the backup of secure key in the repository has any use for recovery at any stage for root volume. |
Here is the update from IBM crypto team, |
OK, that's fine. We can persist it into the real root. In that case yes, you'll want to use the |
Support for CEX LUKS volumes was added in Ignition as part of coreos/ignition#1693.
Support for CEX LUKS volumes was added in Ignition as part of coreos/ignition#1693. Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
Support for CEX LUKS volumes was added in Ignition as part of coreos/ignition#1693. Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
Support for CEX LUKS volumes was added in Ignition as part of coreos/ignition#1693. Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
Feature Request
Luks PIN for IBM CEX (Cryptograpic Express Card) similar to TPM for Encrypting root volume LUKS with secureKeys by using IBM CEX card co-processor CCA .
I am in process of enabling CEX cryptograhic card in S390x for Luks Disk Encryption specifically for root volume.
The main aim is to implement in OCP to utilize protected key generated from utility zkey where each CEX (CCA)cards will be assigned to each OCP nodes with Master key loaded. For that this feature requires in RHEL.
The secure key get generated from the master key in the cryptographic co-processor and the effective key in securekey can be only derived inside cryptogrpahic cards with master key residing in the card.
Environment
IBM S390x.
What hardware/cloud provider/hypervisor is being used to run Ignition?
IBM S390x.
Desired Feature
A CEX (Hardware Security Module) in LUKS PIN for root device encryption. Similar to TPM2.
Other Information
Have tested by creating volume for pervasive encryption in s390x. similarly using for root device LUKS encryption with protected key.
https://www.ibm.com/docs/en/linux-on-systems?topic=volumes-creating-volume-pervasive-encryption
The text was updated successfully, but these errors were encountered: