Skip to content

Pluggable provider architecture with Nitrokey HSM support#1

Merged
jdoss merged 11 commits intomasterfrom
provider-refactor
Apr 1, 2026
Merged

Pluggable provider architecture with Nitrokey HSM support#1
jdoss merged 11 commits intomasterfrom
provider-refactor

Conversation

@jdoss
Copy link
Copy Markdown
Contributor

@jdoss jdoss commented Apr 1, 2026

Summary

  • Rename from Podman Secret Infisical to Podman Secret Infrastructure (PSI)
  • Add SecretProvider protocol and provider registry for pluggable secret backends
  • Extract all Infisical code into psi/providers/infisical/ with no behavior changes
  • Add Nitrokey HSM provider (psi/providers/nitrokeyhsm/) that encrypts secrets at store time and decrypts via PKCS#11 at container start
  • Config uses providers: dict instead of top-level Infisical fields
  • JSON mapping format with provider discriminator replaces the old colon-separated format
  • Generated drop-ins use Wants= instead of Requires= to prevent cascade failures
  • Containerfile switched to Fedora runtime for pcscd socket compatibility
  • Provider docs at docs/infisical-provider.md and docs/nitrokeyhsm-provider.md

Nitrokey HSM provider

  • Hybrid encryption: AES-256-GCM for data, RSA-OAEP-SHA256 for key wrapping
  • PIN resolves from systemd-creds (TPM-sealed), config pin field, or PSI_NITROKEYHSM_PIN env var
  • CLI: psi nitrokeyhsm preflight, setup-pcscd, init, store, test-pin, status
  • pcscd sidecar setup command builds the container image and installs quadlet units

Test plan

  • 161 unit tests pass
  • Deployed to test server with both providers active
  • Infisical provider serves 506 secrets across 50+ workloads
  • 4 Infisical bootstrap secrets encrypted with Nitrokey HSM, round-trip verified
  • Infisical boots with HSM-decrypted credentials
  • PIN sealed to vTPM via systemd-creds, resolved inside container

jdoss added 11 commits March 31, 2026 23:19
Rename from Podman Secret Infisical to Podman Secret Infrastructure.
Add SecretProvider protocol so multiple secret backends coexist behind
a single shell driver.

Infisical provider: all Infisical code moved to psi/providers/infisical/
with no behavior changes. Config nests under providers.infisical.

NitroHSM provider: new backend that encrypts secrets with a Nitrokey HSM
via PKCS#11. Hybrid encryption (AES-256-GCM + RSA-OAEP-SHA256). PIN
resolves from systemd-creds (TPM-sealed), config, or env var. Includes
preflight checks and pcscd sidecar setup command.

secret.py and serve.py dispatch to providers via JSON mapping format.
Generated drop-ins use Wants= instead of Requires= to prevent cascade
failures. Containerfile switched to Fedora runtime for pcscd socket
compatibility.
Rename the provider directory, config key, CLI subcommand, and env var
from nitrohsm to nitrokeyhsm. Use "Nitrokey HSM" (with space) in all
user-facing text and documentation. Code identifiers use NitrokeyHSM.
boto3, cryptography, and PyKCS11 are now core dependencies instead of
optional extras. Removes all ty: ignore[unresolved-import] comments
and simplifies the Containerfile. The only remaining optional extra
is dbus-python (needed for systemd D-Bus reload in containers).
All dependencies are now core. The dbus import fallback to systemctl
stays for distros without D-Bus development libraries.
Build the test container target from source in every PR, then run
lint, type check, and unit tests inside it. Also builds the production
container and verifies the entrypoint. No host-level Python or build
tooling needed in the GitHub Actions runner.
Build the test container first, run lint/ty/pytest inside it, then
build the production image and push to GHCR. Tags :latest on master.
No host-level Python tooling needed on the Buildkite agent.
@jdoss jdoss merged commit d038d0c into master Apr 1, 2026
2 checks passed
@jdoss jdoss deleted the provider-refactor branch April 1, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant