π Google GCE Instance is configured to use the Default Service Account with full access to all Cloud APIs π’
- Contextual name: π Instance is configured to use the Default Service Account with full access to all Cloud APIs π’
- ID:
/ce/ca/google/compute-engine/instance-use-default-service-account-with-full-access
- Located in: π Google GCE
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Cloud Conformity
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
To support principle of least privileges and prevent potential privilege escalation it is recommended that instances are not assigned to default service account
Compute Engine default service account
with ScopeAllow full access to all Cloud APIs
.Rationaleβ
Along with ability to optionally create, manage and use user managed custom service accounts, Google
Compute Engine provides default service account
Compute Engine default service account for an instances to access necessary cloud services.Project Editor
role is assigned toCompute Engine default service account
hence, This service account has almost all capabilities over all cloud services except billing. However, whenCompute Engine default service account
assigned to an instance it can operate in 3 scopes.1. Allow default access: Allows only minimum access required to run an Instance (Least Privileges)
2. Allow full access to all Cloud APIs: Allow full access to all the cloud APIs/Services (Too much access)... see more
Remediationβ
Remediationβ
From Google Cloud Consoleβ
- Go to the
VM instances
page by visiting: https://console.cloud.google.com/compute/instances.- Click on the impacted VM instance.
- If the instance is not stopped, click the
Stop
button. Wait for the instance to be stopped.- Next, click the
Edit
button.- Scroll down to the
Service Account
section.- Select a different service account or ensure that
Allow full access to all Cloud APIs
is not selected.- Click the
Save
button to save your changes and 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> --scopes [SCOPE1, SCOPE2...]
Restart the instance:
gcloud compute instances start <INSTANCE_NAME>
policy.yamlβ
Linked Framework Sectionsβ
Section | Sub Sections | Internal Rules | Policies | Flags |
---|---|---|---|---|
πΌ CIS GCP v3.0.0 β πΌ 4.2 Ensure That Instances Are Not Configured To Use the Default Service Account With Full Access to All Cloud APIs - Level 1 (Automated) | 1 | |||
πΌ Cloudaware Framework β πΌ Secure Access | 43 |