guillaume blaquiere
1 min readJul 30, 2020

Hello Ryan. Great article. We are in war in our company to limit the service account key files (org policy applied and we set up a servicenow workflow to request keys with the reason. I'm in charge of validating these tickets. When I validate, a Cloud Functions is triggered, the policy deactivated, the service account key file generated and the policy reactivated. And the service account key file is stored in secret manager).

However, a lot of video and tutorial on Google Cloud documentation required a service account key file to achieve them. Bad example and first bad habit when we start in Google Cloud. I already contacted Priyanka Vergadia about this.

Anyway, I have a last remark/feedback. You explain how to do this with gcloud command. Ok, but when you code locally and you don't want to implement a hook in your local dev to impersonate a service account. You want to test the same code on your computer and this one deployed on the cloud. So now, how can you do this?

Ok, you can use your own credential (gcloud auth application-default login), and in the code, the application default credential. I agree it works....

EXCEPT for Cloud Run and Cloud Function deployed privately: you can't generate an identity token based on your user credential. In this case, it's mandatory to have a service account key file.

Do you know if it's planned to improve this? It's a real security nightmare to manage this in my organisation!

Best

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

guillaume blaquiere
guillaume blaquiere

Written by guillaume blaquiere

GDE cloud platform, Group Data Architect @Carrefour, speaker, writer and polyglot developer, Google Cloud platform 3x certified, serverless addict and Go fan.

Responses (1)

Write a response

Hi Guillaume, you have touched on one of the limitations of impersonation that I believe I mentioned in the article. In that case downloading a key to maintain parity for testing would be necessary. If this is a regular requirement for Cloud…

--