nldcsc-elastic-rules 0.0.8__py3-none-any.whl → 0.0.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. nldcsc_elastic_rules/__init__.py +1 -1
  2. nldcsc_elastic_rules/rules/{linux → cross-platform}/command_and_control_curl_wget_spawn_via_nodejs_parent.toml +32 -11
  3. nldcsc_elastic_rules/rules/cross-platform/command_and_control_genai_process_suspicious_tld_connection.toml +134 -0
  4. nldcsc_elastic_rules/rules/cross-platform/command_and_control_genai_process_unusual_domain.toml +128 -0
  5. nldcsc_elastic_rules/rules/cross-platform/credential_access_genai_process_sensitive_file_access.toml +154 -0
  6. nldcsc_elastic_rules/rules/cross-platform/credential_access_gitleaks_execution.toml +114 -0
  7. nldcsc_elastic_rules/rules/cross-platform/credential_access_multi_could_secrets_via_api.toml +198 -0
  8. nldcsc_elastic_rules/rules/cross-platform/credential_access_trufflehog_execution.toml +24 -5
  9. nldcsc_elastic_rules/rules/cross-platform/defense_evasion_genai_config_modification.toml +120 -0
  10. nldcsc_elastic_rules/rules/cross-platform/defense_evasion_genai_process_compiling_executables.toml +158 -0
  11. nldcsc_elastic_rules/rules/cross-platform/defense_evasion_genai_process_encoding_prior_to_network_activity.toml +172 -0
  12. nldcsc_elastic_rules/rules/cross-platform/defense_evasion_potential_http_downgrade_attack.toml +98 -0
  13. nldcsc_elastic_rules/rules/cross-platform/discovery_web_server_local_file_inclusion_activity.toml +172 -0
  14. nldcsc_elastic_rules/rules/cross-platform/discovery_web_server_remote_file_inclusion_activity.toml +133 -0
  15. nldcsc_elastic_rules/rules/cross-platform/execution_aws_ec2_lolbin_via_ssm.toml +250 -0
  16. nldcsc_elastic_rules/rules/{linux/persistence_nodejs_pre_or_post_install_script_execution.toml → cross-platform/execution_nodejs_pre_or_post_install_script_execution.toml} +40 -24
  17. nldcsc_elastic_rules/rules/cross-platform/execution_privileged_container_creation_with_host_reference.toml +146 -0
  18. nldcsc_elastic_rules/rules/cross-platform/execution_register_github_actions_runner.toml +126 -0
  19. nldcsc_elastic_rules/rules/cross-platform/execution_via_github_actions_runner.toml +130 -0
  20. nldcsc_elastic_rules/rules/cross-platform/execution_via_github_runner_with_runner_tracking_id_tampering_via_env_vars.toml +163 -0
  21. nldcsc_elastic_rules/rules/cross-platform/initial_access_execution_susp_react_serv_child.toml +130 -0
  22. nldcsc_elastic_rules/rules/cross-platform/initial_access_file_upload_followed_by_get_request.toml +145 -0
  23. nldcsc_elastic_rules/rules/cross-platform/multiple_alerts_elastic_defend_netsecurity_by_host.toml +4 -1
  24. nldcsc_elastic_rules/rules/cross-platform/persistence_credential_access_modify_auth_module_or_config.toml +3 -4
  25. nldcsc_elastic_rules/rules/cross-platform/persistence_web_server_potential_command_injection.toml +23 -25
  26. nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_discovery_or_fuzzing_activity.toml +13 -14
  27. nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_unusual_spike_in_error_logs.toml +8 -5
  28. nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_unusual_spike_in_error_response_codes.toml +12 -12
  29. nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_unusual_user_agents.toml +37 -43
  30. nldcsc_elastic_rules/rules/integrations/aws/defense_evasion_rds_instance_restored.toml +137 -45
  31. nldcsc_elastic_rules/rules/integrations/aws/discovery_iam_principal_enumeration_via_update_assume_role_policy.toml +152 -0
  32. nldcsc_elastic_rules/rules/integrations/aws/discovery_multiple_discovery_api_calls_via_cli.toml +242 -0
  33. nldcsc_elastic_rules/rules/integrations/aws/exfiltration_rds_snapshot_export.toml +141 -33
  34. nldcsc_elastic_rules/rules/integrations/aws/exfiltration_rds_snapshot_shared_with_another_account.toml +108 -30
  35. nldcsc_elastic_rules/rules/integrations/aws/exfiltration_s3_bucket_policy_added_for_external_account_access.toml +2 -1
  36. nldcsc_elastic_rules/rules/integrations/aws/exfiltration_s3_bucket_replicated_to_external_account.toml +114 -27
  37. nldcsc_elastic_rules/rules/integrations/aws/impact_efs_filesystem_deleted.toml +174 -0
  38. nldcsc_elastic_rules/rules/integrations/aws/impact_kms_cmk_disabled_or_scheduled_for_deletion.toml +111 -33
  39. nldcsc_elastic_rules/rules/integrations/aws/impact_rds_instance_cluster_deletion.toml +129 -43
  40. nldcsc_elastic_rules/rules/integrations/aws/impact_rds_instance_cluster_deletion_protection_disabled.toml +89 -27
  41. nldcsc_elastic_rules/rules/integrations/aws/impact_rds_snapshot_deleted.toml +127 -37
  42. nldcsc_elastic_rules/rules/integrations/aws/impact_s3_object_encryption_with_external_key.toml +160 -43
  43. nldcsc_elastic_rules/rules/integrations/aws/initial_access_iam_session_token_used_from_multiple_addresses.toml +20 -10
  44. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_error_message_spike.toml +35 -1
  45. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_error_code.toml +59 -1
  46. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_method_by_city.toml +19 -1
  47. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_method_by_country.toml +19 -1
  48. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_method_by_user.toml +58 -1
  49. nldcsc_elastic_rules/rules/integrations/aws/persistence_rds_db_instance_password_modified.toml +109 -35
  50. nldcsc_elastic_rules/rules/integrations/aws/persistence_rds_instance_made_public.toml +103 -22
  51. nldcsc_elastic_rules/rules/integrations/aws/persistence_redshift_instance_creation.toml +3 -3
  52. nldcsc_elastic_rules/rules/integrations/aws/privilege_escalation_sts_assume_root_from_rare_user_and_member_account.toml +126 -69
  53. nldcsc_elastic_rules/rules/integrations/azure/credential_access_azure_entra_susp_device_code_signin.toml +134 -0
  54. nldcsc_elastic_rules/rules/integrations/azure/credential_access_entra_id_excessive_account_lockouts.toml +2 -2
  55. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_event_failures.toml +124 -0
  56. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_event_failures.toml +148 -0
  57. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_method_by_city.toml +109 -0
  58. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_method_by_country.toml +108 -0
  59. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_method_by_user.toml +147 -0
  60. nldcsc_elastic_rules/rules/integrations/fim/persistence_suspicious_file_modifications.toml +9 -1
  61. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_error_message_spike.toml +95 -0
  62. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_error_code.toml +118 -0
  63. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_method_by_city.toml +79 -0
  64. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_method_by_country.toml +79 -0
  65. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_method_by_user.toml +117 -0
  66. nldcsc_elastic_rules/rules/integrations/github/initial_access_github_register_self_hosted_runner.toml +92 -0
  67. nldcsc_elastic_rules/rules/integrations/o365/collection_onedrive_excessive_file_downloads.toml +24 -14
  68. nldcsc_elastic_rules/rules/linux/defense_evasion_file_deletion_via_shred.toml +12 -5
  69. nldcsc_elastic_rules/rules/linux/execution_suspicious_pod_or_container_creation_command_execution.toml +150 -0
  70. nldcsc_elastic_rules/rules/linux/persistence_at_job_creation.toml +4 -4
  71. nldcsc_elastic_rules/rules/linux/persistence_pluggable_authentication_module_creation.toml +12 -7
  72. nldcsc_elastic_rules/rules/linux/persistence_pth_file_creation.toml +6 -1
  73. nldcsc_elastic_rules/rules/linux/persistence_site_and_user_customize_file_creation.toml +6 -1
  74. nldcsc_elastic_rules/rules/linux/persistence_web_server_unusual_command_execution.toml +155 -0
  75. nldcsc_elastic_rules/rules/ml/ml_high_count_events_for_a_host_name.toml +58 -1
  76. nldcsc_elastic_rules/rules/ml/ml_high_count_network_denies.toml +71 -1
  77. nldcsc_elastic_rules/rules/ml/ml_high_count_network_events.toml +53 -1
  78. nldcsc_elastic_rules/rules/ml/ml_linux_anomalous_network_activity.toml +56 -1
  79. nldcsc_elastic_rules/rules/ml/ml_linux_anomalous_network_port_activity.toml +40 -1
  80. nldcsc_elastic_rules/rules/ml/ml_low_count_events_for_a_host_name.toml +27 -1
  81. nldcsc_elastic_rules/rules/ml/ml_packetbeat_rare_server_domain.toml +63 -1
  82. nldcsc_elastic_rules/rules/ml/ml_rare_destination_country.toml +68 -1
  83. nldcsc_elastic_rules/rules/ml/ml_spike_in_traffic_to_a_country.toml +53 -1
  84. nldcsc_elastic_rules/rules/ml/ml_windows_anomalous_network_activity.toml +56 -1
  85. nldcsc_elastic_rules/rules/network/initial_access_react_server_components_rce_attempt.toml +123 -0
  86. nldcsc_elastic_rules/rules/promotions/external_alerts.toml +2 -2
  87. nldcsc_elastic_rules/rules/windows/command_and_control_common_webservices.toml +4 -3
  88. nldcsc_elastic_rules/rules/windows/credential_access_rare_webdav_destination.toml +3 -4
  89. nldcsc_elastic_rules/rules/windows/defense_evasion_masquerading_as_svchost.toml +11 -8
  90. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation.toml +25 -2
  91. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_backtick.toml +2 -3
  92. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_backtick_var.toml +2 -3
  93. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_char_arrays.toml +2 -3
  94. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_concat_dynamic.toml +2 -3
  95. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_high_number_proportion.toml +2 -3
  96. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_iex_env_vars_reconstruction.toml +2 -3
  97. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_iex_string_reconstruction.toml +2 -3
  98. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_index_reversal.toml +2 -3
  99. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_reverse_keyword.toml +2 -3
  100. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_string_concat.toml +2 -3
  101. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_string_format.toml +2 -3
  102. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_whitespace_special_proportion.toml +2 -3
  103. nldcsc_elastic_rules/rules/windows/defense_evasion_wsl_filesystem.toml +13 -10
  104. nldcsc_elastic_rules/rules/windows/execution_posh_hacktool_functions.toml +3 -2
  105. nldcsc_elastic_rules/rules/windows/execution_suspicious_powershell_imgload.toml +7 -2
  106. nldcsc_elastic_rules/rules/windows/execution_windows_powershell_susp_args.toml +9 -2
  107. nldcsc_elastic_rules/rules/windows/impact_mod_critical_os_files.toml +16 -6
  108. nldcsc_elastic_rules/rules/windows/lateral_movement_credential_access_kerberos_correlation.toml +7 -2
  109. nldcsc_elastic_rules/rules/windows/lateral_movement_scheduled_task_target.toml +2 -2
  110. nldcsc_elastic_rules/rules/windows/persistence_browser_extension_install.toml +19 -2
  111. nldcsc_elastic_rules/rules/windows/persistence_msi_installer_task_startup.toml +50 -13
  112. nldcsc_elastic_rules/rules/windows/persistence_via_application_shimming.toml +12 -2
  113. nldcsc_elastic_rules/rules/windows/privilege_escalation_tokenmanip_sedebugpriv_enabled.toml +24 -18
  114. nldcsc_elastic_rules/rules/windows/privilege_escalation_unusual_printspooler_childprocess.toml +14 -2
  115. nldcsc_elastic_rules/rules/windows/privilege_escalation_via_ppid_spoofing.toml +3 -2
  116. {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/METADATA +1 -1
  117. {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/RECORD +119 -87
  118. nldcsc_elastic_rules/rules/integrations/aws/credential_access_aws_iam_assume_role_brute_force.toml +0 -105
  119. nldcsc_elastic_rules/rules/integrations/aws/discovery_ec2_multi_region_describe_instances.toml +0 -135
  120. nldcsc_elastic_rules/rules/integrations/aws/discovery_ec2_multiple_discovery_api_calls_via_cli.toml +0 -155
  121. nldcsc_elastic_rules/rules/integrations/aws/impact_efs_filesystem_or_mount_deleted.toml +0 -95
  122. {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/WHEEL +0 -0
  123. {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/top_level.txt +0 -0
@@ -2,62 +2,132 @@
2
2
  creation_date = "2021/06/06"
3
3
  integration = ["aws"]
4
4
  maturity = "production"
5
- updated_date = "2025/01/15"
5
+ updated_date = "2025/11/24"
6
6
 
7
7
  [rule]
8
8
  author = ["Elastic", "Austin Songer"]
9
- description = "Identifies the export of an Amazon Relational Database Service (RDS) Aurora database snapshot."
9
+ description = """
10
+ Identifies the export of a DB snapshot or DB cluster data to Amazon S3. Snapshot exports can be used for analytics or
11
+ migration workflows, but adversaries may abuse them to exfiltrate sensitive data outside of RDS-managed storage.
12
+ Exporting a snapshot creates a portable copy of the database contents, which, if performed without authorization, can
13
+ indicate data theft, staging for exfiltration, or operator misconfiguration that exposes regulated information.
14
+ """
10
15
  false_positives = [
11
16
  """
12
- Exporting snapshots may be done by a system or network administrator. Verify whether the user identity, user agent,
13
- and/or hostname should be making changes in your environment. Snapshot exports from unfamiliar users or hosts should
14
- be investigated. If known behavior is causing false positives, it can be exempted from the rule.
17
+ Snapshot exports may be performed by administrators, automation pipelines, or data engineering workflows. Confirm
18
+ whether the export was expected and initiated by an authorized user, role, or automation process. Snapshot exports
19
+ by unfamiliar principals or from unexpected networks should be investigated. If known behavior causes false
20
+ positives, it can be exempted from the rule.
15
21
  """,
16
22
  ]
17
- from = "now-60m"
23
+ from = "now-6m"
18
24
  index = ["filebeat-*", "logs-aws.cloudtrail-*"]
19
- interval = "10m"
20
25
  language = "kuery"
21
26
  license = "Elastic License v2"
22
27
  name = "AWS RDS Snapshot Export"
23
28
  note = """## Triage and analysis
24
29
 
25
30
  > **Disclaimer**:
26
- > This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
31
+ > This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance.
32
+ > While every effort has been made to ensure its quality, validate and adapt it to suit your operational needs.
27
33
 
28
34
  ### Investigating AWS RDS Snapshot Export
29
35
 
30
- Amazon RDS Snapshot Export allows users to export Aurora database snapshots to Amazon S3, facilitating data analysis and backup. However, adversaries may exploit this feature to exfiltrate sensitive data by exporting snapshots without authorization. The detection rule monitors successful export tasks in AWS CloudTrail logs, flagging potential misuse by identifying unexpected or unauthorized snapshot exports.
31
-
32
- ### Possible investigation steps
33
-
34
- - Review the AWS CloudTrail logs for the specific event.action:StartExportTask to identify the user or role that initiated the export task.
35
- - Check the event.provider:rds.amazonaws.com logs to verify the source IP address and location from which the export task was initiated, looking for any anomalies or unexpected locations.
36
- - Investigate the event.dataset:aws.cloudtrail logs to determine the specific database snapshot that was exported and assess its sensitivity or criticality.
37
- - Cross-reference the event.outcome:success with IAM policies and permissions to ensure the user or role had legitimate access to perform the export task.
38
- - Analyze any recent changes in IAM roles or policies that might have inadvertently granted export permissions to unauthorized users.
39
- - Contact the data owner or relevant stakeholders to confirm whether the export task was authorized and aligns with business needs.
36
+ Exporting an RDS snapshot to Amazon S3 allows the full contents of a database to be written outside the managed
37
+ RDS service boundary. While legitimate for analytics or migration, this action can also be a mechanism for data
38
+ exfiltration. Because snapshot exports produce files that can be downloaded, shared, or accessed by other AWS principals,
39
+ unauthorized exports may indicate staging for data theft or attempts to bypass database access controls.
40
+
41
+ This rule detects successful `StartExportTask` events. Activity of this type should be validated to ensure that only
42
+ authorized database, platform engineering, or analytics workflows initiated the export.
43
+
44
+ #### Possible investigation steps
45
+
46
+ - **Identify the actor and context**
47
+ - Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` to determine which principal initiated the export.
48
+ - Look at `source.ip`, `user.name`, and `user_agent.original` to understand where the export originated (console, CLI, SDK, automation).
49
+ - Check whether the principal has historically performed snapshot exports.
50
+
51
+ - **Determine what was exported**
52
+ - Examine `aws.cloudtrail.request_parameters`:
53
+ - Snapshot identifier being exported.
54
+ - S3 bucket name and path.
55
+ - KMS key used (or absence of encryption).
56
+ - Map the snapshot and destination bucket to:
57
+ - Application/owner team.
58
+ - Environment (prod/staging/dev).
59
+ - Data classification (PII, PHI, PCI, internal).
60
+
61
+ - **Reconstruct timing and surrounding context**
62
+ - Use `@timestamp` to correlate the export with:
63
+ - Recent RDS modifications (`ModifyDBInstance`, `ModifyDBCluster`), snapshot deletions, or retention changes.
64
+ - IAM role changes, access key issuance, or privilege escalation attempts.
65
+ - Unusual authentication patterns (e.g., successful logins from new locations, failed console logins).
66
+ - Check whether the export timing aligns with approved deployments or maintenance windows.
67
+
68
+ - **Correlate with broader CloudTrail activity**
69
+ - Pivot on the same user, role, or access key ID to look for:
70
+ - Prior reconnaissance (e.g., `DescribeDBSnapshots`, `DescribeDBClusters`, `ListBuckets`).
71
+ - Permission changes (`PutRolePolicy`, `AttachUserPolicy`).
72
+ - Public exposure (e.g., S3 bucket ACL changes).
73
+ - Determine whether multiple snapshots were exported around the same time.
74
+
75
+ - **Validate intent with stakeholders**
76
+ - Confirm with the database owner, analytics team, or platform engineering team whether:
77
+ - The export was planned and authorized.
78
+ - The target S3 bucket is approved for storing database contents.
79
+ - Encryption and access controls meet organizational policy.
40
80
 
41
81
  ### False positive analysis
42
82
 
43
- - Routine data exports for legitimate business purposes may trigger alerts. Users should review export tasks to confirm they align with expected business operations and consider whitelisting known, authorized export activities.
44
- - Automated backup processes that regularly export snapshots to S3 can be mistaken for unauthorized actions. Identify and document these processes, then create exceptions in the monitoring system to prevent false alerts.
45
- - Development and testing environments often involve frequent snapshot exports for testing purposes. Ensure these environments are clearly identified and excluded from alerts by setting up specific rules or tags that differentiate them from production environments.
46
- - Exports initiated by third-party services or integrations that have been granted access to RDS snapshots might be flagged. Verify these integrations and adjust the detection rule to recognize and exclude these trusted services.
83
+ - **Authorized data analytics or ETL workflows**
84
+ - Many organizations export snapshots for reporting, ML pipelines, or external data processing.
85
+ - Validate that the export aligns with documented ETL or analytics processes.
47
86
 
48
- ### Response and remediation
87
+ - **Automated snapshot export tools**
88
+ - Backup pipelines, cost optimization, or data replication systems may export snapshots.
89
+ - Tune the rule by excluding known IAM roles or automation user agents.
49
90
 
50
- - Immediately revoke access to the AWS account or IAM role that initiated the unauthorized snapshot export to prevent further data exfiltration.
51
- - Conduct a thorough review of AWS CloudTrail logs to identify any other unauthorized activities associated with the same account or IAM role, and assess the scope of the potential data breach.
52
- - Notify the security team and relevant stakeholders about the incident, providing details of the unauthorized export and any other suspicious activities discovered.
53
- - Restore the affected database from a known good backup if data integrity is suspected to be compromised, ensuring that the restored data is free from unauthorized changes.
54
- - Implement stricter IAM policies and permissions to limit who can perform snapshot exports, ensuring that only authorized personnel have the necessary permissions.
55
- - Enhance monitoring and alerting mechanisms to detect any future unauthorized snapshot export attempts, ensuring timely response to similar threats.
56
- - Conduct a post-incident review to identify gaps in security controls and update incident response plans to improve readiness for future incidents.
91
+ - **CloudFormation or IaC triggers**
92
+ - Infrastructure-as-code pipelines may trigger snapshot exports as part of stack updates.
93
+ - Correlate with CloudFormation events to confirm legitimacy.
57
94
 
58
- ## Setup
95
+ ### Response and remediation
59
96
 
60
- The AWS Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
97
+ - **Contain potential exfiltration**
98
+ - Review access to the destination S3 bucket and confirm that:
99
+ - Bucket is encrypted with the expected KMS key.
100
+ - Access is restricted to authorized principals.
101
+ - No unusual downloads or cross-account accesses occurred.
102
+
103
+ - **Investigate scope and impact**
104
+ - Use CloudTrail to enumerate:
105
+ - All export tasks started by the same actor.
106
+ - Other snapshot or data-access API calls in the same time window.
107
+ - Validate whether sensitive or regulated data may have been included.
108
+
109
+ - **Credential and access remediation**
110
+ - If activity appears unauthorized:
111
+ - Revoke or rotate compromised IAM credentials.
112
+ - Review STS session activity related to the actor.
113
+ - Inspect IAM role policies for privilege escalation.
114
+
115
+ - **Hardening and preventive controls**
116
+ - Restrict the ability to call `StartExportTask` using:
117
+ - IAM least-privilege policies.
118
+ - Service Control Policies (SCPs) in production accounts.
119
+ - Conditional IAM (e.g., requiring MFA, restricting by VPC endpoint or IP range).
120
+ - Enable guardrails:
121
+ - AWS Config/Security Hub controls for monitoring snapshot policy changes.
122
+ - Alerts for exports to buckets outside approved accounts.
123
+
124
+ ### Additional information
125
+
126
+ - **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
127
+ - **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
128
+ - **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
129
+
130
+ """
61
131
  references = ["https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_StartExportTask.html"]
62
132
  risk_score = 21
63
133
  rule_id = "119c8877-8613-416d-a98a-96b6664ee73a"
@@ -67,6 +137,7 @@ tags = [
67
137
  "Data Source: AWS",
68
138
  "Data Source: Amazon Web Services",
69
139
  "Use Case: Asset Visibility",
140
+ "Tactic: Collection",
70
141
  "Tactic: Exfiltration",
71
142
  "Resources: Investigation Guide",
72
143
  ]
@@ -74,7 +145,10 @@ timestamp_override = "event.ingested"
74
145
  type = "query"
75
146
 
76
147
  query = '''
77
- event.dataset:aws.cloudtrail and event.provider:rds.amazonaws.com and event.action:StartExportTask and event.outcome:success
148
+ event.dataset: aws.cloudtrail
149
+ and event.provider: rds.amazonaws.com
150
+ and event.action: StartExportTask
151
+ and event.outcome: success
78
152
  '''
79
153
 
80
154
 
@@ -85,4 +159,38 @@ framework = "MITRE ATT&CK"
85
159
  id = "TA0010"
86
160
  name = "Exfiltration"
87
161
  reference = "https://attack.mitre.org/tactics/TA0010/"
162
+ [[rule.threat]]
163
+ framework = "MITRE ATT&CK"
164
+ [[rule.threat.technique]]
165
+ id = "T1213"
166
+ name = "Data from Information Repositories"
167
+ reference = "https://attack.mitre.org/techniques/T1213/"
168
+ [[rule.threat.technique.subtechnique]]
169
+ id = "T1213.006"
170
+ name = "Databases"
171
+ reference = "https://attack.mitre.org/techniques/T1213/006/"
172
+
173
+
174
+
175
+ [rule.threat.tactic]
176
+ id = "TA0009"
177
+ name = "Collection"
178
+ reference = "https://attack.mitre.org/tactics/TA0009/"
179
+
180
+ [rule.investigation_fields]
181
+ field_names = [
182
+ "@timestamp",
183
+ "user.name",
184
+ "user_agent.original",
185
+ "source.ip",
186
+ "aws.cloudtrail.user_identity.arn",
187
+ "aws.cloudtrail.user_identity.type",
188
+ "aws.cloudtrail.user_identity.access_key_id",
189
+ "event.action",
190
+ "event.outcome",
191
+ "cloud.account.id",
192
+ "cloud.region",
193
+ "aws.cloudtrail.request_parameters",
194
+ "aws.cloudtrail.response_elements",
195
+ ]
88
196
 
@@ -2,16 +2,23 @@
2
2
  creation_date = "2024/06/25"
3
3
  integration = ["aws"]
4
4
  maturity = "production"
5
- updated_date = "2025/01/10"
5
+ updated_date = "2025/12/05"
6
6
 
7
7
  [rule]
8
8
  author = ["Elastic"]
9
9
  description = """
10
- Identifies an AWS RDS DB snapshot being shared with another AWS account. DB snapshots contain a full backup of an entire DB instance including sensitive data that can be abused if shared with unauthorized accounts or made public. Adversaries may use snapshots to restore a DB Instance in an environment they control as a means of data exfiltration.
10
+ Identifies when an AWS RDS DB snapshot is shared with another AWS account or made public. DB snapshots contain complete
11
+ backups of database instances, including schemas, table data, and sensitive application content. When shared externally,
12
+ snapshots can be restored in another AWS environment, enabling unauthorized access, offline analysis, or data
13
+ exfiltration. Adversaries who obtain valid credentials or exploit misconfigurations may modify snapshot attributes to
14
+ grant access to accounts they control, bypassing network, IAM, and monitoring controls.
11
15
  """
16
+ event_category_override = "event.type"
12
17
  false_positives = [
13
18
  """
14
- DB snapshot sharing is a common practice in AWS environments. Ensure that the sharing is authorized before taking action.
19
+ Cross-account DB snapshot sharing is common in multi-account AWS Organizations, particularly for backup workflows,
20
+ migrations, analytics pipelines, and disaster recovery. Ensure the added account is expected, previously approved,
21
+ and aligns with operational change plans before taking action.
15
22
  """,
16
23
  ]
17
24
  from = "now-6m"
@@ -19,43 +26,94 @@ index = ["filebeat-*", "logs-aws.cloudtrail-*"]
19
26
  language = "eql"
20
27
  license = "Elastic License v2"
21
28
  name = "AWS RDS DB Snapshot Shared with Another Account"
22
- note = """
23
- ## Triage and analysis
29
+ note = """## Triage and analysis
30
+
31
+ > **Disclaimer**:
32
+ > This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
24
33
 
25
34
  ### Investigating AWS RDS DB Snapshot Shared with Another Account
26
35
 
27
- This rule identifies when an RDS DB snapshot is shared with another AWS account. While sharing DB snapshots is a common practice, adversaries may exploit this feature to exfiltrate data by sharing snapshots with external accounts under their control.
36
+ Amazon RDS DB snapshots capture full backups of database instances and clusters. Modifying a snapshot’s restore
37
+ attributes to include external AWS accounts allows those accounts to restore and fully access the underlying data.
38
+ While cross-account snapshot sharing is widely used for migrations and disaster-recovery workflows, adversaries may
39
+ abuse this mechanism for stealthy data exfiltration, restoring the snapshot in infrastructure they control, outside of your monitoring boundary.
40
+
41
+ This rule detects successful modifications to snapshot attributes where one or more additional AWS accounts are added to the snapshot’s restore permissions.
42
+
43
+ #### Possible investigation steps
44
+
45
+ - **Identify the actor and context**
46
+ - Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id`.
47
+ - Determine whether the caller is an automation role, interactive user, CI/CD pipeline, or previously unseen principal.
48
+ - Check `source.ip` and `user_agent.original` for signs of unauthorized access or atypical tooling.
49
+
50
+ - **Understand what snapshot was shared**
51
+ - From `aws.cloudtrail.request_parameters`, extract:
52
+ - The snapshot or cluster snapshot identifier.
53
+ - The list of `valuesToAdd` accounts added to `attributeName=restore`.
54
+ - Identify the associated database instance or cluster and evaluate:
55
+ - Data classification level (PII, customer data, secrets, credentials, financials, etc.)
56
+ - Application ownership and business impact.
57
+
58
+ - **Validate the external account**
59
+ - Determine whether the recipient account:
60
+ - Belongs to your AWS Organization.
61
+ - Has previously been authorized for snapshot restore operations.
62
+ - Represents a new or unexpected dependency.
63
+ - Cross-reference with known partner accounts or migration plans.
64
+
65
+ - **Correlate with related activity**
66
+ - Pivot in CloudTrail on the same user identity or account to identify:
67
+ - Prior reconnaissance actions (`DescribeDBSnapshots`, `DescribeDBInstances`).
68
+ - Snapshot copying or creation of manual snapshots just before sharing.
69
+ - IAM privilege escalation (`AttachRolePolicy`, `PutUserPolicy`, `AssumeRole` patterns).
70
+ - Unusual RDS configuration changes (backup retention decrease, deletion protection toggles).
71
+
72
+ - **Assess for exfiltration indicators**
73
+ - Look for:
74
+ - Subsequent `CopyDBSnapshot` or `StartExportTask` events.
75
+ - Snapshot downloads, exports, or restoration from the external account.
76
+ - Snapshot attributes set to `all` (public sharing), which is extremely dangerous.
28
77
 
29
- #### Possible Investigation Steps
78
+ - **Validate operational intent**
79
+ - Contact application owners, DBAs, or platform teams to confirm:
80
+ - Whether migration, replication, or DR workflows explain the share.
81
+ - Whether new accounts were intentionally onboarded.
82
+ - Whether the timing aligns with approved change windows.
30
83
 
31
- - **Identify the Actor**: Review the `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` fields to identify who made the change. Verify if this actor typically performs such actions and if they have the necessary permissions.
32
- - **Review the Sharing Event**: Identify the DB snapshot involved and review the event details. Look for `ModifyDBSnapshotAttribute` or `ModifyDBClusterSnapshotAttribute` actions where the snapshot attributes were changed to include additional user accounts.
33
- - **Request and Response Parameters**: Check the `aws.cloudtrail.request_parameters` and `aws.cloudtrail.response_elements` fields in the CloudTrail event to identify the DB Snapshot Identifier and account ID with which the snapshot was shared.
34
- - **Verify the Shared Snapshot**: Check the DB snapshot that was shared and its contents to determine the sensitivity of the data stored within it.
35
- - **Validate External Account**: Examine the AWS account to which the snapshot was shared. Determine whether this account is known and previously authorized to access such resources.
36
- - **Contextualize with Recent Changes**: Compare this sharing event against recent changes in RDS DB or Cluster configurations and deployments. Look for any other recent permissions changes or unusual administrative actions.
37
- - **Correlate with Other Activities**: Search for related CloudTrail events before and after this change to see if the same actor or IP address engaged in other potentially suspicious activities.
38
- - **Interview Relevant Personnel**: If the share was initiated by a user, verify the intent and authorization for this action with the person or team responsible for managing DB backups and snapshots.
84
+ ### False positive analysis
39
85
 
40
- ### False Positive Analysis
86
+ - **Legitimate migration or DR workflows**
87
+ - Many organizations routinely share snapshots with other accounts for staging, analytics, or DR replication.
41
88
 
42
- - **Legitimate Backup Actions**: Confirm if the Db snapshot sharing aligns with scheduled backups or legitimate automation tasks.
43
- - **Consistency Check**: Compare the action against historical data of similar actions performed by the user or within the organization. If the action is consistent with past legitimate activities, it might indicate a false alarm.
89
+ - **Automation roles**
90
+ - Infrastructure-as-code pipelines and backup automation tools may modify snapshot permissions as part of normal behavior.
44
91
 
45
- ### Response and Remediation
92
+ If behavior is expected and consistently performed by a known principal, tune the rule using exceptional user identities, service roles, or controlled organizational accounts.
46
93
 
47
- - **Immediate Review and Reversal**: If the change was unauthorized, update the snapshot permissions to remove any unauthorized accounts and restore it to its previous state.
48
- - **Enhance Monitoring and Alerts**: Adjust monitoring systems to alert on similar actions, especially those involving sensitive data or permissions.
49
- - **Audit Snapshots and Policies**: Conduct a comprehensive audit of all snapshots and associated policies to ensure they adhere to the principle of least privilege.
50
- - **Policy Update**: Review and possibly update your organization’s policies on DB snapshot sharing to tighten control and prevent unauthorized access.
51
- - **Incident Response**: If malicious intent is confirmed, consider it a data breach incident and initiate the incident response protocol. This includes further investigation, containment, and recovery.
94
+ ### Response and remediation
52
95
 
53
- ### Additional Information:
96
+ - **Revoke unauthorized sharing**
97
+ - Immediately remove unauthorized accounts from snapshot restore attributes.
98
+ - Ensure the snapshot is not publicly shared.
54
99
 
55
- For further guidance on managing DB backups and securing AWS environments, refer to the [AWS RDS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_CommonTasks.BackupRestore.html) and AWS best practices for security. Additionally, consult the following resources for specific details on DB snapshot security:
56
- - [AWS RDS DB Snapshot Sharing](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ShareSnapshot.html)
57
- - [AWS RDS ModifyDBSnapshotAttribute](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBSnapshotAttribute.html)
58
- - [AWS RDS Snapshot Dump](https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-post-exploitation/aws-rds-post-exploitation#rds-modifydbsnapshotattribute-rds-createdbsnapshot)
100
+ - **Contain potential compromise**
101
+ - Rotate access keys or credentials for the principal that performed the modification.
102
+ - Review IAM permissions to ensure only approved roles can share snapshots.
103
+
104
+ - **Assess impact**
105
+ - Determine whether the external account restored the snapshot and accessed data.
106
+ - If data exposure is likely, notify compliance, legal, and incident response teams.
107
+
108
+ - **Hardening and preventive controls**
109
+ - Restrict snapshot sharing via IAM condition keys (`kms:ViaService`, `rds:dbSnapshotArn`, `aws:PrincipalArn`).
110
+ - Use AWS Organizations SCPs to block cross-account snapshot sharing in production accounts.
111
+ - Enable Config rules and Security Hub controls for public or cross-account snapshot access.
112
+
113
+ ### Additional information
114
+ - **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
115
+ - **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
116
+ - **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
59
117
  """
60
118
  references = [
61
119
  "https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBSnapshotAttribute.html",
@@ -78,7 +136,7 @@ timestamp_override = "event.ingested"
78
136
  type = "eql"
79
137
 
80
138
  query = '''
81
- any where event.dataset == "aws.cloudtrail"
139
+ info where event.dataset == "aws.cloudtrail"
82
140
  and event.provider == "rds.amazonaws.com"
83
141
  and event.outcome == "success"
84
142
  and event.action in ("ModifyDBSnapshotAttribute", "ModifyDBClusterSnapshotAttribute")
@@ -86,6 +144,7 @@ any where event.dataset == "aws.cloudtrail"
86
144
  and stringContains(aws.cloudtrail.request_parameters, "valuesToAdd=[*]")
87
145
  '''
88
146
 
147
+
89
148
  [[rule.threat]]
90
149
  framework = "MITRE ATT&CK"
91
150
  [[rule.threat.technique]]
@@ -93,8 +152,27 @@ id = "T1537"
93
152
  name = "Transfer Data to Cloud Account"
94
153
  reference = "https://attack.mitre.org/techniques/T1537/"
95
154
 
155
+
96
156
  [rule.threat.tactic]
97
157
  id = "TA0010"
98
158
  name = "Exfiltration"
99
159
  reference = "https://attack.mitre.org/tactics/TA0010/"
100
160
 
161
+ [rule.investigation_fields]
162
+ field_names = [
163
+ "@timestamp",
164
+ "user.name",
165
+ "user_agent.original",
166
+ "source.ip",
167
+ "aws.cloudtrail.user_identity.arn",
168
+ "aws.cloudtrail.user_identity.type",
169
+ "aws.cloudtrail.user_identity.access_key_id",
170
+ "target.entity.id",
171
+ "event.action",
172
+ "event.outcome",
173
+ "cloud.account.id",
174
+ "cloud.region",
175
+ "aws.cloudtrail.request_parameters",
176
+ "aws.cloudtrail.response_elements",
177
+ ]
178
+
@@ -2,7 +2,7 @@
2
2
  creation_date = "2024/04/17"
3
3
  integration = ["aws"]
4
4
  maturity = "production"
5
- updated_date = "2025/10/30"
5
+ updated_date = "2025/12/04"
6
6
 
7
7
  [rule]
8
8
  author = ["Elastic"]
@@ -136,6 +136,7 @@ query = '''
136
136
  info where event.dataset == "aws.cloudtrail"
137
137
  and event.provider == "s3.amazonaws.com"
138
138
  and event.action == "PutBucketPolicy"
139
+ and event.outcome == "success"
139
140
  and stringContains(aws.cloudtrail.request_parameters, "Effect=Allow")
140
141
  and (
141
142
  stringContains(aws.cloudtrail.request_parameters, "AWS=") or
@@ -2,16 +2,24 @@
2
2
  creation_date = "2024/07/12"
3
3
  integration = ["aws"]
4
4
  maturity = "production"
5
- updated_date = "2025/01/10"
5
+ updated_date = "2025/12/04"
6
6
 
7
7
  [rule]
8
8
  author = ["Elastic"]
9
9
  description = """
10
- Identifies when the `PutBucketReplication` operation is used to replicate S3 objects to a bucket in another AWS account. Adversaries may use bucket replication to exfiltrate sensitive data to an environment they control.
10
+ Identifies the creation or modification of an S3 bucket replication configuration that sends data to a bucket in a
11
+ different AWS account. Cross-account replication can be used legitimately for backup, disaster recovery, and
12
+ multi-account architectures, but adversaries with write access to an S3 bucket may abuse replication rules to silently
13
+ exfiltrate large volumes of data to attacker-controlled accounts. This rule detects "PutBucketReplication" events where
14
+ the configured destination account differs from the source bucket's account, indicating potential unauthorized
15
+ cross-account data movement.
11
16
  """
17
+ event_category_override = "event.type"
12
18
  false_positives = [
13
19
  """
14
- Bucket replication accross accounts is a legitimate practice in some AWS environments. Ensure that the sharing is authorized before taking action.
20
+ Cross-account S3 replication is common in multi-account AWS Organizations, centralized logging architectures, and
21
+ disaster-recovery designs. Confirm whether the destination account is an approved replication target. Unexpected
22
+ replication configuration changes should be treated as suspicious.
15
23
  """,
16
24
  ]
17
25
  from = "now-6m"
@@ -19,39 +27,97 @@ index = ["filebeat-*", "logs-aws.cloudtrail-*"]
19
27
  language = "eql"
20
28
  license = "Elastic License v2"
21
29
  name = "AWS S3 Bucket Replicated to Another Account"
22
- note = """
23
- ## Triage and analysis
30
+ note = """## Triage and analysis
24
31
 
25
32
  ### Investigating AWS S3 Bucket Replicated to Another Account
26
33
 
27
- This rule identifies when an S3 bucket is replicated to another AWS account. While sharing bucket replication is a common practice, adversaries may exploit this feature to exfiltrate data by replicating objects to external accounts under their control.
34
+ Cross-account S3 replication enables automated copying of S3 objects into a different AWS bucket. While useful for backup and organizational data flows, adversaries may exploit it as a covert exfiltration channel. Once replication is configured, any future writes to the bucket are silently copied to the destination bucket—even if object-level access controls block the attacker’s direct downloads. For this reason, unauthorized replication configuration should be considered high-risk.
28
35
 
29
- #### Possible Investigation Steps
36
+ This rule detects successful `PutBucketReplication` events and flags cases where the replication configuration specifies a destination AWS account different from the source.
30
37
 
31
- - **Identify the Actor**: Review the `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` fields to identify who made the change. Verify if this actor typically performs such actions and if they have the necessary permissions.
32
- - **Review the Sharing Event**: Identify the S3 bucket involved and review the event details. Look for `PutBucketReplication` actions where an `Account` key-value pair is included signifying replication to an external account.
33
- - **Request and Response Parameters**: Check the `aws.cloudtrail.request_parameters` and `aws.cloudtrail.response_elements` fields in the CloudTrail event to identify the role used and account ID where the bucket was replicated.
34
- - **Verify the Shared Bucket**: Check the S3 bucket that was replicated and its contents to determine the sensitivity of the data stored within it.
35
- - **Validate External Account**: Examine the AWS account to which the bucket was replicated. Determine whether this account is known and previously authorized to access such resources.
36
- - **Contextualize with Recent Changes**: Compare this sharing event against recent changes in S3 configurations. Look for any other recent permissions changes or unusual administrative actions.
37
- - **Correlate with Other Activities**: Search for related CloudTrail events before and after this change to see if the same actor or IP address engaged in other potentially suspicious activities.
38
- - **Interview Relevant Personnel**: If the share was initiated by a user, verify the intent and authorization for this action with the person or team responsible for managing DB backups and snapshots.
38
+ #### Possible investigation steps
39
39
 
40
- ### False Positive Analysis
40
+ **Understand who initiated the replication change**
41
+ - Inspect `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` to identify the actor.
42
+ - Review authentication patterns such as federated session names, role chaining via STS, or unfamiliar IAM roles.
43
+ - Examine `source.ip`, `source.geo` fields, and `user_agent.original` for unusual locations, automation tools, or anomalous access paths.
41
44
 
42
- - **Legitimate Backup Actions**: Confirm if the S3 bucket replication aligns with scheduled backups or legitimate automation tasks.
43
- - **Consistency Check**: Compare the action against historical data of similar actions performed by the user or within the organization. If the action is consistent with past legitimate activities, it might indicate a false alarm.
45
+ **Examine the replication rule details**
46
+ - Inspect `aws.cloudtrail.request_parameters` for:
47
+ - The **destination account ID** (`Account=`).
48
+ - The **IAM role ARN** used for replication. (`Role=`)
49
+ - Any filtering rules (prefixes, tags) that narrow or broaden what will be replicated.
44
50
 
45
- ### Response and Remediation
51
+ **Determine whether the destination account is authorized**
52
+ - Validate whether the destination AWS account belongs to your AWS Organization.
53
+ - Check internal documentation, IaC templates, or tagging standards to confirm whether replication to this account is expected.
54
+ - Look for prior legitimate infrastructure workflows such as:
55
+ - Centralized logging
56
+ - Backup/DR accounts
57
+ - Cross-region compliance replicas
46
58
 
47
- - **Immediate Review and Reversal**: If the change was unauthorized, update the S3 configurations to remove any unauthorized replication rules.
48
- - **Enhance Monitoring and Alerts**: Adjust monitoring systems to alert on similar actions, especially those involving sensitive data or permissions.
49
- - **Policy Update**: Review and possibly update your organization’s policies on S3 bucket/object sharing to tighten control and prevent unauthorized access.
50
- - **Incident Response**: If malicious intent is confirmed, consider it a data breach incident and initiate the incident response protocol. This includes further investigation, containment, and recovery.
59
+ Unrecognized accounts should be treated as a strong exfiltration signal.
51
60
 
52
- ### Additional Information:
61
+ **Assess the scope of potential data exposure**
62
+ - Determine whether the bucket contains sensitive or regulated data (PII, financial records, secrets, logs, etc.).
63
+ - Identify whether object versioning, lifecycle rules, or access logging were modified recently.
64
+ - Check for preceding or subsequent actions such as:
65
+ - `PutBucketPolicy` updates granting new principals access
66
+ - Creation or modification of IAM roles tied to replication
67
+ - `DeleteObject` or `PutObjectRetention` attempts that might pair with exfiltration
53
68
 
54
- For further guidance on managing and securing S3 buckets in AWS environments, refer to the [AWS S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/security.html/) and AWS best practices for security.
69
+ **Correlate with other suspicious activity**
70
+ Pivot in CloudTrail on the same principal or same bucket:
71
+ - Prior reconnaissance such as `ListBuckets`, `GetBucketReplication`, or `GetBucketPolicy`
72
+ - Modification of KMS policies or unexpected encryption key usage
73
+ - New access patterns from external IP addresses or unusual automation
74
+
75
+ ### False positive analysis
76
+
77
+ **Legitimate cross-account replication**
78
+ Validate:
79
+ - The destination account belongs to a known OU or business unit
80
+ - The replication role ARN matches expected automation
81
+ - The change aligns with documented deployment or maintenance schedules
82
+
83
+ **Temporary migrations or transitions**
84
+ During account restructuring or workload migration, administrators may temporarily redirect replication to new accounts.
85
+
86
+ Tuning options:
87
+ - Exception lists based on IAM role ARNs
88
+ - Tag-based environment scoping
89
+ - Change-window-based suppression
90
+
91
+ ### Response and remediation
92
+
93
+ **Contain potential exfiltration**
94
+ - Remove or update replication rules to eliminate unauthorized destinations.
95
+ - Disable or restrict the replication IAM role until the investigation is complete.
96
+ - Review S3 object access logs to determine whether data has begun replicating to the external account.
97
+
98
+ **Investigate scope and impact**
99
+ - Identify the volume and types of data at risk of replication.
100
+ - Determine whether the external bucket shows successful replication traffic (if logs or access are available).
101
+ - Assess whether the actor also modified bucket policies, encryption settings, or KMS keys.
102
+
103
+ **Credential and role hygiene**
104
+ - Rotate credentials for the initiating user or role if compromise is suspected.
105
+ - Review IAM role trust policies, especially if STS sessions or EC2 role assumptions were involved.
106
+ - Enable MFA and tighten conditions for administrative roles capable of modifying replication.
107
+
108
+ **Hardening and preventive controls**
109
+ - Enforce SCPs that restrict cross-account replication except for explicitly approved destinations.
110
+ - Require approval workflows before modifying replication or retention settings.
111
+ - Use AWS Config and Security Hub controls to detect:
112
+ - Buckets with unexpected replication rules
113
+ - Newly added cross-account permissions
114
+ - Changes to bucket policies, block-public-access settings, or KMS key policies
115
+
116
+ ### Additional information
117
+
118
+ - **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
119
+ - **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
120
+ - **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
55
121
  """
56
122
  references = [
57
123
  "https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-walkthrough-2.html/",
@@ -73,12 +139,13 @@ timestamp_override = "event.ingested"
73
139
  type = "eql"
74
140
 
75
141
  query = '''
76
- any where event.dataset == "aws.cloudtrail"
142
+ info where event.dataset == "aws.cloudtrail"
77
143
  and event.action == "PutBucketReplication"
78
144
  and event.outcome == "success"
79
- and stringContains(aws.cloudtrail.request_parameters, "Account")
145
+ and stringContains(aws.cloudtrail.request_parameters, "Account=")
80
146
  '''
81
147
 
148
+
82
149
  [[rule.threat]]
83
150
  framework = "MITRE ATT&CK"
84
151
  [[rule.threat.technique]]
@@ -86,8 +153,28 @@ id = "T1537"
86
153
  name = "Transfer Data to Cloud Account"
87
154
  reference = "https://attack.mitre.org/techniques/T1537/"
88
155
 
156
+
89
157
  [rule.threat.tactic]
90
158
  id = "TA0010"
91
159
  name = "Exfiltration"
92
160
  reference = "https://attack.mitre.org/tactics/TA0010/"
93
161
 
162
+ [rule.investigation_fields]
163
+ field_names = [
164
+ "@timestamp",
165
+ "user.name",
166
+ "user_agent.original",
167
+ "source.ip",
168
+ "aws.cloudtrail.user_identity.arn",
169
+ "aws.cloudtrail.user_identity.type",
170
+ "aws.cloudtrail.user_identity.access_key_id",
171
+ "aws.cloudtrail.resources.arn",
172
+ "aws.cloudtrail.resources.type",
173
+ "target.entity.id",
174
+ "event.action",
175
+ "event.outcome",
176
+ "cloud.account.id",
177
+ "cloud.region",
178
+ "aws.cloudtrail.request_parameters",
179
+ ]
180
+