GCP_CAN_CREATE_COMPUTE
Summary
FSProtect ACL Alias
GCP_CAN_CREATE_COMPUTE
GCP Alias
Compute Execution & Pipeline Pivots
Affected Object Types
Projects
Exploitation Certainty
Likely
Granting Roles
roles/owner, roles/editor, roles/compute.admin, roles/compute.instanceAdmin.v1
Description
GCP_CAN_CREATE_COMPUTE indicates that an identity can create Google Compute Engine (GCE) VM instances in a project by holding compute.instances.create permission. This edge is primarily a vehicle for completing other attack paths, most importantly the GCP_CAN_ACT_AS_SA path. By creating a VM attached to a high-privilege service account, an attacker can extract the SA's access token from the GCE metadata server.
This edge alone does not grant access to other identities' tokens. The full escalation requires:
GCP_CAN_ACT_AS_SA— permission to attach the target SA to a VM. → see GCP_CAN_ACT_AS_SA.GCP_CAN_CREATE_COMPUTE— ability to create the VM itself.
Without both, VM creation may proceed but the attacker cannot attach a privileged SA.
Key abuse scenarios:
Create a VM attached to a high-privilege SA → extract token from metadata server.
Create a VM with a startup script that exfiltrates the attached SA's token on boot.
Spin up a persistent attacker-controlled VM for command-and-control within the project VPC.
Create GPU/high-CPU VMs to run cryptomining workloads (financial impact).
Identification
gcloud CLI
GCP Console
Open GCP Console → Compute Engine → VM Instances.
Review VMs and their associated service accounts.
Check IAM & Admin → IAM for principals with
Compute Admin,Compute Instance Admin,OwnerorEditorroles.
Exploitation
This path requires both GCP_CAN_ACT_AS_SA and GCP_CAN_CREATE_COMPUTE.
gcloud CLI
Alternative: SSH into the VM and extract the token interactively.
Mitigation
Restrict
roles/compute.admin— use narrower compute roles (roles/compute.instanceAdmin.v1) where full admin is not required.Enforce OS Login to require IAM authentication for SSH.
Require shielded VMs via org policy:
constraints/compute.requireShieldedVmEnable
constraints/compute.vmCanIpForward=falseto prevent IP forwarding abuse.
Detection
Admin Activity
*compute.instances.insert
resource.type=gce_instance, SA field in request
Admin Activity
*compute.instances.setServiceAccount
SA change on existing VM
Alert on:
VM creation by non-standard identities attaching high-privilege SAs.
VMs created with startup scripts containing metadata server URLs.
Metadata server token requests within minutes of VM creation (rapid token extraction pattern).
References
https://cloud.google.com/compute/docs/access/service-accounts
https://cloud.google.com/compute/docs/metadata/overview
Last updated
Was this helpful?