gcp-psc-create-service-attachment

An identity with compute.serviceAttachments.create can publish a new Internal Load Balancer backend as a Private Service Connect service attachment, making it reachable by any PSC consumer that has the Service Attachment URI and can create a forwarding rule. This is a high-value capability for lateral movement or service hijacking attacks: the attacker can intercept traffic intended for a legitimate service or exfiltrate data through a honeypot endpoint. The published service is visible to all projects in ACCEPT_AUTOMATIC mode (default) or to explicitly listed projects in ACCEPT_MANUAL mode.

derived gcp emits CanModifyConfiguration

match (effective permission)

{ "action": "compute.serviceAttachments.create", "resource_type": "compute.googleapis.com/ServiceAttachment" }

emit

source typeIdentity
target typePrivateEndpoint
source<principal>
target<producer VPC/project>
permissionscompute.serviceAttachments.create
conditionsiam_permission
state logicACTIVE if principal holds compute.serviceAttachments.create at the effective scope. The newly published service is immediately reachable by any consumer with the Service Attachment URI (if ACCEPT_AUTOMATIC) or by explicitly approved consumer projects (if ACCEPT_MANUAL with acceptlist).

Narrative

{principal.name} can create a new PSC Service Attachment in the {producer_project} (compute.serviceAttachments.create), publishing an Internal Load Balancer backend as a private service reachable by authorized consumer projects, enabling lateral movement or service hijacking attacks.

Raw rule rules/derived/gcp/psc.yaml

id: gcp-psc-create-service-attachment
emits: CanModifyConfiguration
description: 'An identity with compute.serviceAttachments.create can publish a new Internal Load Balancer
  backend as a Private Service Connect service attachment, making it reachable by any PSC consumer that
  has the Service Attachment URI and can create a forwarding rule. This is a high-value capability for
  lateral movement or service hijacking attacks: the attacker can intercept traffic intended for a legitimate
  service or exfiltrate data through a honeypot endpoint. The published service is visible to all projects
  in ACCEPT_AUTOMATIC mode (default) or to explicitly listed projects in ACCEPT_MANUAL mode.'
match_effective_permission:
  action: compute.serviceAttachments.create
  resource_type: compute.googleapis.com/ServiceAttachment
emit:
  source_type: Identity
  target_type: PrivateEndpoint
  source: <principal>
  target: <producer VPC/project>
  permissions:
  - compute.serviceAttachments.create
  conditions:
  - iam_permission
  state_logic: ACTIVE if principal holds compute.serviceAttachments.create at the effective scope. The
    newly published service is immediately reachable by any consumer with the Service Attachment URI (if
    ACCEPT_AUTOMATIC) or by explicitly approved consumer projects (if ACCEPT_MANUAL with acceptlist).
  derived_from:
  - '<effective permission: compute.serviceAttachments.create on producer project>'
  false_positive_note: "compute.serviceAttachments.create is included in roles/compute.networkAdmin and\
    \ roles/compute.admin; check effective permission. Creating a Service Attachment alone does not grant\
    \ data access to the Internal LB backend \u2014 the backend's own IAM and application-layer auth still\
    \ apply. However, publishing a new service is a meaningful stepping stone for network-layer interception\
    \ or persistence."
  narrative: '{principal.name} can create a new PSC Service Attachment in the {producer_project} (compute.serviceAttachments.create),
    publishing an Internal Load Balancer backend as a private service reachable by authorized consumer
    projects, enabling lateral movement or service hijacking attacks.'
move · open · esc close