[vault-secrets-webhook] Incorrect audience for JWT tokens #78
Labels
good first issue
Good for newcomers
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/stale
Denotes an issue or PR that has become stale and will be auto-closed.
Describe the bug:
bank-vaults/bank-vaults#1752 added new feature that creates SA JWT tokens using api-server if they are not created automatically, which is now the default behaviour for k8s 1.24. When this token is created it is given explicit/hardcoded
audience
claim which makes this token invalid when it's used to authenticate with k8s api-server. Vault kubernetes auth backend can either use it's own JWT to create token reviews or it can use token presented by client. In the latter case this now fails because audience does not match.Expected behaviour:
Tokens created by vault-secrets-webhook should not have audience claim specified or at least this claim should be configurable using annotations.
Steps to reproduce the bug:
token_reviewer_jwt
so it uses tokenpresented on login to create token reviews
Additional context:
When kubernetes auth fails vault gives this error log. It tries to use token created by vault-secrets-webhook to lookup JWT with tokenReview API but fails because this JWT is unauthorized due to invalid audience:
Environment details:
/kind bug
The text was updated successfully, but these errors were encountered: