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

Can YubiHSM2 device supports multiple containers outside Device? #403

Open
hamda-almenhali opened this issue May 27, 2024 · 1 comment
Open

Comments

@hamda-almenhali
Copy link

Setting:
We have two or more ubuntu docker containers running on a single host Ubuntu/MacOS computer.
We have attached YubiHSM to the host machine via USB.

Requirement:
We need to perform independent cryptographic operations via processes running on each of these docker containers.
These cryptographic operations shall use YubiHSM.

Question:
Is it possible for more than one docker container to use the single YubiHSM concurrently?
Is it possible for more than one docker container to use the single YubiHSM non-concurrently?
To do any of the above, do we need any synchronization mechanism?
Is there a minimum reproducible example that YubiCo can share with us, to demonstrate the above requirements?

Requirement
@qpernil
Copy link
Contributor

qpernil commented May 27, 2024

The simplest would be to run the yubihsm-connector on the host machine, which would be talking to the USB device. The clients would then use the http backend to talk to the connector over http. You would have to enable the docker containers to connect to the host IP and port that the connector is listening to. Concurrency is then managed by yubihsm-connector, which contains a mutex around all USB access. This means all access is serialized, as the yubihsm can only process one request at a time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants