Detection rules › Kusto

GCP IAM - New Service Account Key

Status
available
Severity
low
Time window
1d
Source
github.com/Azure/Azure-Sentinel

Detects new service account key creation.

MITRE ATT&CK coverage

TacticTechniques
Lateral MovementT1550 Use Alternate Authentication Material

Event coverage

ProviderEventTitle
GCP-iam.googleapis.comgoogle-iam-admin-CreateServiceAccountKeyCreate service account key

Rules detecting the same action

Other rules on this platform that filter on the same API call or operation.

Rule body kusto

id: fc135860-8773-4ead-b5be-9789af1ff8ff
name: GCP IAM - New Service Account Key
description: |
  'Detects new service account key creation.'
severity: Low
status: Available
requiredDataConnectors:
  - connectorId: GCPIAMDataConnector
    dataTypes:
      - GCP_IAM
queryFrequency: 24h
queryPeriod: 24h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - LateralMovement
relevantTechniques:
  - T1550
query: |
  GCP_IAM
  | where PayloadMethodname =~ 'google.iam.admin.v1.CreateServiceAccountKey'
  | 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])
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: service_account
      - identifier: Name
        columnName: AccountName
      - identifier: UPNSuffix
        columnName: AccountUPNSuffix
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: SrcIpAddr
version: 1.0.1
kind: Scheduled

Stages and Predicates

Stage 1: source

GCP_IAM

Stage 2: where

| where PayloadMethodname =~ 'google.iam.admin.v1.CreateServiceAccountKey'

Stage 3: extend

| extend result = parse_json(todynamic(PayloadAuthorizationinfo))[0]['granted']

Stage 4: where

| where result =~ 'true'

Stage 5: extend

| extend service_account = extract(@'serviceAccounts\/(.*?)@', 1, PayloadResponseName)

Stage 6: project-away

| project-away result

Stage 7: extend

| extend AccountName = tostring(split(service_account, "@")[0]), AccountUPNSuffix = tostring(split(service_account, "@")[1])

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
PayloadMethodnameeq
  • google.iam.admin.v1.CreateServiceAccountKey
resulteq
  • true

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
service_accountextend
AccountNameextend
AccountUPNSuffixextend