-
-
Notifications
You must be signed in to change notification settings - Fork 113
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 for AWS CloudHSM #179
Comments
I agree it would be nice to support it, but this service is very expensive ($1600/month) and I can't spend that much for this project. If someone using AWS CloudHSM could share its access I would get a look. |
I got a look at the AWS documentation, and as I understand the CloudHSM REST API allows one to only manage the HSM instances, and not to perform cryptographic operations. This is performed through a dedicated client SDK that takes the form of a PKCS#11 module or a JCA provider. The client SDK doesn't look to be open source, the JCA provider isn't available on Maven Central and must be installed with a system package. The provider is actually a wrapper over a native library, so figuring out the underlying protocol to access the HSM isn't trivial. However an HSM can be configured as a keystore for AWS KMS, so Jsign should be able to use a key in a CloudHSM instance already. |
Also worth noting, the name "LiquidSecurity" appears in the documentation and in the native library, that's most likely the name of the Marvell HSM hardware used by AWS. It seems to use an undocumented binary protocol. If someone manages to reverse engineer this protocol we may be able to integrate it directly into Jsign, but in the meantime it's more reasonable to use the PKCS#11 module provided by AWS. We could add an |
Hey @ebourg we are currently using cloudHSM and would be glad to test out whatever code you write on our CloudHSM instance. We are currently struggling with writing a valid We have a bunch of keys that our cert provider gave us and are stored on the HSM cluster like this (this is the truncated output of
We tried setting it up by creating a
Or with But we kept running into parsing errors. Do you perhaps have some suggestions on how we might go about getting this to work? The HSM has this proprietary binary called I am imagining that these aspects of code signing are somehow part of the We would be glad to assist in debugging this and I imagine it should be possible to even get it to work by just using the existing CLI with some particular flags using the generic We were able to get authentication to work using:
Where Could you perhaps give us some help on how we might go about getting this to work? We would be glad to run commands on our cluster to help you help us get this working. Thank you so much for your time and assistance. |
@hellais Did you check if the CloudHSM instance is available as a keystore for AWS KMS?
What error message or stacktrace did you get with this syntax? |
I am going to try going this route, but it's quite a few hoops to jump through because we must use CloudHSM since it's a requirement to having an EV code signing cert. I will let you know how it goes.
When I run that command using:
I get:
While when I put in the config this:
I get the following error stack trace:
The output of the first command makes me believe that authentication to the PKCS11 provider is actually working (if I don't pass in the |
I think I am making some progress. I have gotten to the point where I have a different error when I run:
Where
(the issue I think was that I was putting I now get this error:
Any ideas on how I can get it to pick up the cert chain? |
I have tested this and unfortunately it's only possible to use KMS to use CloudHSM as a custom backend to create new keys. Since we already have our keys from our EV cert issuer (after having done the ceremony to issue the keys on an HSM), it's not a viable option, since we need to use the existing keys inside of CloudHSM. CloudHSM should be compliant with PKCS11 so I believe there should be some way to massage the SunPKCS11 config to get it to work, I'm probably just missing a few pieces, see: #179 (comment) |
@hellais You could try setting the
or:
|
Thanks for the reply, I tried setting the alias, both as the key label and as the key id, but still it doesn't seem to be working. |
You may get some hints about the underlying issue by enabling the SunPKCS11 debugging mode:
|
As best I can tell there is currently no native support for accessing private keys stored in Amazon's CloudHSM service. It would be great if this feature could be added.
The text was updated successfully, but these errors were encountered: