Replies: 2 comments 4 replies
-
I haven't tested this, but I think you'll have to figure out what USB device the YubiKey is using, and then grant that device to the container—eg, using |
Beta Was this translation helpful? Give feedback.
-
I was able to get the HSM image working with a YubiKey on a K3s cluster with Akri without root. The main issue I ran into is that CRI-O ignores device permissions (For me, the device was owned by
A few notes on this udev rule:
Then run apiVersion: akri.sh/v0
kind: Configuration
metadata:
name: yubikey
spec:
capacity: 1
discoveryHandler:
name: udev
discoveryDetails: |
groupRecursive: true
udevRules:
- ATTRS{idVendor}=="YOUR_VID", ATTRS{idProduct}=="YOUR_PID"
permissions: rwm and stateful set: apiVersion: apps/v1
kind: StatefulSet
# ...
spec:
# ...
template:
# ...
spec:
securityContext:
fsGroup: 1000
containers:
- name: step-ca
image: smallstep/step-ca:hsm
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
seccompProfile:
type: RuntimeDefault
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
command:
- /bin/sh
- -c
- |
# Start the PC/SC daemon
pcscd
# Start Smallstep CA
exec /usr/local/bin/step-ca /path/to/your/config/ca.json
resources:
requests:
akri.sh/yubikey-ID_HERE: "1" # Get the actual ID from kubectl get instances.akri.sh
limits:
akri.sh/yubikey-ID_HERE: "1" # Get the actual ID from kubectl get instances.akri.sh
# ... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've noticed there are two docker images: standard one and an HSM one: https://hub.docker.com/r/smallstep/step-ca
We would like to use the HSM one and use a Yubikey plugged on the host machine. Each of our containers must follow the least privilege principle and we are not able to find out whether some capabilities are required to use this HSM image.
I've noticed on the helm chart, in the default values (https://artifacthub.io/packages/helm/smallstep/step-certificates?modal=values), that the security contexts are restricted:
Is it accurate only for the standard docker image or is it true for the HSM one too?
May you confirm which privileges are required to run the HSM docker image? How do we grant access to the yubikey plugged on the host?
Thanks,
Alex
Beta Was this translation helpful? Give feedback.
All reactions