Skip to content
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

fix: use local token for TokenReviewer JWT only when using token for CA crt (#93) #94

Closed

Conversation

cyrus-mc
Copy link

PR #83 added ability to read ca.crt and TokenReviewer JWT from the default service account under which Vault is running.

This ended up causing a breakage when trying to authenticate against external clusters in which no TokenReview JWT is specified in the configuration.

The changes in this PR make the assumption that the default service account TokenReviewer JWT should only be used if no CA certificate (or pem keys) are supplied and therefore they are read from the default service account.

@cyrus-mc
Copy link
Author

A more elegant solution might be to determine somehow if the auth backend represents an in-cluster config. Key off the hostname (although that might not be 100% conclusive). Or add another option to the config that indicates this.

As token_reviewer_jwt is an optional setting, assuming its value when it isn't set is not correct.

@eh-steve
Copy link
Contributor

I'd be happy with this, though we should probably update the docs to explain the default behaviour under each of these 3 cases:

  • No CA and no token reviewer JWT set (default to local Vault SA credentials if present, otherwise error)
  • CA set, no token reviewer JWT (defaults to using the JWT to be verified as the token reviewer JWT - requires giving your SAs which need to authenticate the system:auth-delegator role)
  • Both CA and token reviewer JWT set, (explicitly uses the provided credentials)

@cyrus-mc
Copy link
Author

cyrus-mc commented Aug 4, 2020

Any further discussion required on this? With the current state the docs don’t match the actual functionality.

@yurifrl
Copy link

yurifrl commented Aug 19, 2020

So, I'm getting this error

failed to request new Vault token Error making API request.\n\nURL: PUT $VAULT_ADDR/v1/auth/$ENGINE/login\nCode: 400. Errors:\n\n* missing client token

Is that related?

@tvoran tvoran added the bug label Sep 16, 2020
@tvoran tvoran self-requested a review September 16, 2020 00:51
@tvoran
Copy link
Member

tvoran commented Sep 29, 2020

Hi folks, thanks for the discussion and contribution here, but we decided to add an explicit option to control this behavior, which was released in vault 1.5.4; see #97 and hashicorp/vault#9992 for the details.

@tvoran tvoran closed this Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants