feat: allow provisioner password from env var or file - #365
Merged
Conversation
The provisioner password could previously only be supplied through a Kubernetes Secret referenced by spec.provisioner.passwordRef. Add two optional, mutually-exclusive alternatives that read the password from the step-issuer controller pod itself: - passwordEnv: name of an environment variable - passwordFile: path to a file on the controller's filesystem This lets the password be injected with tools like HashiCorp Vault / Vault Agent without first storing it in a Kubernetes Secret, and needs no extra RBAC. A trailing newline is trimmed from both sources. passwordRef is now optional; validation requires exactly one of the three sources. Because the env var name / file path is configured per issuer, multiple issuers with distinct passwords remain supported. Password resolution is factored into resolveProvisionerPassword and shared by the StepIssuer and StepClusterIssuer controllers. Regenerated the CRDs to expose the new fields, documented the options in the README, and added unit tests for resolution and validation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
joshdrake
marked this pull request as ready for review
June 24, 2026 16:33
maraino
previously approved these changes
Jun 24, 2026
maraino
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, I've tested the 3 options and they work.
This commit fixes a couple of vulnerabilities reported by govulncheck
maraino
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two optional, mutually-exclusive ways to supply the JWK provisioner password to a
StepIssuer/StepClusterIssuer, alongside the existing KubernetesSecretreference:spec.provisioner.passwordRef(existing)spec.provisioner.passwordEnvspec.provisioner.passwordFileMotivation
Requested by a user deploying step-issuer who manages secrets with HashiCorp Vault / Vault Agent and hasn't adopted Kubernetes Secrets. Previously the password could only come from a Secret read via the Kubernetes API, so there was no way to consume a password that Vault injects into the controller pod.
passwordEnv/passwordFileread from the controller's own environment / filesystem, so they need no Secret and no extra RBAC.Details
passwordRefis now optional; validation requires exactly one of the three sources (controllers/password.go: validateProvisionerPasswordSource).resolveProvisionerPasswordand shared by both issuer controllers.Secretdata is used verbatim, so existing behavior is unchanged.Test plan
go build ./...,go vet ./...,gofmtgo test ./api/... ./controllers/...— new unit tests for resolution + validationgolangci-lintwith the smallstep/workflows config — 0 issuesmake generate— CRDs + deepcopy regenerate cleanlypasswordFile/passwordEnvand confirm the issuer reachesReady🤖 Generated with Claude Code