Skip to content

fix: enable Vault JWT auth without Spire for KMS signing#1616

Open
infernus01 wants to merge 1 commit intotektoncd:mainfrom
infernus01:vault-auth
Open

fix: enable Vault JWT auth without Spire for KMS signing#1616
infernus01 wants to merge 1 commit intotektoncd:mainfrom
infernus01:vault-auth

Conversation

@infernus01
Copy link
Copy Markdown
Member

@infernus01 infernus01 commented Apr 8, 2026

Changes

Setting signers.kms.auth.oidc.path and signers.kms.auth.oidc.role in the Chains ConfigMap without Spire does nothing. The OIDC path and role are parsed correctly but never used — the code falls through to VAULT_TOKEN /~/.vault-token and fails:
error configuring kms signer with config {hashivault://supply-chain {http://vault.vault:8200/ {jwt tekton-chains} { }}}: read .vault-token file: open /home/nonroot/.vault-token: no such file or directory

Now with this PR, when OIDC path/role are configured and no Spire or static token is present, read the Kubernetes service account token from /var/run/secrets/kubernetes.io/serviceaccount/token and use it for Vault JWT auth. A new config key signers.kms.auth.oidc.token-path allows overriding the default path.
Priority order: Spire → static token → K8s SA token

fixes: #1479

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot requested review from jkhelil and wlynch April 8, 2026 06:49
@tekton-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign jkhelil after the PR has been reviewed.
You can assign the PR to them by writing /assign @jkhelil in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 8, 2026
@infernus01
Copy link
Copy Markdown
Member Author

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 8, 2026
When signers.kms.auth.oidc.path and signers.kms.auth.oidc.role are set
in the Chains ConfigMap without Spire, the controller now reads the
Kubernetes service account token from the pod filesystem and uses it for
Vault JWT auth login. Previously, the OIDC token field was only populated
by Spire, causing the code to fall through to VAULT_TOKEN lookup and fail
with "read .vault-token file: no such file or directory".

Signed-off-by: Shubham Bhardwaj <shubbhar@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JWT auth with Vault KMS doesn't work

2 participants