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:

  1. GCP_CAN_ACT_AS_SA — permission to attach the target SA to a VM. → see GCP_CAN_ACT_AS_SA.

  2. 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

  1. Open GCP ConsoleCompute EngineVM Instances.

  2. Review VMs and their associated service accounts.

  3. Check IAM & AdminIAM for principals with Compute Admin, Compute Instance Admin, Owner or Editor roles.

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

  1. Restrict roles/compute.admin — use narrower compute roles (roles/compute.instanceAdmin.v1) where full admin is not required.

  2. Enforce OS Login to require IAM authentication for SSH.

  3. Require shielded VMs via org policy: constraints/compute.requireShieldedVm

  4. Enable constraints/compute.vmCanIpForward=false to prevent IP forwarding abuse.

Detection

Log Type
Method
Key Fields

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?