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.
Bug 1784079 - clevis-dracut always enables the network, which is erroneous when TPM2 is used
Summary: clevis-dracut always enables the network, which is erroneous when TPM2 is used
Keywords:
Status: CLOSED DUPLICATE of bug 1762028
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: clevis
Version: 8.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Sergio Correia
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-16 16:39 UTC by Renaud Métrich
Modified: 2023-03-24 16:28 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-17 07:22:02 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Script printing the methods used for unlocking for a given LUKS device (969 bytes, application/x-shellscript)
2019-12-16 16:39 UTC, Renaud Métrich
no flags Details

Description Renaud Métrich 2019-12-16 16:39:53 UTC
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

Comment 1 Renaud Métrich 2019-12-16 16:43:24 UTC
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.

Comment 2 Renaud Métrich 2019-12-16 17:07:06 UTC
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.

Comment 3 Sergio Correia 2019-12-16 20:54:59 UTC
(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

Comment 4 Renaud Métrich 2019-12-17 07:22:02 UTC
Sorry, I missed this BZ. Closing as a DUP.

*** This bug has been marked as a duplicate of bug 1762028 ***


Note You need to log in before you can comment on or make changes to this bug.