Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 1645628[details]
Script printing the methods used for unlocking for a given LUKS device
Description of problem:
Installing clevis-dracut enables unconditionally the network in the initramfs through creating "/etc/cmdline.d/99-clevis.conf" file.
In fact, this is not necessary (and not wished at all) when TPM2 is used to unlock the devices.
This is particularly an issue when static IP configuration is used, which then needs to be explicitly added to the dracut configuration.
I believe the 99-clevis module must be enhanced to check the LUKS slots if a method requiring the network is used (e.g. Tang) and activate the network only in this case.
This can be done by using a script checking for the unlock method, as proposed in the attachment.
Version-Release number of selected component (if applicable):
clevis*-11-2.el8.x86_64
How reproducible:
Always
Steps to Reproduce:
1. Install clevis-dracut
Actual results:
Network is enabled early during boot
Example of script usage:
LUKSv1:
# clevis-show-method.sh /dev/mapper/rhel-00
tang
LUKSv2:
# clevis-show-method.sh /dev/sda3
tpm2
Of course TPM2 and Tang may be used for the same LUKS device.
As soon as "tang" is found, network needs to be activated.
Note: assuming this is implemented, I would recommend the network to be always set up in the initramfs *even* in case "Tang" is not used for the root volumes, otherwise BZ #1784084's proposed solution wouldn't work.
(In reply to Renaud Métrich from comment #0)
> Created attachment 1645628[details]
> Script printing the methods used for unlocking for a given LUKS device
>
> Description of problem:
>
> Installing clevis-dracut enables unconditionally the network in the
> initramfs through creating "/etc/cmdline.d/99-clevis.conf" file.
> In fact, this is not necessary (and not wished at all) when TPM2 is used to
> unlock the devices.
> This is particularly an issue when static IP configuration is used, which
> then needs to be explicitly added to the dracut configuration.
>
> I believe the 99-clevis module must be enhanced to check the LUKS slots if a
> method requiring the network is used (e.g. Tang) and activate the network
> only in this case.
>
We are doing something like this in https://bugzilla.redhat.com/show_bug.cgi?id=1762028 and adding rd.neednet=1 only when we detect a device bound to tang.
(In reply to Renaud Métrich from comment #1)
> Example of script usage:
>
> LUKSv1:
>
> # clevis-show-method.sh /dev/mapper/rhel-00
> tang
>
> LUKSv2:
>
> # clevis-show-method.sh /dev/sda3
> tpm2
>
> Of course TPM2 and Tang may be used for the same LUKS device.
> As soon as "tang" is found, network needs to be activated.
By the way, we are also adding a "clevis luks list" sub-command in https://bugzilla.redhat.com/show_bug.cgi?id=1766526, and it is useful for listing the pin + configuration in a device/slot. This is what we used in https://bugzilla.redhat.com/show_bug.cgi?id=1762028
Created attachment 1645628 [details] Script printing the methods used for unlocking for a given LUKS device Description of problem: Installing clevis-dracut enables unconditionally the network in the initramfs through creating "/etc/cmdline.d/99-clevis.conf" file. In fact, this is not necessary (and not wished at all) when TPM2 is used to unlock the devices. This is particularly an issue when static IP configuration is used, which then needs to be explicitly added to the dracut configuration. I believe the 99-clevis module must be enhanced to check the LUKS slots if a method requiring the network is used (e.g. Tang) and activate the network only in this case. This can be done by using a script checking for the unlock method, as proposed in the attachment. Version-Release number of selected component (if applicable): clevis*-11-2.el8.x86_64 How reproducible: Always Steps to Reproduce: 1. Install clevis-dracut Actual results: Network is enabled early during boot