Service Accounts Within The Google Cloud Platform

Service Accounts Within The Google Cloud Platform

Management Summary

In a previous article, the three different types of authentication within the Google Cloud Platform were introduced - API Keys, OAuth 2.0 Client IDs, and Service Accounts. Here you can read what types of service accounts there are and how to actually use them within an application - using the most important GCP services as an example

FormerArticleto read!

Service Account Types

Default service account

Certain GCP services automatically create so-called “default service accounts” that allow the service to deploy jobs that access other GCP resources.

The purpose of these “Default Service Accounts” is to make it easier to migrate to GCP. For productive systems, however, Google recommends creating your own service accounts and assigning appropriate roles.

Default service accounts are always assigned the IAM role “Project Editor”.

App Engine

If App Engine or a GCP service that uses App Engine is created, the following default service account is automatically created:
project-id@appspot.gserviceaccount.com

Cloud Functions

Cloud Functions use App Engine in the background, which is why the App Engine Default Service Account is also created in this case:
project-id@appspot.gserviceaccount.com

Compute Engine

If Compute Engine or a GCP service that uses Compute Engine is created, the following default service account is automatically created:
project-number-compute@developer.gserviceaccount.com

User-managed service account

You can create these types of service accounts via the IAM API, with the Cloud Console or with the gcloud command line tool. You are responsible for managing and securing these accounts yourself.

By default, you can create up to 100 service accounts in a project. If you create a service account in a project, a name must be chosen, which will then be used within the following email address:
service-account-name@project-id.iam.gserviceaccount.com

Nue service accounts can be found within the menu: IAM & Admin > Service accounts are created. If you now want to assign further rights to this service account, you must do this via: IAM & Admin > IAM can be made.

Google managed service accounts

For the sake of completeness, it should be mentioned here that apart from default and user-managed service accounts, there is a third type, namely: “Google-managed service accounts”. You often see these in IAM guidelines or audit logs.

Change of default service account

The following describes how a “User-managed Service Account” can be used instead of a “Default Service Account” for the most important compute resources.

App Engine

An App Engine Service always uses the App Engine Default Service Account; it is not possible to change this.

Cloud Functions

Standardmäßig verwenden Cloud Functions den oben beschriebenen App Engine Default Service Account. If you don’t want this, you can choose a user-managed service account in the advanced settings.

Compute Engine

Here too, the Compute Engine Default Service Account is used first, unless you change this in the settings.

For more information about the Google Cloud Platform, contact our experts:kontakt@e-dialog.group

e-dialog office Vienna
Relevant content

More about Analytics