Skip to content

New attack technique: Execute Commands on GCE Instances via OS Config Agent (gcp.execution.os-config-run-command)#799

Open
Minosity-VR wants to merge 4 commits into
mainfrom
simon.marechal/gcp-execution-os-config-run-command
Open

New attack technique: Execute Commands on GCE Instances via OS Config Agent (gcp.execution.os-config-run-command)#799
Minosity-VR wants to merge 4 commits into
mainfrom
simon.marechal/gcp-execution-os-config-run-command

Conversation

@Minosity-VR

Copy link
Copy Markdown
Collaborator

What does this PR do?

New attack technique: gcp.execution.os-config-run-command

Motivation

GCP parity with existing AWS attack techniques.

Test results

  • stratus detonate gcp.execution.os-config-run-command
  • google.cloud.osconfig.v1.OsConfigZonalService.CreateOSPolicyAssignment appears in GCP audit logs (requires non-default DATA_WRITE audit logging for osconfig.googleapis.com)

Checklist

  • The attack technique emulates a single attack step, not a full attack chain
  • We have factual evidence & references that the attack technique was used by real malware, pentesters, or attackers
  • The attack technique makes no assumption about the state of the environment prior to warming it up

@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-modify-vertex-notebook-startup branch from e311a77 to 525c891 Compare March 30, 2026 14:54
@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-os-config-run-command branch from 9824956 to 746d4d7 Compare March 30, 2026 14:54
@Minosity-VR Minosity-VR marked this pull request as ready for review April 1, 2026 07:25
@Minosity-VR Minosity-VR requested review from a team as code owners April 1, 2026 07:25
@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-modify-vertex-notebook-startup branch from 525c891 to 8a37147 Compare April 1, 2026 08:28
@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-os-config-run-command branch from 746d4d7 to 14615f6 Compare April 1, 2026 08:28
@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-modify-vertex-notebook-startup branch from 8a37147 to ccaf620 Compare April 1, 2026 08:53
@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-os-config-run-command branch from 14615f6 to cfe3832 Compare April 1, 2026 08:53
@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-modify-vertex-notebook-startup branch from ccaf620 to 626c9c0 Compare April 1, 2026 09:04
@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-os-config-run-command branch from cfe3832 to 713bbd1 Compare April 1, 2026 09:04
@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-os-config-run-command branch from 713bbd1 to 586918f Compare April 9, 2026 08:28
@Minosity-VR Minosity-VR force-pushed the simon.marechal/gcp-execution-modify-vertex-notebook-startup branch from 626c9c0 to 2889bcd Compare April 9, 2026 08:28
Base automatically changed from simon.marechal/gcp-execution-modify-vertex-notebook-startup to simon.marechal/gcp-execution-modify-gce-startup-script April 30, 2026 12:28
log.Printf("Creating OSPolicyAssignment %s in %s to run a shell command on targeted instances\n",
assignmentId, parent)

_, err = svc.Projects.Locations.OsPolicyAssignments.Create(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This yields:

2026/04/30 15:03:04 Error while detonating attack technique gcp.execution.os-config-run-command: failed to create OSPolicyAssignment: googleapi: Error 400: OS configuration management has been disabled in this project. To use this feature, enable full VM Manager functionality. See https://cloud.google.com/compute/docs/manage-os#enable-full-vmm for instructions., failedPrecondition

@Minosity-VR Minosity-VR changed the base branch from simon.marechal/gcp-execution-modify-gce-startup-script to main April 30, 2026 13:25
@Minosity-VR Minosity-VR changed the base branch from main to simon.marechal/gcp-execution-modify-gce-startup-script April 30, 2026 13:26
@christophetd christophetd force-pushed the simon.marechal/gcp-execution-os-config-run-command branch from 0ea7a99 to 0a07d72 Compare April 30, 2026 13:37
Minosity-VR and others added 4 commits April 30, 2026 15:48
… Agent (gcp.execution.os-config-run-command)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address PR feedback: detonation fails with failedPrecondition when OS
Configuration Management is not enabled at the project level. Note this
in the description and clarify that the API call still produces the
CreateOSPolicyAssignment audit event, so the attempt remains detectable
even when execution does not succeed.
@christophetd christophetd force-pushed the simon.marechal/gcp-execution-os-config-run-command branch from 0a07d72 to 2e65f9f Compare April 30, 2026 13:49
@christophetd christophetd changed the base branch from simon.marechal/gcp-execution-modify-gce-startup-script to main April 30, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants