EXPLORE
← Back to Explore
splunk_escuTTP

AWS Exfiltration via DataSync Task

The following analytic detects the creation of an AWS DataSync task, which could indicate potential data exfiltration. It leverages AWS CloudTrail logs to identify the `CreateTask` event from the DataSync service. This activity is significant because attackers can misuse DataSync to transfer sensitive data from a private AWS location to a public one, leading to data compromise. If confirmed malicious, this could result in unauthorized access to sensitive information, causing severe data breaches and compliance violations.

Detection Query

`cloudtrail` eventName = CreateTask eventSource="datasync.amazonaws.com"
  | rename  requestParameters.*  as *
  | rename user_name as user
  | stats count min(_time) as firstTime max(_time) as lastTime
    BY signature dest user
       user_agent src vendor_account
       vendor_region vendor_product destinationLocationArn
       sourceLocationArn
  | `security_content_ctime(firstTime)`
  | `security_content_ctime(lastTime)`
  | `aws_exfiltration_via_datasync_task_filter`

Author

Bhavin Patel, Splunk

Data Sources

AWS CloudTrail CreateTask
Raw Content
name: AWS Exfiltration via DataSync Task
id: 05c4b09f-ea28-4c7c-a7aa-a246f665c8a2
version: 11
creation_date: '2023-04-10'
modification_date: '2026-05-13'
author: Bhavin Patel, Splunk
status: production
type: TTP
description: The following analytic detects the creation of an AWS DataSync task, which could indicate potential data exfiltration. It leverages AWS CloudTrail logs to identify the `CreateTask` event from the DataSync service. This activity is significant because attackers can misuse DataSync to transfer sensitive data from a private AWS location to a public one, leading to data compromise. If confirmed malicious, this could result in unauthorized access to sensitive information, causing severe data breaches and compliance violations.
data_source:
    - AWS CloudTrail CreateTask
search: |-
    `cloudtrail` eventName = CreateTask eventSource="datasync.amazonaws.com"
      | rename  requestParameters.*  as *
      | rename user_name as user
      | stats count min(_time) as firstTime max(_time) as lastTime
        BY signature dest user
           user_agent src vendor_account
           vendor_region vendor_product destinationLocationArn
           sourceLocationArn
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `aws_exfiltration_via_datasync_task_filter`
how_to_implement: You must install splunk AWS add on and Splunk App for AWS. This search works with AWS CloudTrail logs.
known_false_positives: It is possible that an AWS Administrator has legitimately created this task for creating backup. Please check the `sourceLocationArn` and `destinationLocationArn` of this task
references:
    - https://labs.nettitude.com/blog/how-to-exfiltrate-aws-ec2-data/
    - https://www.shehackske.com/how-to/data-exfiltration-on-cloud-1606/
drilldown_searches:
    - name: View the detection results for - "$aws_account_id$"
      search: '%original_detection_search% | search  user = "$user$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$user$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
      earliest_offset: 7d
      latest_offset: "0"
finding:
    title: DataSync task created on account id - $vendor_account$ by user $user$ from src_ip $src$
    entity:
        field: user
        type: user
        score: 50
threat_objects:
    - field: src
      type: ip_address
analytic_story:
    - Suspicious AWS S3 Activities
    - Data Exfiltration
    - Hellcat Ransomware
asset_type: AWS Account
mitre_attack_id:
    - T1119
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: threat
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1119/aws_exfil_datasync/cloudtrail.json
          sourcetype: aws:cloudtrail
          source: aws_cloudtrail
      test_type: unit