๐ก๏ธ Google GCE Instance is configured to use the Default Service Account๐ข
- Contextual name: ๐ก๏ธ Instance is configured to use the Default Service Account๐ข
- ID:
/ce/ca/google/compute-engine/instance-use-default-service-account - Tags:
- ๐ข Policy with categories
- ๐ข Policy with type
- ๐ข Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logicโ
- ๐ง prod.logic.yaml๐ข
Similar Policiesโ
- Cloud Conformity: Check for Instances Associated with Default Service Accounts
Descriptionโ
Descriptionโ
It is recommended to configure your instance to not use the default Compute Engine service account because it has the Editor role on the project.
Rationaleโ
When a default Compute Engine service account is created, it is automatically granted the Editor role (roles/editor) on your project which allows read and write access to most Google Cloud Services. This role includes a very large number of permissions. To defend against privilege escalations if your VM is compromised and prevent an attacker from gaining access to all of your project, you should either revoke the Editor role from the default Compute Engine service account or create a new service account and assign only the permissions needed by your instance. To mitigate this at scale, we strongly recommend that you disable the automatic role grant by adding a constraint to your organization policy.
The default Compute Engine service account is named
[PROJECT_NUMBER]-compute@developer.gserviceaccount.com.Auditโ
From Google Cloud Consoleโ
- Go to the
VM instancespage by visiting: https://console.cloud.google.com/compute/instances.... see more
Remediationโ
Remediationโ
From Google Cloud Consoleโ
- Go to the
VM instancespage by visiting: https://console.cloud.google.com/compute/instances.- Click on the instance name to go to its
VM instance detailspage.- Click
STOPand then clickEDIT.- Under the section
API and identity management, select a service account other than the default Compute Engine service account. You may first need to create a new service account.- Click
Saveand then clickSTART.From Google Cloud CLIโ
Stop the instance:
gcloud compute instances stop <INSTANCE_NAME>Update the instance:
gcloud compute instances set-service-account <INSTANCE_NAME> --service-account=<SERVICE_ACCOUNT>Restart the instance:
gcloud compute instances start <INSTANCE_NAME>