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

MySQL for GCP Cloud SQL support #7146

Closed
r0mant opened this issue Jun 2, 2021 · 0 comments · Fixed by #7302
Closed

MySQL for GCP Cloud SQL support #7146

r0mant opened this issue Jun 2, 2021 · 0 comments · Fixed by #7302
Labels
database-access Database access related issues and PRs db/mysql MySQL related database access issues feature-request Used for new features in Teleport, improvements to current should be #enhancements

Comments

@r0mant
Copy link
Collaborator

r0mant commented Jun 2, 2021

What

Teleport database access currently doesn't support GCP-hosted MySQL databases.

The reason is that we use IAM authentication with databases which MySQL engine doesn't support (only Postgres does). The only auth method Cloud SQL MySQL supports is username/password. There's also no indication from GCP folks when or whether IAM support for MySQL will become available.

As such, we might need to come up with alternative way to authenticate to GCP-hosted MySQL databases.

How

GCP has an API for updating database user's password:

https://cloud.google.com/sql/docs/mysql/create-manage-users#changing_a_user_password
https://pkg.go.dev/google.golang.org/[email protected]/sqladmin/v1beta4#UsersService.Update
https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/users/update

See if we can use it to implement short-lived throw-away tokens for database users - i.e. update the user's password to a random value before each connect and use it as a password to connect.

One thing to keep in mind is how to handle clients connecting concurrently as the same database account?

Why

To support MySQL in GCP.

Workaround

None.

@r0mant r0mant added feature-request Used for new features in Teleport, improvements to current should be #enhancements database-access Database access related issues and PRs db/mysql MySQL related database access issues labels Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database-access Database access related issues and PRs db/mysql MySQL related database access issues feature-request Used for new features in Teleport, improvements to current should be #enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant