DEV Community

Discussion on: Securing access to Google Service Accounts from Gitlab CI

Collapse
 
timschwalbe profile image
Tim Schwalbe • Edited

Hey! Great article!

I just implemented it the same way.

I have a few questions regarding ->"gcloud container clusters get-credentials business"
How long these credentials are valid?
Could they be stolen and used for a long period or are these short-lived tokens as GCP knows the call comes from an Cloud Identity Account?

Is this the only way to auth kubectl?

Thanks a lot!

Collapse
 
chabane profile image
Chabane R.

Hi Tim!

Thanks for your contribution!

The credentials will live as long as the gitlab runner job is up so just after the completion of the stage.

For a Kubernetes cluster shared between different teams or departments, I would recommend using Kubernetes RBAC or Kubernetes Agents (Premium tiers). It could help to respect least privilege principles.