···11-# Multi-stage distroless Dockerfile for maximum security with USB access
22-# Phase 2: Root + Distroless - compensates for root requirement with minimal attack surface
33-41# Stage 1: Go builder (also serves as dependency source)
52FROM golang:1.24-trixie AS builder
63ARG TARGETOS
···1916 libpcsclite-dev \
2017 libusb-1.0-0-dev \
2118 && rm -rf /var/lib/apt/lists/*
2222-2323-# Create necessary runtime directories
2424-RUN mkdir -p /run/pcscd /var/run/pcscd /var/lock/pcsc && \
2525- chmod 755 /run/pcscd /var/run/pcscd /var/lock/pcsc
26192720# Create minimal /etc/passwd and /etc/group for nonroot user (65532:65532)
2821RUN echo "nonroot:x:65532:65532:nonroot:/:" > /tmp/passwd && \
···133126134127# Copy CA certificates
135128COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
136136-137137-# Copy runtime directories (pcscd will use these)
138138-COPY --from=builder /var/run/pcscd /run/pcscd
139139-COPY --from=builder /var/lock/pcsc /var/lock/pcsc
140129141130# Copy application binary (manages pcscd lifecycle internally - no shell needed)
142131COPY --from=builder /workspace/hsm-operator /hsm-operator
+1-1
Makefile
···33# To re-generate a bundle for another specific version without changing the standard setup, you can:
44# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
55# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
66-VERSION ?= 0.6.33
66+VERSION ?= 0.6.34
7788# CHANNELS define the bundle channels used in the bundle.
99# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
+2-2
helm/hsm-secrets-operator/Chart.yaml
···22name: hsm-secrets-operator
33description: A Kubernetes operator that bridges Pico HSM binary data storage with Kubernetes Secrets
44type: application
55-version: 0.6.33
66-appVersion: v0.6.33
55+version: 0.6.34
66+appVersion: v0.6.34
77icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/kubernetes/icon/color/kubernetes-icon-color.svg
88home: https://github.com/evanjarrett/hsm-secrets-operator
99sources:
+12-2
internal/agent/pcscd_manager.go
···56565757 p.logger.Info("Starting pcscd daemon")
58585959+ // Ensure runtime directories exist (volumes may be empty initially)
6060+ dirs := []string{"/run/pcscd", "/var/lock/pcsc"}
6161+ for _, dir := range dirs {
6262+ if err := os.MkdirAll(dir, 0755); err != nil {
6363+ p.logger.Error(err, "Failed to create runtime directory", "dir", dir)
6464+ return fmt.Errorf("failed to create runtime directory %s: %w", dir, err)
6565+ }
6666+ p.logger.V(1).Info("Runtime directory ready", "dir", dir)
6767+ }
6868+5969 // Start pcscd with:
6070 // -f: foreground mode (don't daemonize)
7171+ // -d: debug output (helps troubleshooting)
6172 // --disable-polkit: disable PolicyKit (no D-Bus in container)
6262- // Note: Removed -d and -a debug flags for production - add back if needed
6363- p.cmd = exec.CommandContext(p.ctx, "/usr/sbin/pcscd", "-f", "--disable-polkit")
7373+ p.cmd = exec.CommandContext(p.ctx, "/usr/sbin/pcscd", "-f", "-d", "--disable-polkit")
64746575 // Pipe output to parent process for centralized logging
6676 p.cmd.Stdout = os.Stdout