-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HashiCorp Vault key manager plugin to SPIRE server #5500
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
…e#5058) Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
Signed-off-by: Matteo Kamm <[email protected]>
77f7ce0
to
42bc673
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @InverseIntegral, thank you very much for this contribution.
I'm still going over this PR, but the first high-level comment that I wanted to provide is that we will need integration tests that exercise this plugin. It should be a new suite added to our integration test framework: https://github.com/spiffe/spire/tree/main/test/integration
I'll be adding more comments as I make progress with the review :) Thank you again for this contribution!
| client_key_path | string | | Path to a client private key file. Only PEM format is supported. | `${VAULT_CLIENT_KEY}` | | ||
|
||
```hcl | ||
UpstreamAuthority "vault" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpstreamAuthority "vault" { | |
KeyManager "hashicorp_vault" { |
| token | string | | Token string to set into "X-Vault-Token" header | `${VAULT_TOKEN}` | | ||
|
||
```hcl | ||
UpstreamAuthority "vault" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpstreamAuthority "vault" { | |
KeyManager "hashicorp_vault" { |
| approle_secret_id | string | | A credential of AppRole | `${VAULT_APPROLE_SECRET_ID}` | | ||
|
||
```hcl | ||
UpstreamAuthority "vault" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpstreamAuthority "vault" { | |
KeyManager "hashicorp_vault" { |
| token_path | string | ✔ | Path to the Kubernetes Service Account Token to use authentication with the Vault | | | ||
|
||
```hcl | ||
UpstreamAuthority "vault" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpstreamAuthority "vault" { | |
KeyManager "hashicorp_vault" { |
Signed-off-by: Matteo Kamm <[email protected]>
Thank you @amartinezfayo for the initial review and sorry for the delay on my end. I will add integration tests to test the plugin more thoroughly 👍 |
| namespace | string | | Name of the Vault namespace. This is only available in the Vault Enterprise. | `${VAULT_NAMESPACE}` | | ||
| transit_engine_path | string | | Path of the transit engine that stores the keys. | transit | | ||
| ca_cert_path | string | | Path to a CA certificate file used to verify the Vault server certificate. Only PEM format is supported. | `${VAULT_CACERT}` | | ||
| insecure_skip_verify | bool | | If true, vault client accepts any server certificates | false | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a note here, that this is only for test environments.
Namespace: p.getEnvOrDefault(envVaultNamespace, config.Namespace), | ||
TransitEnginePath: p.getEnvOrDefault(envVaultTransitEnginePath, config.TransitEnginePath), | ||
CACertPath: p.getEnvOrDefault(envVaultCACert, config.CACertPath), | ||
TLSSKipVerify: config.InsecureSkipVerify, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should log a warning if InsecureSkipVerify is set to true.
Signed-off-by: Matteo Kamm <[email protected]>
Pull Request check list
Affected functionality
This MR introduces a new SPIRE server key manager plugin that uses HashiCorp Vault to manage keys.
Description of change
This change adds a new key manager plugin to SPIRE server named
hashicorp_vault
. It uses a transit secrets engine within HashiCorp Vault to manage keys and sign data. The client is largely based on the existing upstream authority plugin for HashiCorp Vault which was introduced in #1611 by @hiyosi.Which issue this PR fixes
This PR fixes #5058
Note that this is my first time implementing such a plugin and I expect there to be a lot of open questions and expected changes. I'm really looking forward to any feedback! ❤️