gcp-gcf-retrieve-runtime-sa-token

Attacker with execution in the function can mint the runtime SA token.

derived gcp emits CanRetrieveToken

match

A conjunctive graph pattern. Variables (?x) bind node ids; every clause must hold.

{'principal': None} CanExecuteAs {'sa': None}

emit

source<principal>
target<runtime service account>

Narrative

{principal.name}, executing in {function.name}, can retrieve an access token for {sa.name} from the metadata server.

Raw rule rules/derived/gcp/gcf.yaml

id: gcp-gcf-retrieve-runtime-sa-token
emits: CanRetrieveToken
description: Attacker with execution in the function can mint the runtime SA token.
match:
- - principal: null
  - CanExecuteAs
  - sa: null
emit:
  source: <principal>
  target: <runtime service account>
  permissions: []
  narrative: '{principal.name}, executing in {function.name}, can retrieve an access token for {sa.name}
    from the metadata server.'
move · open · esc close