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

Bug Report: Vault approle token is not refreshed after max-ttl is reached #16804

Open
flopex opened this issue Sep 18, 2024 · 1 comment
Open
Labels
Component: Authn/z Authentication / Authorization / Certificates Type: Bug

Comments

@flopex
Copy link

flopex commented Sep 18, 2024

Overview of the Issue

Vitess is unable to request a new Vault (approle) token after the initial token reaches max number of renewals.

On vttablet startup, Vitess is able to request a Vault token using the supplied approle role-id/secret-id combo. The token given has a lease TTL of 2hrs and max-lease TTL of 24h.

Currently, Vitess is unable to determine it has reached max renewal attempts, after which it should relogin against Vault and request a new token.

This currently causes it to not be able fetch the vttablet-credentials at the set polling interval.

Reproduction Steps

Launch any vttablet that uses vault for the credentials-server

      --db-credentials-server=vault
      --db-credentials-vault-addr=https://xxx:8200/
      --db-credentials-vault-path=secrets/vitess/vt-tablet/credentials.json
      --db-credentials-vault-tls-ca=privateca.crt
      --db-credentials-vault-ttl=60s

With VAULT_ROLEID and VAULT_SECRETID env variables passed.

Binary Version

vttablet --version
Version: 16.0.3 (Git revision a93cb55331d63eeb4a0dc6ed1b5f98429c350f04 branch 'heads/v16.0.3') built on Thu Sep 12 20:35:55 UTC 2024 by root@buildkitsandbox using go1.20.5 linux/amd64

Operating System and Environment details

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

$ uname -sr
Linux 5.15.0-1068-aws

$ uname -m
x86_64

Log Fragments

vttablet log for token renewal fail: https://gist.github.com/flopex/33018e8ba15c7d11a8a8b7f12cfb2a32
@flopex flopex added Needs Triage This issue needs to be correctly labelled and triaged Type: Bug labels Sep 18, 2024
@deepthi deepthi added the Component: Authn/z Authentication / Authorization / Certificates label Sep 20, 2024
@deepthi
Copy link
Member

deepthi commented Sep 20, 2024

@flopex this is something where it will be nice if you can propose a fix via PR. The maintainer team is not setup to debug and test vault authentication.

@deepthi deepthi removed the Needs Triage This issue needs to be correctly labelled and triaged label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Authn/z Authentication / Authorization / Certificates Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants