-
Notifications
You must be signed in to change notification settings - Fork 71
Investigate support for multiple providers of the same type #404
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
Comments
As well as clients communication another affected area of using multiple providers of the same tyme is the key mappings. Currently the static key ID itself is used to identify a provider but that would not work with two providers with the same ID. While investigating on #394, I came up with two other possibilities that could solve both areas. I like the first one much more but give the other for reference: Move to dynamic provider IDsAs you said providers are Add multiple provider "copies"We could add one copy (or multiple) of our existing providers. For example |
Agreed. Actually it's not that inconceivable to have two TPM modules. Especially for tests it would be very beneficial two have it (e.g. testing TPM key migration requires two TPM "instances"). Another example: KMIP. I'm just starting to take a look at Parsec so excuse my ignorance but it would be cool if I could tell the library "please sign using key 3 on token with serial number 327923 via PKCS#11 library libykcs11.so" and it would work even if I plug the token to a different port or restart the computer. I believe the PKCS#11 library should be instantiated using "library libykcs11.so + serial number 327923" and detect which slot is it. There is a simpler version that just says "slot #1" but that doesn't take into account replugging devices in different ports. On the other hand Subscribed to this issue, thanks for considering this! 👋 |
So right now the instantiation of the PKCS 11 provider takes as inputs: the path to the If I understood correctly, you are saying that the slot number will change if you replug the HSM or restart the computer but the serial number will stay the same so a better way to instantiate a PKCS11 provider would be via: That makes sense to me I think! Also related: #375 which makes serial number or slot not needed if there is only one anyway. A few questions:
Our config file needs to stay stable. That means that if we add a new |
I actually have code for that (based on Currently I'm looping through all slots getting token info that contains the serial number to find the slot number with the given token. I've got quite some number of tokens and serial numbers are printed on them so it's more convenient in my case. I understand this may not hold for parsec in general. |
Coming back to the original topic, part of the requirement was already implemented in #491 , allowing providers to be identified through names. When we finish the move to the SQLite provider we can start work on this to enable (psuedo-)randomized provider IDs, and thus multiple providers of the same type. |
Summary
This is an investigation/design ticket - how would the service be enhanced so that multiple providers of the same type could be running in the service and used effectively by clients without breaking stability? The service is currently limited to running only a single provider of any given type.
Rationale
Providers are conceptually classes rather than instances. A provider instance is a combination of its class/type and its specific configuration, which points it towards a back-end software/hardware component. In the service today, this class/instance distinction can't be exploited. All providers are effectively singletons because they are addressed with an inflexible integer ID.
There are some valid situations where we might want to deploy Parsec with multiple instances of the same provider. This is particularly the case with the PKCS#11 provider, where we might want to use multiple slots on an HSM, or even more than one PKCS#11 library - such as one that talks to a local HSM, while another talks to an HSM in the Cloud or over a LAN.
Of the providers that exist today, PKCS#11 is probably the one that offers the strongest rationale for multiple instances. The benefits are less clear-cut for the others, but we should aim for a general-purpose solution and not favour PKCS#11 specifically.
Design Considerations
Allowing multiple providers of the same type to run within the service is, by itself, relatively straightforward. What is much less straightforward is designing a mechanism that allows clients to use them effectively, especially given that we need to preserve backwards compatibility and not introduce a breaking change to the way that clients select providers, either explicitly by ID or implicitly through self-configuration and preferential mechanisms.
It is not just about backwards-compatibility. It is also about giving clients an ergonomic experience that is sensitive to their expected workflow and use case.
There might not be a one-size-fits-all answer to this. It might be about supporting multiple mechanisms over time.
Some possibilities - not necessarily mutually exclusive, and these are only enabling mechanisms that do not represent a complete design.
Definition of Done
This ticket is to agree a design - we can consider it "done" once we have a design proposal in place with a suitable level of community review, and tickets have been raised to cover the implementation (or part of it, if this can be phased in some way).
The text was updated successfully, but these errors were encountered: