-
Notifications
You must be signed in to change notification settings - Fork 5
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
config endpoint implementation #2
Conversation
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.
Awesome, and nice tests! Just a few minor suggestions
path_config.go
Outdated
if config.DisableLocalCAJwt && config.CACert == "" { | ||
return logical.ErrorResponse("kubernetes_ca_cert must be given when disable_local_ca_jwt is true"), nil | ||
} |
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.
There is a fairly popular issue in the auth repo to get rid of this requirement: hashicorp/vault-plugin-auth-kubernetes#62
I think it should be ok to just skip it, and assume that the API is either safely exposed over HTTP (some kind of lower layer network encryption/authentication via VPN/proxy), or uses a publicly trusted CA like for AWS ELBs.
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.
Makes sense to me, removed in 7cbb6b3.
Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Tom Proctor <[email protected]>
…-secrets-kubernetes into VAULT-5669/config
Also check for k8s env vars if the host isn't set during config write.
Overview
Implements the config endpoint for the secrets engine.
Design of Change
Adds config parameters to the backend:
kubernetes_host (string: ""
): Kubernetes API URL to connect to. Defaults tohttps://$KUBERNETES_SERVICE_HOST:KUBERNETES_SERVICE_PORT_HTTPS
if those environment variables are set.service_account_jwt (string: "")
: The JSON web token of the service account used by the secret engine to manage Kubernetes roles. Defaults to the local pod’s JWT if found.kubernetes_ca_cert (string: "")
: PEM encoded CA certificate to use by the secret engine to verify the Kubernetes API server certificate. Defaults to the local pod’s CA if found.disable_local_ca_jwt (bool: false)
: Disable defaulting to the local CA certificate and service account JWT when running in a Kubernetes pod.Uses the caching file reader introduced in https://github.com/hashicorp/vault-plugin-auth-kubernetes for reading the local pod's JWT and CA.
Related Issues/Pull Requests
Depends on:
Contributor Checklist
TODO: