gcp-dm-typeprovider-create

deploymentmanager.typeProviders.create registers a custom type provider backed by an arbitrary HTTPS REST endpoint; when a deployment uses the type, DM calls that endpoint AS the cloudservices service agent. Modeled as CanModifyConfiguration on the Deployment (BuildWorker/Compute) because CanModifyCode.target does not admit the TypeProvider config node (GenericManagement).

derived gcp emits CanModifyConfiguration

match (effective permission)

{ "action": "deploymentmanager.typeProviders.create", "resource_type": "google.deploymentmanager.TypeProvider" }

emit

source typeIdentity
target typeBuildWorker
source<principal>
target<Deployment node (BuildWorker) that instantiates this type>
permissionsdeploymentmanager.typeProviders.create deploymentmanager.typeProviders.update
conditionsiam_permission api_enabled network_reachability trigger_exists
state logicCONDITIONAL(trigger_exists, network_reachability) — two gates: (1) a deployment must use a resource of this type to actuate the call (trigger_exists analog); (2) the service agent must be able to reach the attacker-controlled HTTPS endpoint. ACTIVE when the principal can also create/update a deployment that uses the new type (combined with gcp-dm-deployments-create / -update) AND the endpoint is reachable. BLOCKED by VPC Service Controls on the DM API or the external egress.

Narrative

{principal.name} can register a custom type provider (deploymentmanager.typeProviders.create) backed by an attacker-controlled HTTPS endpoint. When a DM deployment uses a resource of that type, DM calls the endpoint AS {sa.name}, executing attacker-controlled code with the SA's permissions. Effect is equivalent to modifying the deployment configuration (CanModifyConfiguration) from an escalation-path perspective.

Raw rule rules/derived/gcp/deploymentmanager.yaml

id: gcp-dm-typeprovider-create
emits: CanModifyConfiguration
description: deploymentmanager.typeProviders.create registers a custom type provider backed by an arbitrary
  HTTPS REST endpoint; when a deployment uses the type, DM calls that endpoint AS the cloudservices service
  agent. Modeled as CanModifyConfiguration on the Deployment (BuildWorker/Compute) because CanModifyCode.target
  does not admit the TypeProvider config node (GenericManagement).
match_effective_permission:
  action: deploymentmanager.typeProviders.create
  resource_type: google.deploymentmanager.TypeProvider
alt_permission: deploymentmanager.typeProviders.update
emit:
  source_type: Identity
  target_type: BuildWorker
  source: <principal>
  target: <Deployment node (BuildWorker) that instantiates this type>
  permissions:
  - deploymentmanager.typeProviders.create
  - deploymentmanager.typeProviders.update
  conditions:
  - iam_permission
  - api_enabled
  - network_reachability
  - trigger_exists
  state_logic: "CONDITIONAL(trigger_exists, network_reachability) \u2014 two gates: (1) a deployment must\
    \ use a resource of this type to actuate the call (trigger_exists analog); (2) the service agent must\
    \ be able to reach the attacker-controlled HTTPS endpoint. ACTIVE when the principal can also create/update\
    \ a deployment that uses the new type (combined with gcp-dm-deployments-create / -update) AND the\
    \ endpoint is reachable. BLOCKED by VPC Service Controls on the DM API or the external egress."
  confidence: 0.8
  derived_from: []
  false_positive_note: "Two-step attack: (1) register malicious type provider; (2) a deployment must actuate\
    \ a resource of that type. If only typeProviders.create is held without deployments.create/update,\
    \ this stays CONDITIONAL(trigger_exists). typeProviders.update on an EXISTING provider already used\
    \ by a live deployment is ACTIVE once the backend is swapped \u2014 check for existing deployments\
    \ that reference the type. Network reachability of the external endpoint from the GCP control plane\
    \ must be confirmed; emit CONDITIONAL(network_reachability) when unknown."
  narrative: '{principal.name} can register a custom type provider (deploymentmanager.typeProviders.create)
    backed by an attacker-controlled HTTPS endpoint. When a DM deployment uses a resource of that type,
    DM calls the endpoint AS {sa.name}, executing attacker-controlled code with the SA''s permissions.
    Effect is equivalent to modifying the deployment configuration (CanModifyConfiguration) from an escalation-path
    perspective.'
move · open · esc close