···2222 udevadm settle --timeout=2 2>/dev/null || true
2323 fi
24242525- # Apply CCID interface fix for Pico HSM
2626- echo "Applying CCID interface fix for Pico HSM..."
2727-2828- # Check if we can modify the CCID configuration
2929- CCID_CONFIG="/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist"
3030- if [ -f "$CCID_CONFIG" ]; then
3131- # Create backup
3232- cp "$CCID_CONFIG" /tmp/Info.plist.backup
3333-3434- echo "Original CCID driver options:"
3535- grep -A 1 "ifdDriverOptions" "$CCID_CONFIG" || echo "Not found"
3636-3737- # Fix: Enable CCID Exchange option (0x01) for interface flexibility
3838- # This makes CCID more permissive about interface selection
3939- if grep -q "<string>0x0000</string>" "$CCID_CONFIG"; then
4040- sed -i 's/<string>0x0000<\/string>/<string>0x0001<\/string>/' "$CCID_CONFIG"
4141- echo "✅ Enabled DRIVER_OPTION_CCID_EXCHANGE_AUTHORIZED (0x01)"
4242- else
4343- echo "⚠️ CCID driver options already modified or not found"
4444- fi
4545-4646- echo "Modified CCID driver options:"
4747- grep -A 1 "ifdDriverOptions" "$CCID_CONFIG" || echo "Not found"
4848-4949- echo "CCID interface fix applied:"
5050- echo "- Pico HSM interface 0 should now be tried first"
5151- echo "- CCID will be more flexible about interface detection"
5252- echo "- Debug environment variables: LIBCCID_ifdLogLevel=$LIBCCID_ifdLogLevel"
5353- else
5454- echo "❌ CCID Info.plist not found at $CCID_CONFIG"
5555- echo "Falling back to environment variables only"
5656- fi
5757-5858- # Start pcscd with debug output
5959- echo "Starting pcscd..."
2525+ # Start pcscd (no CCID drivers available, will use direct access)
6026 pcscd -f -d -a &
6127 PCSCD_PID=$!
62286329 sleep 3
64306565- # Verify pcscd started successfully
3131+ # Verify pcscd started
6632 if ! kill -0 $PCSCD_PID 2>/dev/null; then
6733 echo "ERROR: pcscd failed to start"
6868- echo "Checking USB access permissions..."
6969- # Try to access a USB device to see the actual error
7070- cat /dev/bus/usb/001/001 > /dev/null 2>&1 || echo "Cannot read USB devices: $?"
7134 exit 1
7235 fi
7373-7474- echo "pcscd started successfully with PID $PCSCD_PID"
7536fi
76377738# Entrypoint script for HSM Secrets Operator
+1-1
internal/controller/hsmpool_agent_controller.go
···665665 },
666666 SecurityContext: &corev1.SecurityContext{
667667 Privileged: truePtr, // Still no privileged containers
668668- AllowPrivilegeEscalation: falsePtr, // Still no privilege escalation
668668+ AllowPrivilegeEscalation: truePtr, // Still no privilege escalation
669669 ReadOnlyRootFilesystem: falsePtr, // Possible with distroless
670670 RunAsNonRoot: falsePtr, // Root required for USB
671671 RunAsUser: &rootUserId,