Detection rules › Kusto
Cisco ASA - Possible Data Exfiltration Detection
'Detects potential data exfiltration when an internal source IP sends a large amount of outbound data to the internet, especially when the volume is significantly higher than its normal behavior.'
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Exfiltration |
Rule body
id: f3a8c2d0-7b41-4e9a-9f6a-2d8a1c4e5b72
name: Cisco ASA - Possible Data Exfiltration Detection
description: |
'Detects potential data exfiltration when an internal source IP sends a large amount of outbound data to the internet, especially when the volume is significantly higher than its normal behavior.'
severity: Medium
status: Available
requiredDataConnectors:
- connectorId: CiscoAsaAma
dataTypes:
- CommonSecurityLog
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
- Exfiltration
relevantTechniques:
- T1041
- T1048
query: |
let Lookback = 1h;
let MinUploadBytes = 1073741824;
let MinUploadRatio = 95.0;
CommonSecurityLog
| where TimeGenerated > ago(Lookback)
| where DeviceProduct has_any ("ASA")
| where isnotempty(SourceIP) and isnotempty(DestinationIP)
| where ipv4_is_private(SourceIP)
| where not(ipv4_is_private(DestinationIP))
| where DeviceAction in~ ("allow", "allowed", "accept", "accepted", "permitted")
| extend SentBytesLong = tolong(SentBytes)
| extend ReceivedBytesLong = tolong(ReceivedBytes)
| where isnotnull(SentBytesLong)
| summarize
TotalBytesSent = sum(SentBytesLong),
TotalBytesReceived = sum(coalesce(ReceivedBytesLong, 0)),
Connections = count(),
DestinationPorts = make_set(DestinationPort, 20),
Applications = make_set(ApplicationProtocol, 20),
FirstSeen = min(TimeGenerated),
LastSeen = max(TimeGenerated)
by SourceIP, DestinationIP
| where TotalBytesSent >= MinUploadBytes
| extend TotalGBSent = round(TotalBytesSent / 1024.0 / 1024.0 / 1024.0, 2)
| extend TotalGBReceived = round(TotalBytesReceived / 1024.0 / 1024.0 / 1024.0, 2)
| extend UploadRatio = round(todouble(TotalBytesSent) / todouble(TotalBytesSent + TotalBytesReceived) * 100, 2)
| where UploadRatio >= MinUploadRatio
| project
TimeGenerated = LastSeen,
SourceIP,
DestinationIP,
TotalGBSent,
TotalGBReceived,
UploadRatio,
Connections,
DestinationPorts,
Applications,
FirstSeen,
LastSeen
| order by TotalGBSent desc
entityMappings:
- entityType: IP
fieldMappings:
- identifier: Address
columnName: SourceIP
- entityType: IP
fieldMappings:
- identifier: Address
columnName: DestinationIP
version: 1.0.1
kind: Scheduled
Stages and Predicates
Stage 0: let
let Lookback = 1h;
let MinUploadBytes = 1073741824;
let MinUploadRatio = 95.0;
Stage 1: source
CommonSecurityLog
Stage 2: where
| where TimeGenerated > ago(Lookback)
Stage 3: where
| where DeviceProduct has_any ("ASA")
Stage 4: where
| where isnotempty(SourceIP) and isnotempty(DestinationIP)
Stage 5: where
| where ipv4_is_private(SourceIP)
Stage 6: where
| where not(ipv4_is_private(DestinationIP))
Stage 7: where
| where DeviceAction in~ ("allow", "allowed", "accept", "accepted", "permitted")
Stage 8: extend
| extend SentBytesLong = tolong(SentBytes)
Stage 9: extend
| extend ReceivedBytesLong = tolong(ReceivedBytes)
Stage 10: where
| where isnotnull(SentBytesLong)
Stage 11: summarize
| summarize
TotalBytesSent = sum(SentBytesLong),
TotalBytesReceived = sum(coalesce(ReceivedBytesLong, 0)),
Connections = count(),
DestinationPorts = make_set(DestinationPort, 20),
Applications = make_set(ApplicationProtocol, 20),
FirstSeen = min(TimeGenerated),
LastSeen = max(TimeGenerated)
by SourceIP, DestinationIP
Stage 12: where
| where TotalBytesSent >= MinUploadBytes
Stage 13: extend (3 consecutive steps)
| extend TotalGBSent = round(TotalBytesSent / 1024.0 / 1024.0 / 1024.0, 2)
| extend TotalGBReceived = round(TotalBytesReceived / 1024.0 / 1024.0 / 1024.0, 2)
| extend UploadRatio = round(todouble(TotalBytesSent) / todouble(TotalBytesSent + TotalBytesReceived) * 100, 2)
Stage 14: where
| where UploadRatio >= MinUploadRatio
Stage 15: project
| project
TimeGenerated = LastSeen,
SourceIP,
DestinationIP,
TotalGBSent,
TotalGBReceived,
UploadRatio,
Connections,
DestinationPorts,
Applications,
FirstSeen,
LastSeen
Stage 16: sort
| order by TotalGBSent desc
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
DestinationIP | is_not_null | field:"DestinationIP" kind:is_not_null | |
DeviceAction | in |
| field:"DeviceAction" kind:in |
DeviceProduct | match |
| field:"DeviceProduct" kind:match value:"ASA" |
SentBytesLong | is_not_null | field:"SentBytesLong" kind:is_not_null | |
SourceIP | cidr_match |
| field:"SourceIP" kind:cidr_match |
SourceIP | is_not_null | field:"SourceIP" kind:is_not_null | |
TotalBytesSent | ge |
| field:"TotalBytesSent" kind:ge value:"1073741824" |
UploadRatio | ge |
| field:"UploadRatio" kind:ge value:"95.0" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
DestinationIP | cidr_match | 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, 127.0.0.0/8 | excludes:DestinationIP |
Output fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Applications | project |
Connections | project |
DestinationIP | project |
DestinationPorts | project |
FirstSeen | project |
LastSeen | project |
SourceIP | project |
TimeGenerated | project |
TotalGBReceived | project |
TotalGBSent | project |
UploadRatio | project |