Detection rules › Kusto
GSA - TI URL Entity
This query identifies URL indicators of compromise (IOCs) from threat intelligence (TI) by searching for matches in GSA NetworkAccessTraffic.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Rule body
id: 347c6cb3-33d2-4753-b7f6-eab946a8cd51
name: GSA - TI URL Entity
description: |
This query identifies URL indicators of compromise (IOCs) from threat intelligence (TI) by searching for matches in GSA NetworkAccessTraffic.
severity: Medium
status: Available
requiredDataConnectors:
- connectorId: AzureActiveDirectory
dataTypes:
- NetworkAccessTrafficLogs
queryFrequency: 1h
queryPeriod: 14d
triggerOperator: gt
triggerThreshold: 0
tactics:
- CommandAndControl
relevantTechniques:
- T1071
query: |
let dt_lookBack = 1h;
let ioc_lookBack = 14d;
let GSANetworkAccessTraffic_ = NetworkAccessTraffic
| where TimeGenerated >= ago(dt_lookBack)
| where TrafficType == "internet"
| extend DestinationUrlToLower = tolower(DestinationUrl)
| project-rename GSANetworkAccessTraffic_TimeGenerated = TimeGenerated;
let GSANetworkAccessTrafficUrls =
GSANetworkAccessTraffic_
| where isnotempty(DestinationUrl)
| extend Url = tolower(DestinationUrl)
| distinct Url;
ThreatIntelIndicators
| extend IndicatorType = replace(@'[\[\]"]', "", tostring(split(ObservableKey, ":", 0)))
| where IndicatorType == "url"
| extend Url = ObservableValue
| extend TrafficLightProtocolLevel = tostring(parse_json(AdditionalFields).TLPLevel)
| where TimeGenerated >= ago(ioc_lookBack)
| extend Url = tolower(Url)
| where Url in (GSANetworkAccessTrafficUrls)
| summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by Id, ObservableValue
| where IsActive and (ValidUntil > now() or isempty(ValidUntil))
| extend Description = tostring(parse_json(Data).description)
| where Description !contains_cs "State: inactive;" and Description !contains_cs "State: falsepos;"
| project-reorder *, Tags, TrafficLightProtocolLevel, Url, Type
| join kind=innerunique (GSANetworkAccessTraffic_) on $left.Url == $right.DestinationUrlToLower
| where isempty(ValidUntil) or GSANetworkAccessTraffic_TimeGenerated < ValidUntil
| extend GSAThreatType = ThreatType
| summarize GSANetworkAccessTraffic_TimeGenerated = arg_max(GSANetworkAccessTraffic_TimeGenerated, *) by Id, DestinationUrl
| project-reorder *,
Tags,
Confidence,
TrafficLightProtocolLevel,
Type,
UserPrincipalName,
UserId,
DeviceId,
InitiatingProcessName,
GSAThreatType,
DestinationIp,
DestinationFqdn,
DestinationUrl,
DestinationPort,
SourceIp,
SourcePort,
HttpUserAgent
entityMappings:
- entityType: Account
fieldMappings:
- identifier: Name
columnName: UserPrincipalName
- entityType: IP
fieldMappings:
- identifier: Address
columnName: SourceIp
- entityType: URL
fieldMappings:
- identifier: Url
columnName: DestinationUrl
- entityType: Process
fieldMappings:
- identifier: CommandLine
columnName: InitiatingProcessName
version: 1.0.1
kind: Scheduled
Stages and Predicates
Parameters
let dt_lookBack = 1h;
let ioc_lookBack = 14d;
Let binding: GSANetworkAccessTraffic_
let GSANetworkAccessTraffic_ = NetworkAccessTraffic
| where TimeGenerated >= ago(dt_lookBack)
| where TrafficType == "internet"
| extend DestinationUrlToLower = tolower(DestinationUrl)
| project-rename GSANetworkAccessTraffic_TimeGenerated = TimeGenerated;
Let binding: GSANetworkAccessTrafficUrls
let GSANetworkAccessTrafficUrls = GSANetworkAccessTraffic_
| where isnotempty(DestinationUrl)
| extend Url = tolower(DestinationUrl)
| distinct Url;
Stage 1: source
ThreatIntelIndicators
Stage 2: extend
| extend IndicatorType = replace(@'[\[\]"]', "", tostring(split(ObservableKey, ":", 0)))
Stage 3: where
| where IndicatorType == "url"
Stage 4: extend
| extend Url = ObservableValue
Stage 5: extend
| extend TrafficLightProtocolLevel = tostring(parse_json(AdditionalFields).TLPLevel)
Stage 6: where
| where TimeGenerated >= ago(ioc_lookBack)
Stage 7: extend
| extend Url = tolower(Url)
Stage 8: where
| where Url in (GSANetworkAccessTrafficUrls)
Stage 9: summarize
| summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by Id, ObservableValue
Stage 10: where
| where IsActive and (ValidUntil > now() or isempty(ValidUntil))
Stage 11: extend
| extend Description = tostring(parse_json(Data).description)
Stage 12: where
| where Description !contains_cs "State: inactive;" and Description !contains_cs "State: falsepos;"
Stage 13: project-reorder
| project-reorder *, Tags, TrafficLightProtocolLevel, Url, Type
Stage 14: join
| join kind=innerunique (GSANetworkAccessTraffic_) on $left.Url == $right.DestinationUrlToLower
Stage 15: where
| where isempty(ValidUntil) or GSANetworkAccessTraffic_TimeGenerated < ValidUntil
Stage 16: extend
| extend GSAThreatType = ThreatType
Stage 17: summarize
| summarize GSANetworkAccessTraffic_TimeGenerated = arg_max(GSANetworkAccessTraffic_TimeGenerated, *) by Id, DestinationUrl
Stage 18: project-reorder
| project-reorder *,
Tags,
Confidence,
TrafficLightProtocolLevel,
Type,
UserPrincipalName,
UserId,
DeviceId,
InitiatingProcessName,
GSAThreatType,
DestinationIp,
DestinationFqdn,
DestinationUrl,
DestinationPort,
SourceIp,
SourcePort,
HttpUserAgent
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
Description | contains | State: falsepos; | excludes:Description field:"Description" value:"State: falsepos;" |
Description | contains | State: inactive; | excludes:Description field:"Description" value:"State: inactive;" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
GSANetworkAccessTraffic_TimeGenerated | cross_field_compare |
| field:"GSANetworkAccessTraffic_TimeGenerated" kind:cross_field_compare value:"ValidUntil" |
IndicatorType | eq |
| field:"IndicatorType" kind:eq value:"url" |
TrafficType | eq |
| field:"TrafficType" kind:eq value:"internet" |
Url | in |
| field:"Url" kind:in value:"GSANetworkAccessTrafficUrls" |
ValidUntil | is_null | field:"ValidUntil" kind:is_null |
Output fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
DestinationUrl | summarize |
GSANetworkAccessTraffic_TimeGenerated | summarize |
Id | summarize |