GCP_IAM
| where PayloadMethodname =~ 'google.iam.admin.v1.CreateServiceAccount'
| extend result = parse_json(todynamic(PayloadAuthorizationinfo))[0]['granted']
| where result =~ 'true'
| project-away result
| extend timestamp = TimeGenerated, AccountCustomEntity = PayloadRequestAccountId, IPCustomEntity = SrcIpAddr
version: 1.0.0
status: Available
queryFrequency: 24h
requiredDataConnectors:
- connectorId: GCPIAMDataConnector
dataTypes:
- GCP_IAM
entityMappings:
- fieldMappings:
- columnName: AccountCustomEntity
identifier: FullName
entityType: Account
- fieldMappings:
- columnName: IPCustomEntity
identifier: Address
entityType: IP
kind: Scheduled
queryPeriod: 24h
severity: Low
query: |
GCP_IAM
| where PayloadMethodname =~ 'google.iam.admin.v1.CreateServiceAccount'
| extend result = parse_json(todynamic(PayloadAuthorizationinfo))[0]['granted']
| where result =~ 'true'
| project-away result
| extend timestamp = TimeGenerated, AccountCustomEntity = PayloadRequestAccountId, IPCustomEntity = SrcIpAddr
triggerOperator: gt
id: a768aa52-453e-4e3e-80c2-62928d2e2f56
description: |
'Detects new service account creation.'
triggerThreshold: 0
name: GCP IAM - New Service Account
relevantTechniques:
- T1136
tactics:
- Persistence
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/GoogleCloudPlatformIAM/Analytic Rules/GCPIAMNewServiceAccount.yaml
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/a768aa52-453e-4e3e-80c2-62928d2e2f56')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/a768aa52-453e-4e3e-80c2-62928d2e2f56')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01",
"properties": {
"displayName": "GCP IAM - New Service Account",
"description": "'Detects new service account creation.'\n",
"severity": "Low",
"enabled": true,
"query": "GCP_IAM\n| where PayloadMethodname =~ 'google.iam.admin.v1.CreateServiceAccount'\n| extend result = parse_json(todynamic(PayloadAuthorizationinfo))[0]['granted']\n| where result =~ 'true'\n| project-away result\n| extend timestamp = TimeGenerated, AccountCustomEntity = PayloadRequestAccountId, IPCustomEntity = SrcIpAddr\n",
"queryFrequency": "PT24H",
"queryPeriod": "PT24H",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"Persistence"
],
"techniques": [
"T1136"
],
"alertRuleTemplateName": "a768aa52-453e-4e3e-80c2-62928d2e2f56",
"customDetails": null,
"entityMappings": [
{
"entityType": "Account",
"fieldMappings": [
{
"identifier": "FullName",
"columnName": "AccountCustomEntity"
}
]
},
{
"entityType": "IP",
"fieldMappings": [
{
"identifier": "Address",
"columnName": "IPCustomEntity"
}
]
}
],
"status": "Available",
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/GoogleCloudPlatformIAM/Analytic Rules/GCPIAMNewServiceAccount.yaml",
"templateVersion": "1.0.0"
}
}
]
}