gcp-gcf-set-iam-policy

derived gcp emits CanModifyPolicy

match (effective permission)

{ "action": "cloudfunctions.functions.setIamPolicy", "resource_type": "google.cloudfunctions.Function" }

emit

source typeIdentity
target type*
source<principal>
target<function allow policy in scope>
permissionscloudfunctions.functions.setIamPolicy

Narrative

{principal.name} can set the IAM policy of {function.name} (cloudfunctions.functions.setIamPolicy) and grant itself invoke.

Raw rule rules/derived/gcp/gcf.yaml

id: gcp-gcf-set-iam-policy
emits: CanModifyPolicy
match_effective_permission:
  action: cloudfunctions.functions.setIamPolicy
  resource_type: google.cloudfunctions.Function
emit:
  source_type: Identity
  target_type: '*'
  source: <principal>
  target: <function allow policy in scope>
  permissions:
  - cloudfunctions.functions.setIamPolicy
  escalation: Grant self roles/cloudfunctions.invoker (or run.invoker for 2nd gen) to complete a code/config
    escalation.
  narrative: '{principal.name} can set the IAM policy of {function.name} (cloudfunctions.functions.setIamPolicy)
    and grant itself invoke.'
move · open · esc close