Skip to content
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

[RFE] Add systemd-cryptenroll PKCS11 support to unlock LUKS encrypted volumes using HSMs #1394

Open
ader1990 opened this issue Mar 15, 2024 · 5 comments
Labels
kind/feature A feature request

Comments

@ader1990
Copy link

Current situation

Systemd does not support PKCS11 URIs.

$: sudo systemd-cryptenroll --pkcs11-token-uri=list
PKCS#11 tokens not supported on this build.

Implementation options

Add the pkcs11 flag to systemd build.
Optional: Add dev-libs/opencryptoki for Software Token support.
Optional: Add softhsm2 integration testing in Mantle.

@jepio
Copy link
Member

jepio commented Mar 15, 2024

Can you provide more about information on how you expect this to be used? What is the use case compared to a TPM?

@ader1990
Copy link
Author

Can you provide more about information on how you expect this to be used? What is the use case compared to a TPM?
Best example I could find is the systemd test implementation:
https://github.com/systemd/systemd/blob/main/test/units/testsuite-24.sh#L235

@jepio
Copy link
Member

jepio commented Mar 15, 2024

That shows unlocking against a softhsm process running on the same system. How would that be used with an actual HSM?

I'd like us to understand the use case and then decide together whether it is worth implementing or not.

@ader1990
Copy link
Author

ader1990 commented Mar 15, 2024

The PKCS11 URI can be changed to a soft token implementation or other opencryptoki implementation (see https://github.com/opencryptoki/opencryptoki?tab=readme-ov-file#requirements SWToken ). Once opencryptoki gets built with the SWToken enabled, the .so library obtained will replace the softhsm .so one and the URI format gets changed accordingly). The SWToken library implements SSL over TCP to access the HSM (HSM needs to be compatible with the opencryptoki SWToken implementation, of course).

Then it's a matter of systemd-cryptenroll to be configured to use the proper .so library file.
This has to be confirmed on a real HSM (once I get access to such device).

I have created this issue in case there are potential users of this feature, there are quite alot of black boxes to be sorted out HSM hardware wise.

@ader1990
Copy link
Author

Similar PR might be needed for HSM too: flatcar/bootengine#93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A feature request
Projects
Status: 📝 Needs Triage
Development

No branches or pull requests

2 participants