-
Notifications
You must be signed in to change notification settings - Fork 106
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 TPM 1.2 support #462
base: master
Are you sure you want to change the base?
Add TPM 1.2 support #462
Conversation
556332d
to
04d5e9f
Compare
2c32eb7
to
a7de265
Compare
b4cc648
to
e83e669
Compare
dc1c5c3
to
40bfdf4
Compare
Work is done, pre-built packages for Debian 12 and amd64 arch are available here https://github.com/oldium/clevis/releases/tag/v20_tpm1 |
000c78a
to
b79a306
Compare
Rebased to latest master to fix the build. |
3df6d8c
to
bd503a2
Compare
Signed-off-by: Oldřich Jedlička <[email protected]>
The DefaultDependencies=yes option adds conflicting dependency on the shutdown.target automatically to ensure the service is terminated during the shutdown, so add it when we use DefaultDependencies=no. Signed-off-by: Oldřich Jedlička <[email protected]>
Signed-off-by: Oldřich Jedlička <[email protected]>
Current Dracut integration for bootup without Systemd ignores all cryptsetup options, which are usually handled by Dracut itself (like reading /etc/crypttab). We need to hook into the Dracut cryptsetup process in order to allow Dracut handling the options and us handling the password only. Dracut uses generated udev rules to create cryptsetup unlocking scripts in initqueue/settled dynamically when the corresponding device appears. The unlocking tries to unlock by the key file first and then by password read from user. We can hook into the key file reading stage by providing our own pipe and send the password via the pipe similarly to how the initramfs-tools clevisloop is doing it. There is one difference, though, we have only one try to unlock, but that should be enough. For the network pins (tang and sss/tang at the moment) we can move the generated Dracut cryptsetup unlocking scripts to initqueue/online to ensure the unlocking happens at the right time. Signed-off-by: Oldřich Jedlička <[email protected]>
This is useful during testing. Signed-off-by: Oldřich Jedlička <oldium.pro.gmail.com>
Signed-off-by: Oldřich Jedlička <[email protected]>
Signed-off-by: Oldřich Jedlička <[email protected]>
Signed-off-by: Oldřich Jedlička <[email protected]>
I did some final clean-up (reworked used-pins patch to allow running TBD: The last step, which is a result of my detailed testing, is to write a documentation on unlocking separate-/var with Clevis and TPM1 pin. I will release update-6 afterwards. Funny note - I have found that some tests fail to check the expected value - fixed here 69638bd |
Signed-off-by: Oldřich Jedlička <[email protected]>
This is a weak requirement, so when TCSD is missing, it does not influence the Clevis askpass service startup. Similarly if the TCSD startup fails, it does not affect the Clevis askpass service startup. Signed-off-by: Oldřich Jedlička <[email protected]>
Signed-off-by: Oldřich Jedlička <[email protected]>
Signed-off-by: Oldřich Jedlička <[email protected]>
Signed-off-by: Oldřich Jedlička <[email protected]>
TPM 1.2 SW tests on CentOS 9+ are not supported by RedHat (see [1]), but packages are installed and tests detect this. CentOS 10 EPEL does not contain tpm-tools, so is currently unsupported. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1990153 Signed-off-by: Oldřich Jedlička <[email protected]>
Signed-off-by: Oldřich Jedlička <[email protected]>
Signed-off-by: Oldřich Jedlička <[email protected]>
The command fails in Docker or otherwise limited environments, so skip the test when it is not usable. Signed-off-by: Oldřich Jedlička <[email protected]>
I have released the update 6. Enjoy 😁 New and Noteworthy:
|
The failed test usually takes few seconds, so the timeout might be caused by some other CI pipeline running on the same host... |
You can trigger a CI rerun in Checks tab of this PR. |
There is no such option visible for me. |
I triggered a re-run of the failed test. |
This patch series adds TPM 1.2 support and fixes few other things (I can split this into multiple Pull Requests if you wish):
DefaultDependencies=no
.Status:
clevis-encrypt-tpm1
Example usage:
clevis luks bind -d /dev/<device> tpm1 '{"pcr_ids":"0,4,7"}'
echo test | clevis encrypt tpm1 '{"pcr_ids":"0,4,7"}' | clevis decrypt
Tested:
"fail":true
to test success and failed unlockingrd.neednet
the unlocking happens after network gets online.Fixes: #84, #456