feat: implement Hashicorp Vault Kubernetes authentication support#1195
feat: implement Hashicorp Vault Kubernetes authentication support#1195vitali-zevako wants to merge 1 commit into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
818bc9c to
b81fccb
Compare
|
recheck |
|
I have read the CLA Document and I hereby sign the CLA |
|
@usmansaleem hi, is there any chance that this feature will be included in next releases or we have to fork? thank you |
|
@vitali-zevako Yes, its on my plate to review (was bogged down with some other tickets), planning to review/merge by end of next week at max. It will make part of next release. |
usmansaleem
left a comment
There was a problem hiding this comment.
A changelog entry under Features Added, something on the lines of:
### Features Added
- Support for Hashicorp Vault Kubernetes authentication [PR 1195](https://github.com/Consensys/web3signer/pull/1195)
usmansaleem
left a comment
There was a problem hiding this comment.
some suggestions, otherwise LGTM.
|
Local testing document: |
|
@vitali-zevako one of your commit has a different id (hence CLA failing). Easiest is to rebase and push as a single commit so that your commits are associated with a single account. |
57e5b93 to
897d429
Compare
897d429 to
7dfce08
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit ee01471. Configure here.
4b0855f to
feca4ca
Compare
feca4ca to
dc7193d
Compare
dc7193d to
2379e51
Compare
|




PR Description
This PR implements native Kubernetes Service Account authentication for Hashicorp Vault, allowing Web3Signer to authenticate with Vault without requiring a static token.
Key Changes
KUBERNETESas a validauthMethodinHashicorpSigningMetadata.authenticateWithKubernetesinHashicorpConnectionto exchange a K8s JWT for a Vault client token using the/v1/auth/kubernetes/loginendpoint.kubernetesRole,kubernetesAuthPath(default:kubernetes), andkubernetesServiceAccountTokenPath(default:/var/run/secrets/kubernetes.io/serviceaccount/token).AbstractArtifactSignerFactoryto support dynamic token acquisition.tokenauthentication.Fixed Issue(s)
None.
Documentation
doc-change-requiredlabel to this PR if updates are required.Changelog
Testing
Note
Medium Risk
Changes Vault authentication and secret-loading paths for Hashicorp signers; misconfiguration could block key load, though TOKEN remains default and auth-path validation reduces path injection risk.
Overview
Adds HashiCorp Vault Kubernetes auth so Hashicorp signing metadata can obtain a Vault client token from the pod service-account JWT instead of a static
token.HashicorpSigningMetadatagainsauthMethod(TOKENdefault,KUBERNETES), optionalkubernetesRole,kubernetesAuthPath, andkubernetesServiceAccountTokenPath;tokenis no longer required at deserialization time and is validated whenTOKENis selected.AbstractArtifactSignerFactoryexchanges the JWT viaHashicorpConnection.authenticateWithKubernetesbefore secret reads, resolving relative token paths against the config directory.The keystorage layer implements login (
POST /v1/auth/<path>/login), JWT file read, response parsing, and auth-path hardening (reject./../ empty segments). Vault HTTP calls now restore interrupt status onInterruptedException. Coverage includes unit tests, YAML deserialization tests, and a MockServer integration test; the changelog records the feature.Reviewed by Cursor Bugbot for commit 2379e51. Bugbot is set up for automated code reviews on this repo. Configure here.