Detection: Gsuite Outbound Email With Attachment To External Domain

Description

The following analytic detects outbound emails with attachments sent from an internal email domain to an external domain. It leverages Gsuite Gmail logs, parsing the source and destination email domains, and flags emails with fewer than 20 outbound instances. This activity is significant as it may indicate potential data exfiltration or insider threats. If confirmed malicious, an attacker could use this method to exfiltrate sensitive information, leading to data breaches and compliance violations.

 1`gsuite_gmail` num_message_attachments > 0 
 2| rex field=source.from_header_address "[^@]+@(?<source_domain>[^@]+)" 
 3| rex field=destination{}.address "[^@]+@(?<dest_domain>[^@]+)" 
 4| where source_domain="internal_test_email.com" and not dest_domain="internal_test_email.com" 
 5| eval phase="plan" 
 6| eval severity="low" 
 7| stats values(subject) as subject, values(source.from_header_address) as src_domain_list, count as numEvents, dc(source.from_header_address) as numSrcAddresses, min(_time) as firstTime max(_time) as lastTime by dest_domain phase severity 
 8| where numSrcAddresses < 20 
 9|sort - numSrcAddresses 
10| `security_content_ctime(firstTime)` 
11| `security_content_ctime(lastTime)` 
12| `gsuite_outbound_email_with_attachment_to_external_domain_filter`

Data Source

Name Platform Sourcetype Source Supported App
G Suite Gmail N/A 'gsuite:gmail:bigquery' 'http:gsuite' N/A

Macros Used

Name Value
gsuite_gmail sourcetype=gsuite:gmail:bigquery
gsuite_outbound_email_with_attachment_to_external_domain_filter search *
gsuite_outbound_email_with_attachment_to_external_domain_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1048.003 Exfiltration Over Unencrypted Non-C2 Protocol Exfiltration
T1048 Exfiltration Over Alternative Protocol Exfiltration
KillChainPhase.ACTIONS_ON_OBJECTIVES
NistCategory.DE_AE
Cis18Value.CIS_10
APT32
APT33
FIN6
FIN8
Lazarus Group
OilRig
Thrip
Wizard Spider
TeamTNT

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event False
This configuration file applies to all detections of type hunting.

Implementation

To successfully implement this search, you need to be ingesting logs related to gsuite having the file attachment metadata like file type, file extension, source email, destination email, num of attachment and etc.

Known False Positives

network admin and normal user may send this file attachment as part of their day to day work. having a good protocol in attaching this file type to an e-mail may reduce the risk of having a spear phishing attack.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
Suspicious email from $src_domain_list$ to $dest_domain$ 9 30 30
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset http:gsuite gsuite:gmail:bigquery
Integration ✅ Passing Dataset http:gsuite gsuite:gmail:bigquery

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 3