Detection rules › Kusto

Google Threat Intelligence - Threat Hunting Hash

Severity
medium
Time window
1d
Group by
Id, lowerHash
Source
github.com/Azure/Azure-Sentinel

Google Threat Intelligence hash correlation.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

id: "8f9cd0e5-b4ab-4821-95e2-1082fcd784c7"
name: Google Threat Intelligence - Threat Hunting Hash
description: |
  'Google Threat Intelligence hash correlation.'
severity: Medium
requiredDataConnectors:
  - connectorId: ThreatIntelligence
    dataTypes:
      - ThreatIntelIndicators
queryFrequency: 30m
queryPeriod: 1d
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Execution
relevantTechniques:
  - T1059
incidentConfiguration:
  createIncident: true
  groupingConfiguration:
    enabled: true
    reopenClosedIncident: false
    lookbackDuration: 1h
    matchingMethod: AllEntities
eventGroupingSettings:
  aggregationKind: AlertPerResult
alertDetailsOverride:
  alertDisplayNameFormat: 'Google Threat Intelligence Match'
  alertDescriptionFormat: 'Correlation found from the {{Type}} table.'
query: |
  let ioc_lookBack = 1d;
  _Im_FileEvent
  | where isnotempty(Hash)
  | extend lowerHash=tolower(Hash)
  | join kind=inner (
  ThreatIntelIndicators
  | where ObservableKey contains 'file:hashes'
  | where isnotempty(ObservableValue)
  | where SourceSystem == "Google Threat Intelligence"
  | where TimeGenerated >= ago(ioc_lookBack)
  | summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by Id
  | where IsActive == true and (isnull(ValidUntil) or ValidUntil > now())
  | extend lowerHash=tolower(ObservableValue)
  ) on lowerHash
  | project Hash=ObservableValue, HashType=extract("file:hashes.('[^']*')", 1, ObservableKey), Description=Data.description, Type, TimeGenerated
entityMappings:
  - entityType: FileHash
    fieldMappings:
      - identifier: Value
        columnName: Hash
      - identifier: Algorithm
        columnName: HashType
version: 1.0.0
kind: Scheduled

Stages and Predicates

Parameters

let ioc_lookBack = 1d;

Stage 1: source

_Im_FileEvent

Stage 2: where

| where isnotempty(Hash)

Stage 3: extend

| extend lowerHash=tolower(Hash)

Stage 4: join

| join kind=inner (
ThreatIntelIndicators
| where ObservableKey contains 'file:hashes'
| where isnotempty(ObservableValue)
| where SourceSystem == "Google Threat Intelligence"
| where TimeGenerated >= ago(ioc_lookBack)
| summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by Id
| where IsActive == true and (isnull(ValidUntil) or ValidUntil > now())
| extend lowerHash=tolower(ObservableValue)
) on lowerHash

Stage 5: project

| project Hash=ObservableValue, HashType=extract("file:hashes.('[^']*')", 1, ObservableKey), Description=Data.description, Type, TimeGenerated

Stage 6: summarize aggregation inside the join branch

summarize by Id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Hashis_not_null
  • (no value, null check)
field:"Hashes" kind:is_not_null
IsActiveeq
  • true corpus 21 (kusto 21)
field:"IsActive" kind:eq value:"true"
ObservableKeycontains
  • file:hashes corpus 2 (kusto 2)
field:"ObservableKey" kind:contains value:"file:hashes"
ObservableValueis_not_null
  • (no value, null check)
field:"ObservableValue" kind:is_not_null
SourceSystemeq
  • Google Threat Intelligence corpus 4 (kusto 4)
field:"SourceSystem" kind:eq value:"Google Threat Intelligence"
ValidUntilis_null
  • (no value, null check)
field:"ValidUntil" kind:is_null

Output fields

These fields are emitted when the rule matches.

FieldSource
Idsummarize