Detection rules › Kusto

Cisco ASA - Possible Data Exfiltration Detection

Status
available
Severity
medium
Time window
1h
Group by
DestinationIP, SourceIP
Source
github.com/Azure/Azure-Sentinel

'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

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.

FieldKindValuesSearch
DestinationIPis_not_null
  • (no value, null check)
field:"DestinationIP" kind:is_not_null
DeviceActionin
  • accept
  • accepted
  • allow
  • allowed
  • permitted
field:"DeviceAction" kind:in
DeviceProductmatch
  • ASA transforms: term
field:"DeviceProduct" kind:match value:"ASA"
SentBytesLongis_not_null
  • (no value, null check)
field:"SentBytesLong" kind:is_not_null
SourceIPcidr_match
  • 10.0.0.0/8
  • 127.0.0.0/8
  • 169.254.0.0/16
  • 172.16.0.0/12
  • 192.168.0.0/16
field:"SourceIP" kind:cidr_match
SourceIPis_not_null
  • (no value, null check)
field:"SourceIP" kind:is_not_null
TotalBytesSentge
  • 1073741824
field:"TotalBytesSent" kind:ge value:"1073741824"
UploadRatioge
  • 95.0
field:"UploadRatio" kind:ge value:"95.0"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
DestinationIPcidr_match10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, 127.0.0.0/8excludes:DestinationIP

Output fields

These fields are emitted when the rule matches.

FieldSource
Applicationsproject
Connectionsproject
DestinationIPproject
DestinationPortsproject
FirstSeenproject
LastSeenproject
SourceIPproject
TimeGeneratedproject
TotalGBReceivedproject
TotalGBSentproject
UploadRatioproject