-
Notifications
You must be signed in to change notification settings - Fork 351
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
Cutting down permissions to a minimum #362
Comments
The Cloud SQL Client is a role specifically designed for use the with Cloud SQL proxy. Do you have a specific page where we are recommending the |
@kurtisvg thanks for your response and clarification! I'm not sure how it is recommended to be configured, but there is this section in the README.md of this repo that I don't fully understand:
Hmmm... I figure we need to consider multiple service accounts, and these are the two I think of at the moment. Do I get this right, and does this cover the discussion?
|
I think so, but let me clarify a bit (because I think we've overloaded the term "service account"). There are two different layers of auth you have to deal with:
No1 requires you (or a service account acting on your behalf) to have the correct IAM permissions (which is the No2 requires a valid database user (and usually password) and is handled between the database and application itself. |
@kurtisvg thanks again for the clarification! Are these statements from this projects README.md file perhaps outdated then?
I'm thinking that the associated project may need to have the SQL administrative API enabled, but the requester should not need any admin permissions when interacting with it, only the Cloud SQL Client role's associated permissions. |
I think you are confusing the The The In order to use the Cloud SQL proxy, you need to have both enabled the |
Pieces are falling into place! But, this sentence remains confusing. What is meant to be stated by this sentence? It sounds to me that it claims the GCP Service Account used by the proxy needs more priviledges than a Cloud SQL Client role can provide. |
I agree that sentence doesn't make sense - it's possible that it was added in before the |
My understanding summarized
The current sentence in the README.md is:
|
This refers to an the access scope required when using Compute service account.
These are both referring to the same thing, but it's "official" name is "Cloud SQL Admin API". I filed an internal bug for the resource you linked above to correct the title.
These are the minimum required, but if you happen to have one of the other roles As an aside, we have a new "how-to" page in the works from the docs side that will largely replace the instructions in the README. |
I've been using the cloudsql-proxy for a while, and wonder if perhaps I've given it too much permissions? Google Cloud Console recommended that I cut down on my permissions to from all of the permissions of a "Cloud SQL Admin" to
cloudsql.instances.connect
andcloudsql.instances.get
as given to the "Cloud SQL Client" role. Could this be enough? I only know that during the last 89 days, it has been enough, and my proxy has restarted in this time frame as well.The permissions below are "Cloud SQL Admin" permissions that we would loose by downgrading to the "Cloud SQL Client" role, which was recommended by GCP platform based on me not using it anyhow:
Reference
About the predefined roles "Cloud SQL Admin" and "Cloud SQL Client": https://cloud.google.com/sql/docs/mysql/project-access-control
The text was updated successfully, but these errors were encountered: