GCP_IAM
| where PayloadMethodname in ('GenerateAccessToken', 'google.iam.admin.v1.GenerateAccessToken')
| extend result = parse_json(todynamic(PayloadAuthorizationinfo))[0]['granted']
| where result =~ 'true'
| extend service_account = extract(@'serviceAccounts\/(.*?)@', 1, PayloadResponseName)
| project-away result
| extend AccountName = tostring(split(service_account, "@")[0]), AccountUPNSuffix = tostring(split(service_account, "@")[1])
triggerThreshold: 0
triggerOperator: gt
description: |
'Detects when new authentication token is created for service account.'
relevantTechniques:
- T1550
query: |
GCP_IAM
| where PayloadMethodname in ('GenerateAccessToken', 'google.iam.admin.v1.GenerateAccessToken')
| extend result = parse_json(todynamic(PayloadAuthorizationinfo))[0]['granted']
| where result =~ 'true'
| extend service_account = extract(@'serviceAccounts\/(.*?)@', 1, PayloadResponseName)
| project-away result
| extend AccountName = tostring(split(service_account, "@")[0]), AccountUPNSuffix = tostring(split(service_account, "@")[1])
status: Available
requiredDataConnectors:
- dataTypes:
- GCP_IAM
connectorId: GCPIAMDataConnector
kind: Scheduled
tactics:
- LateralMovement
queryFrequency: 1h
entityMappings:
- entityType: Account
fieldMappings:
- columnName: service_account
identifier: FullName
- columnName: AccountName
identifier: Name
- columnName: AccountUPNSuffix
identifier: UPNSuffix
- entityType: IP
fieldMappings:
- columnName: SrcIpAddr
identifier: Address
severity: Medium
name: GCP IAM - New Authentication Token for Service Account
queryPeriod: 1h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/GoogleCloudPlatformIAM/Analytic Rules/GCPIAMNewAuthenticationToken.yaml
id: 80e4db30-5636-4fbd-8816-24c3ded8d243
version: 1.0.2