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.
- nldcsc_elastic_rules/__init__.py +1 -1
- nldcsc_elastic_rules/rules/{linux → cross-platform}/command_and_control_curl_wget_spawn_via_nodejs_parent.toml +32 -11
- nldcsc_elastic_rules/rules/cross-platform/command_and_control_genai_process_suspicious_tld_connection.toml +134 -0
- nldcsc_elastic_rules/rules/cross-platform/command_and_control_genai_process_unusual_domain.toml +128 -0
- nldcsc_elastic_rules/rules/cross-platform/credential_access_genai_process_sensitive_file_access.toml +154 -0
- nldcsc_elastic_rules/rules/cross-platform/credential_access_gitleaks_execution.toml +114 -0
- nldcsc_elastic_rules/rules/cross-platform/credential_access_multi_could_secrets_via_api.toml +198 -0
- nldcsc_elastic_rules/rules/cross-platform/credential_access_trufflehog_execution.toml +24 -5
- nldcsc_elastic_rules/rules/cross-platform/defense_evasion_genai_config_modification.toml +120 -0
- nldcsc_elastic_rules/rules/cross-platform/defense_evasion_genai_process_compiling_executables.toml +158 -0
- nldcsc_elastic_rules/rules/cross-platform/defense_evasion_genai_process_encoding_prior_to_network_activity.toml +172 -0
- nldcsc_elastic_rules/rules/cross-platform/defense_evasion_potential_http_downgrade_attack.toml +98 -0
- nldcsc_elastic_rules/rules/cross-platform/discovery_web_server_local_file_inclusion_activity.toml +172 -0
- nldcsc_elastic_rules/rules/cross-platform/discovery_web_server_remote_file_inclusion_activity.toml +133 -0
- nldcsc_elastic_rules/rules/cross-platform/execution_aws_ec2_lolbin_via_ssm.toml +250 -0
- 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
- nldcsc_elastic_rules/rules/cross-platform/execution_privileged_container_creation_with_host_reference.toml +146 -0
- nldcsc_elastic_rules/rules/cross-platform/execution_register_github_actions_runner.toml +126 -0
- nldcsc_elastic_rules/rules/cross-platform/execution_via_github_actions_runner.toml +130 -0
- nldcsc_elastic_rules/rules/cross-platform/execution_via_github_runner_with_runner_tracking_id_tampering_via_env_vars.toml +163 -0
- nldcsc_elastic_rules/rules/cross-platform/initial_access_execution_susp_react_serv_child.toml +130 -0
- nldcsc_elastic_rules/rules/cross-platform/initial_access_file_upload_followed_by_get_request.toml +145 -0
- nldcsc_elastic_rules/rules/cross-platform/multiple_alerts_elastic_defend_netsecurity_by_host.toml +4 -1
- nldcsc_elastic_rules/rules/cross-platform/persistence_credential_access_modify_auth_module_or_config.toml +3 -4
- nldcsc_elastic_rules/rules/cross-platform/persistence_web_server_potential_command_injection.toml +23 -25
- nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_discovery_or_fuzzing_activity.toml +13 -14
- nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_unusual_spike_in_error_logs.toml +8 -5
- nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_unusual_spike_in_error_response_codes.toml +12 -12
- nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_unusual_user_agents.toml +37 -43
- nldcsc_elastic_rules/rules/integrations/aws/defense_evasion_rds_instance_restored.toml +137 -45
- nldcsc_elastic_rules/rules/integrations/aws/discovery_iam_principal_enumeration_via_update_assume_role_policy.toml +152 -0
- nldcsc_elastic_rules/rules/integrations/aws/discovery_multiple_discovery_api_calls_via_cli.toml +242 -0
- nldcsc_elastic_rules/rules/integrations/aws/exfiltration_rds_snapshot_export.toml +141 -33
- nldcsc_elastic_rules/rules/integrations/aws/exfiltration_rds_snapshot_shared_with_another_account.toml +108 -30
- nldcsc_elastic_rules/rules/integrations/aws/exfiltration_s3_bucket_policy_added_for_external_account_access.toml +2 -1
- nldcsc_elastic_rules/rules/integrations/aws/exfiltration_s3_bucket_replicated_to_external_account.toml +114 -27
- nldcsc_elastic_rules/rules/integrations/aws/impact_efs_filesystem_deleted.toml +174 -0
- nldcsc_elastic_rules/rules/integrations/aws/impact_kms_cmk_disabled_or_scheduled_for_deletion.toml +111 -33
- nldcsc_elastic_rules/rules/integrations/aws/impact_rds_instance_cluster_deletion.toml +129 -43
- nldcsc_elastic_rules/rules/integrations/aws/impact_rds_instance_cluster_deletion_protection_disabled.toml +89 -27
- nldcsc_elastic_rules/rules/integrations/aws/impact_rds_snapshot_deleted.toml +127 -37
- nldcsc_elastic_rules/rules/integrations/aws/impact_s3_object_encryption_with_external_key.toml +160 -43
- nldcsc_elastic_rules/rules/integrations/aws/initial_access_iam_session_token_used_from_multiple_addresses.toml +20 -10
- nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_error_message_spike.toml +35 -1
- nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_error_code.toml +59 -1
- nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_method_by_city.toml +19 -1
- nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_method_by_country.toml +19 -1
- nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_method_by_user.toml +58 -1
- nldcsc_elastic_rules/rules/integrations/aws/persistence_rds_db_instance_password_modified.toml +109 -35
- nldcsc_elastic_rules/rules/integrations/aws/persistence_rds_instance_made_public.toml +103 -22
- nldcsc_elastic_rules/rules/integrations/aws/persistence_redshift_instance_creation.toml +3 -3
- nldcsc_elastic_rules/rules/integrations/aws/privilege_escalation_sts_assume_root_from_rare_user_and_member_account.toml +126 -69
- nldcsc_elastic_rules/rules/integrations/azure/credential_access_azure_entra_susp_device_code_signin.toml +134 -0
- nldcsc_elastic_rules/rules/integrations/azure/credential_access_entra_id_excessive_account_lockouts.toml +2 -2
- nldcsc_elastic_rules/rules/integrations/azure/ml_azure_event_failures.toml +124 -0
- nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_event_failures.toml +148 -0
- nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_method_by_city.toml +109 -0
- nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_method_by_country.toml +108 -0
- nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_method_by_user.toml +147 -0
- nldcsc_elastic_rules/rules/integrations/fim/persistence_suspicious_file_modifications.toml +9 -1
- nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_error_message_spike.toml +95 -0
- nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_error_code.toml +118 -0
- nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_method_by_city.toml +79 -0
- nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_method_by_country.toml +79 -0
- nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_method_by_user.toml +117 -0
- nldcsc_elastic_rules/rules/integrations/github/initial_access_github_register_self_hosted_runner.toml +92 -0
- nldcsc_elastic_rules/rules/integrations/o365/collection_onedrive_excessive_file_downloads.toml +24 -14
- nldcsc_elastic_rules/rules/linux/defense_evasion_file_deletion_via_shred.toml +12 -5
- nldcsc_elastic_rules/rules/linux/execution_suspicious_pod_or_container_creation_command_execution.toml +150 -0
- nldcsc_elastic_rules/rules/linux/persistence_at_job_creation.toml +4 -4
- nldcsc_elastic_rules/rules/linux/persistence_pluggable_authentication_module_creation.toml +12 -7
- nldcsc_elastic_rules/rules/linux/persistence_pth_file_creation.toml +6 -1
- nldcsc_elastic_rules/rules/linux/persistence_site_and_user_customize_file_creation.toml +6 -1
- nldcsc_elastic_rules/rules/linux/persistence_web_server_unusual_command_execution.toml +155 -0
- nldcsc_elastic_rules/rules/ml/ml_high_count_events_for_a_host_name.toml +58 -1
- nldcsc_elastic_rules/rules/ml/ml_high_count_network_denies.toml +71 -1
- nldcsc_elastic_rules/rules/ml/ml_high_count_network_events.toml +53 -1
- nldcsc_elastic_rules/rules/ml/ml_linux_anomalous_network_activity.toml +56 -1
- nldcsc_elastic_rules/rules/ml/ml_linux_anomalous_network_port_activity.toml +40 -1
- nldcsc_elastic_rules/rules/ml/ml_low_count_events_for_a_host_name.toml +27 -1
- nldcsc_elastic_rules/rules/ml/ml_packetbeat_rare_server_domain.toml +63 -1
- nldcsc_elastic_rules/rules/ml/ml_rare_destination_country.toml +68 -1
- nldcsc_elastic_rules/rules/ml/ml_spike_in_traffic_to_a_country.toml +53 -1
- nldcsc_elastic_rules/rules/ml/ml_windows_anomalous_network_activity.toml +56 -1
- nldcsc_elastic_rules/rules/network/initial_access_react_server_components_rce_attempt.toml +123 -0
- nldcsc_elastic_rules/rules/promotions/external_alerts.toml +2 -2
- nldcsc_elastic_rules/rules/windows/command_and_control_common_webservices.toml +4 -3
- nldcsc_elastic_rules/rules/windows/credential_access_rare_webdav_destination.toml +3 -4
- nldcsc_elastic_rules/rules/windows/defense_evasion_masquerading_as_svchost.toml +11 -8
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation.toml +25 -2
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_backtick.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_backtick_var.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_char_arrays.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_concat_dynamic.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_high_number_proportion.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_iex_env_vars_reconstruction.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_iex_string_reconstruction.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_index_reversal.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_reverse_keyword.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_string_concat.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_string_format.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_whitespace_special_proportion.toml +2 -3
- nldcsc_elastic_rules/rules/windows/defense_evasion_wsl_filesystem.toml +13 -10
- nldcsc_elastic_rules/rules/windows/execution_posh_hacktool_functions.toml +3 -2
- nldcsc_elastic_rules/rules/windows/execution_suspicious_powershell_imgload.toml +7 -2
- nldcsc_elastic_rules/rules/windows/execution_windows_powershell_susp_args.toml +9 -2
- nldcsc_elastic_rules/rules/windows/impact_mod_critical_os_files.toml +16 -6
- nldcsc_elastic_rules/rules/windows/lateral_movement_credential_access_kerberos_correlation.toml +7 -2
- nldcsc_elastic_rules/rules/windows/lateral_movement_scheduled_task_target.toml +2 -2
- nldcsc_elastic_rules/rules/windows/persistence_browser_extension_install.toml +19 -2
- nldcsc_elastic_rules/rules/windows/persistence_msi_installer_task_startup.toml +50 -13
- nldcsc_elastic_rules/rules/windows/persistence_via_application_shimming.toml +12 -2
- nldcsc_elastic_rules/rules/windows/privilege_escalation_tokenmanip_sedebugpriv_enabled.toml +24 -18
- nldcsc_elastic_rules/rules/windows/privilege_escalation_unusual_printspooler_childprocess.toml +14 -2
- nldcsc_elastic_rules/rules/windows/privilege_escalation_via_ppid_spoofing.toml +3 -2
- {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/METADATA +1 -1
- {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/RECORD +119 -87
- nldcsc_elastic_rules/rules/integrations/aws/credential_access_aws_iam_assume_role_brute_force.toml +0 -105
- nldcsc_elastic_rules/rules/integrations/aws/discovery_ec2_multi_region_describe_instances.toml +0 -135
- nldcsc_elastic_rules/rules/integrations/aws/discovery_ec2_multiple_discovery_api_calls_via_cli.toml +0 -155
- nldcsc_elastic_rules/rules/integrations/aws/impact_efs_filesystem_or_mount_deleted.toml +0 -95
- {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/WHEEL +0 -0
- {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/top_level.txt +0 -0
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
creation_date = "2024/06/28"
|
|
3
3
|
integration = ["aws"]
|
|
4
4
|
maturity = "production"
|
|
5
|
-
updated_date = "2025/
|
|
5
|
+
updated_date = "2025/11/24"
|
|
6
6
|
|
|
7
7
|
[rule]
|
|
8
8
|
author = ["Elastic"]
|
|
9
9
|
description = """
|
|
10
|
-
Identifies the modification of an AWS RDS DB instance or cluster to
|
|
10
|
+
Identifies the modification of an AWS RDS DB instance or cluster to disable the deletionProtection feature. Deletion
|
|
11
|
+
protection prevents accidental or unauthorized deletion of RDS resources. Adversaries with sufficient permissions may
|
|
12
|
+
disable this protection as a precursor to destructive actions, including the deletion of databases containing sensitive
|
|
13
|
+
or business-critical data. This rule alerts when deletionProtection is explicitly set to false on an RDS DB instance or
|
|
14
|
+
cluster.
|
|
11
15
|
"""
|
|
12
16
|
false_positives = [
|
|
13
17
|
"""
|
|
14
|
-
The deletionProtection feature must be disabled as a prerequisite for deletion of a DB instance or cluster. Ensure
|
|
18
|
+
The deletionProtection feature must be disabled as a prerequisite for deletion of a DB instance or cluster. Ensure
|
|
19
|
+
that the instance should not be modified in this way before taking action.
|
|
15
20
|
""",
|
|
16
21
|
]
|
|
17
22
|
from = "now-6m"
|
|
@@ -19,40 +24,79 @@ index = ["filebeat-*", "logs-aws.cloudtrail-*"]
|
|
|
19
24
|
language = "eql"
|
|
20
25
|
license = "Elastic License v2"
|
|
21
26
|
name = "AWS RDS DB Instance or Cluster Deletion Protection Disabled"
|
|
22
|
-
note = """
|
|
23
|
-
|
|
27
|
+
note = """## Triage and analysis
|
|
28
|
+
|
|
29
|
+
> **Disclaimer**:
|
|
30
|
+
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance.
|
|
31
|
+
> While every effort has been made to ensure its quality, validate and adapt it to suit your operational needs.
|
|
24
32
|
|
|
25
33
|
### Investigating AWS RDS DB Instance or Cluster Deletion Protection Disabled
|
|
34
|
+
|
|
35
|
+
Deletion protection is designed to safeguard RDS DB instances and clusters from accidental or unauthorized deletion. An adversary with privileged access in a compromised environment, can disable this safeguard before issuing a `DeleteDBInstance` or `DeleteDBCluster` action. This rule detects successful attempts to modify deletionProtection and set it to false on any RDS instance or cluster.
|
|
36
|
+
|
|
37
|
+
#### Possible investigation steps
|
|
38
|
+
|
|
39
|
+
- **Identify the Actor**
|
|
40
|
+
- Review `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.type`, and `access_key_id` to determine which IAM principal made the change.
|
|
41
|
+
- Validate whether this principal normally performs RDS lifecycle operations.
|
|
42
|
+
|
|
43
|
+
- **Review Event Details**
|
|
44
|
+
- Inspect `aws.cloudtrail.request_parameters` or `target.entity.id` to confirm the targeted DB instance or cluster identifier.
|
|
45
|
+
- Confirm that the request explicitly contains `deletionProtection=false`.
|
|
46
|
+
|
|
47
|
+
- **Contextualize the Change**
|
|
48
|
+
- Determine if recent activities justify the removal of deletion protection (migration, decommissioning, or maintenance).
|
|
49
|
+
- Compare the timestamp to normal operational hours or deployment windows.
|
|
50
|
+
|
|
51
|
+
- **Correlate with Additional Activity**
|
|
52
|
+
- Look for subsequent or preceding RDS actions such as:
|
|
53
|
+
- `DeleteDBInstance`
|
|
54
|
+
- `DeleteDBCluster`
|
|
55
|
+
- Security group modifications
|
|
56
|
+
- Changes to parameter groups or backup retention policies.
|
|
57
|
+
- Sudden removal of backups or snapshots may indicate imminent destructive activity.
|
|
58
|
+
|
|
59
|
+
- **Verify Environmental Risk**
|
|
60
|
+
- Assess the sensitivity of data stored in the affected DB instance or cluster.
|
|
61
|
+
- Determine if the instance is production, customer-facing, or mission-critical.
|
|
26
62
|
|
|
27
|
-
|
|
63
|
+
- **Interview Relevant Personnel**
|
|
64
|
+
- Confirm with service owners or DB administrators whether the modification was intended and approved.
|
|
28
65
|
|
|
29
|
-
|
|
66
|
+
### False positive analysis
|
|
30
67
|
|
|
31
|
-
- **
|
|
32
|
-
-
|
|
33
|
-
- **Request and Response Parameters**: Check the `aws.cloudtrail.request_parameters` field in the CloudTrail event to identify the DB instance or cluster identifier and any other modifications made to the instance.
|
|
34
|
-
- **Verify the Modified Instance**: Check the DB instance that was modified and its contents to determine the sensitivity of the data stored within it.
|
|
35
|
-
- **Contextualize with Recent Changes**: Compare this modification event against recent changes in RDS DB instance or cluster configurations and deployments. Look for any other recent permissions changes or unusual administrative actions.
|
|
36
|
-
- **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.
|
|
37
|
-
- **Interview Relevant Personnel**: If the modification was initiated by a user, verify the intent and authorization for this action with the person or team responsible for managing DB instances.
|
|
38
|
-
### False Positive Analysis
|
|
68
|
+
- **Expected Decommissioning**
|
|
69
|
+
- Instances undergoing teardown or migration legitimately require deletion protection to be disabled first.
|
|
39
70
|
|
|
40
|
-
- **
|
|
41
|
-
-
|
|
71
|
+
- **Inconsistent Historical Behavior**
|
|
72
|
+
- Compare the action to historical modification patterns for the user or role. If the action aligns with past legitimate changes, it may not be suspicious.
|
|
42
73
|
|
|
43
|
-
### Response and
|
|
74
|
+
### Response and remediation
|
|
44
75
|
|
|
45
|
-
- **Immediate
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
- **Policy Update**: Review and possibly update your organization’s policies on DB instance access to tighten control and prevent unauthorized access.
|
|
49
|
-
- **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.
|
|
76
|
+
- **Immediate Remediation**
|
|
77
|
+
- If unauthorized, re-enable deletion protection (`deletionProtection=true`) on the affected DB instance or cluster.
|
|
78
|
+
- Review security groups, backup retention, and snapshot policies for additional unauthorized changes.
|
|
50
79
|
|
|
51
|
-
|
|
80
|
+
- **Access Review**
|
|
81
|
+
- Investigate credential exposure for the IAM principal that performed the action.
|
|
82
|
+
- Rotate access keys or temporarily revoke permissions if compromise is suspected.
|
|
52
83
|
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
84
|
+
- **Containment**
|
|
85
|
+
- If destructive intent is suspected, apply guardrails (e.g., IAM condition keys, SCPs) to prevent DB deletion.
|
|
86
|
+
|
|
87
|
+
- **Audit and Harden**
|
|
88
|
+
- Ensure RDS instances adhere to least-privilege principles.
|
|
89
|
+
- Restrict who can modify `ModifyDBInstance` or `ModifyDBCluster` destructive settings, such as deletion protection, backup retention, and public accessibility.
|
|
90
|
+
|
|
91
|
+
- **Incident Response Activation**
|
|
92
|
+
- Treat unauthorized removal of deletion protection as a high-risk precursor to data destruction.
|
|
93
|
+
- Trigger IR processes for containment, root cause analysis, and post-incident hardening.
|
|
94
|
+
|
|
95
|
+
### Additional information
|
|
96
|
+
|
|
97
|
+
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
|
|
98
|
+
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
|
|
99
|
+
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
|
|
56
100
|
"""
|
|
57
101
|
references = [
|
|
58
102
|
"https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html",
|
|
@@ -95,3 +139,21 @@ id = "TA0040"
|
|
|
95
139
|
name = "Impact"
|
|
96
140
|
reference = "https://attack.mitre.org/tactics/TA0040/"
|
|
97
141
|
|
|
142
|
+
[rule.investigation_fields]
|
|
143
|
+
field_names = [
|
|
144
|
+
"@timestamp",
|
|
145
|
+
"user.name",
|
|
146
|
+
"user_agent.original",
|
|
147
|
+
"source.ip",
|
|
148
|
+
"aws.cloudtrail.user_identity.arn",
|
|
149
|
+
"aws.cloudtrail.user_identity.type",
|
|
150
|
+
"aws.cloudtrail.user_identity.access_key_id",
|
|
151
|
+
"target.entity.id",
|
|
152
|
+
"event.action",
|
|
153
|
+
"event.outcome",
|
|
154
|
+
"cloud.account.id",
|
|
155
|
+
"cloud.region",
|
|
156
|
+
"aws.cloudtrail.request_parameters",
|
|
157
|
+
"aws.cloudtrail.response_elements",
|
|
158
|
+
]
|
|
159
|
+
|
|
@@ -2,16 +2,22 @@
|
|
|
2
2
|
creation_date = "2024/06/29"
|
|
3
3
|
integration = ["aws"]
|
|
4
4
|
maturity = "production"
|
|
5
|
-
updated_date = "2025/
|
|
5
|
+
updated_date = "2025/11/24"
|
|
6
6
|
|
|
7
7
|
[rule]
|
|
8
8
|
author = ["Elastic"]
|
|
9
9
|
description = """
|
|
10
|
-
Identifies the deletion of an AWS RDS DB snapshot
|
|
10
|
+
Identifies the deletion of an AWS RDS DB snapshot or configuration changes that effectively remove backup coverage for a
|
|
11
|
+
DB instance. RDS snapshots contain full backups of database instances, and disabling automated backups by setting
|
|
12
|
+
"backupRetentionPeriod=0" has a similar impact by preventing future restore points. Adversaries with the appropriate
|
|
13
|
+
permissions may delete snapshots or disable backups to inhibit recovery, destroy forensic evidence, or prepare for
|
|
14
|
+
follow-on destructive actions such as instance or cluster deletion.
|
|
11
15
|
"""
|
|
12
16
|
false_positives = [
|
|
13
17
|
"""
|
|
14
|
-
Snapshots may be deleted by a system administrator. Verify whether the user identity should be making changes in
|
|
18
|
+
Snapshots may be deleted by a system administrator. Verify whether the user identity should be making changes in
|
|
19
|
+
your environment. Snapshot deletions by unfamiliar users or hosts should be investigated. If known behavior is
|
|
20
|
+
causing false positives, it can be exempted from the rule.
|
|
15
21
|
""",
|
|
16
22
|
]
|
|
17
23
|
from = "now-6m"
|
|
@@ -19,6 +25,103 @@ index = ["filebeat-*", "logs-aws.cloudtrail-*"]
|
|
|
19
25
|
language = "eql"
|
|
20
26
|
license = "Elastic License v2"
|
|
21
27
|
name = "AWS RDS Snapshot Deleted"
|
|
28
|
+
note = """## Triage and analysis
|
|
29
|
+
|
|
30
|
+
> **Disclaimer**:
|
|
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.
|
|
33
|
+
|
|
34
|
+
### Investigating AWS RDS Snapshot Deleted
|
|
35
|
+
|
|
36
|
+
AWS RDS snapshots (manual or automated) and backup retention settings are core to database recovery and incident response. Deleting snapshots or disabling automated backups (`backupRetentionPeriod=0`) can prevent restoration to a known-good state and destroy forensic evidence of attacker actions.
|
|
37
|
+
|
|
38
|
+
This rule detects successful snapshot deletions and configuration changes that disable automated backups. Activity that matches this pattern may indicate destructive actions, ransomware preparation, cleanup after data theft, or an operator misconfiguration that materially weakens recovery options.
|
|
39
|
+
|
|
40
|
+
#### Possible investigation steps
|
|
41
|
+
|
|
42
|
+
- **Identify the actor and context**
|
|
43
|
+
- Review `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.type`, and `aws.cloudtrail.user_identity.access_key_id` to determine who performed the action.
|
|
44
|
+
- Check `user.name`, `source.ip`, and `user_agent.original` to understand where and how the change was made (console, CLI, SDK, automation).
|
|
45
|
+
|
|
46
|
+
- **Determine what was affected**
|
|
47
|
+
- Inspect `aws.cloudtrail.request_parameters` to identify:
|
|
48
|
+
- The snapshot or cluster snapshot identifier (`DeleteDBSnapshot` / `DeleteDBClusterSnapshot`).
|
|
49
|
+
- The DB instance identifier and the new `backupRetentionPeriod` value for `ModifyDBInstance`.
|
|
50
|
+
- Map the snapshot/instance to:
|
|
51
|
+
- Application/owner team.
|
|
52
|
+
- Environment (prod, staging, dev).
|
|
53
|
+
- Data sensitivity or criticality.
|
|
54
|
+
|
|
55
|
+
- **Reconstruct intent and timing**
|
|
56
|
+
- Use `@timestamp` to correlate the event with:
|
|
57
|
+
- Recent `ModifyDBInstance`, `ModifyDBCluster`, `DeleteDBInstance`, or `DeleteDBCluster` events.
|
|
58
|
+
- Other data-impacting changes (e.g., `deletionProtection=false`, security group changes, public accessibility, or RDS parameter modifications).
|
|
59
|
+
- Compare the timing against approved maintenance/change windows and deployment pipelines.
|
|
60
|
+
|
|
61
|
+
- **Correlate with broader activity**
|
|
62
|
+
- In CloudTrail, pivot on:
|
|
63
|
+
- The same `aws.cloudtrail.user_identity.arn` or access key ID.
|
|
64
|
+
- The same DB instance/cluster identifiers.
|
|
65
|
+
- Look for:
|
|
66
|
+
- Suspicious reads or exports before deletion (`DescribeDBSnapshots`, `CopyDBSnapshot`, data export, or large `SELECT` / dump activity visible via other telemetry).
|
|
67
|
+
- Follow-on destructive actions (DB instance deletion, subnet/security group changes that isolate monitoring tools, or IAM policy changes).
|
|
68
|
+
- Verify whether other snapshots for the same instance or account were deleted in the same time window.
|
|
69
|
+
|
|
70
|
+
- **Validate intent with owners**
|
|
71
|
+
- Confirm with the DB/application owner and platform/DBA teams whether:
|
|
72
|
+
- The snapshot deletion or backup change was requested and approved.
|
|
73
|
+
- There are parallel infrastructure changes (migrations, environment teardown, or cost-optimization tasks) that explain the activity.
|
|
74
|
+
|
|
75
|
+
### False positive analysis
|
|
76
|
+
|
|
77
|
+
- **Planned lifecycle and cost optimization**
|
|
78
|
+
- Many environments routinely prune old snapshots or adjust backup retention for non-production workloads.
|
|
79
|
+
|
|
80
|
+
- **Automated backup and housekeeping tools**
|
|
81
|
+
- Backup or housekeeping services may manage snapshots and retention. This rule already excludes typical `backup.amazonaws.com` events, but you should:
|
|
82
|
+
- Identify any additional in-house or third-party automation roles.
|
|
83
|
+
- Tune the rule with exceptions based on `user_agent.original`, `aws.cloudtrail.user_identity.arn`, or known service roles.
|
|
84
|
+
|
|
85
|
+
### Response and remediation
|
|
86
|
+
|
|
87
|
+
- **Contain and restore protection**
|
|
88
|
+
- If activity appears unauthorized:
|
|
89
|
+
- Immediately review the affected DB instances and clusters and restore `backupRetentionPeriod` to an appropriate value.
|
|
90
|
+
- Verify that deletion protection and other guardrails are enabled where applicable.
|
|
91
|
+
- For snapshot deletions, assess:
|
|
92
|
+
- Whether alternate snapshots (manual or automated) are still available.
|
|
93
|
+
- Whether point-in-time recovery is still possible based on transaction logs and remaining backups.
|
|
94
|
+
|
|
95
|
+
- **Investigate scope and impact**
|
|
96
|
+
- Use CloudTrail to:
|
|
97
|
+
- Enumerate all recent snapshot deletions and backup configuration changes by the same actor or from the same `source.ip`.
|
|
98
|
+
- Identify any subsequent `DeleteDBInstance`, `DeleteDBCluster`, or public exposure (`publiclyAccessible=true`) events.
|
|
99
|
+
- Engage the application and data owners to:
|
|
100
|
+
- Evaluate potential data loss, downtime impact, and regulatory implications.
|
|
101
|
+
- Determine if any sensitive or compliance-bound data may be unrecoverable.
|
|
102
|
+
|
|
103
|
+
- **Hardening and preventive controls**
|
|
104
|
+
- Restrict RDS administration:
|
|
105
|
+
- Limit `rds:DeleteDBSnapshot`, `rds:DeleteDBClusterSnapshot`, and `rds:ModifyDBInstance` (especially backup and deletion-related parameters) to a small set of privileged roles.
|
|
106
|
+
- Use IAM conditions (e.g., `aws:PrincipalArn`, `aws:RequestedRegion`) to constrain where and by whom destructive actions can be performed.
|
|
107
|
+
- Add guardrails:
|
|
108
|
+
- Use AWS Config rules and/or Security Hub controls to detect:
|
|
109
|
+
- Instances with `backupRetentionPeriod=0`.
|
|
110
|
+
- Instances lacking deletion protection or cross-region/cross-AZ backup strategy.
|
|
111
|
+
- Consider SCPs in AWS Organizations to block or tightly control destructive RDS APIs in production accounts.
|
|
112
|
+
|
|
113
|
+
- **Post-incident improvements**
|
|
114
|
+
- If malicious or unsafe behavior is confirmed:
|
|
115
|
+
- Rotate credentials for the involved principals and review STS session usage.
|
|
116
|
+
- Update runbooks and change management to explicitly track snapshot and backup policy changes.
|
|
117
|
+
- Refine this rule’s exceptions, tags, or severity to better align with your environment while preserving coverage for truly risky events.
|
|
118
|
+
|
|
119
|
+
### Additional information
|
|
120
|
+
|
|
121
|
+
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
|
|
122
|
+
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
|
|
123
|
+
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
|
|
124
|
+
"""
|
|
22
125
|
references = [
|
|
23
126
|
"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteSnapshot.html",
|
|
24
127
|
"https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DeleteDBSnapshot.html",
|
|
@@ -46,41 +149,11 @@ any where event.dataset == "aws.cloudtrail"
|
|
|
46
149
|
event.action in ("DeleteDBSnapshot", "DeleteDBClusterSnapshot") or
|
|
47
150
|
(event.action == "ModifyDBInstance" and stringContains(aws.cloudtrail.request_parameters, "backupRetentionPeriod=0"))
|
|
48
151
|
)
|
|
152
|
+
and not (
|
|
153
|
+
user_agent.original == "backup.amazonaws.com"
|
|
154
|
+
and source.address == "backup.amazonaws.com"
|
|
155
|
+
)
|
|
49
156
|
'''
|
|
50
|
-
note = """## Triage and analysis
|
|
51
|
-
|
|
52
|
-
> **Disclaimer**:
|
|
53
|
-
> 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.
|
|
54
|
-
|
|
55
|
-
### Investigating AWS RDS Snapshot Deleted
|
|
56
|
-
|
|
57
|
-
AWS RDS snapshots are critical for data recovery, capturing full backups of database instances. Adversaries may delete these snapshots to prevent data restoration, effectively causing data loss. The detection rule monitors AWS CloudTrail logs for successful deletion actions or modifications that disable automated backups, signaling potential malicious activity aimed at data destruction.
|
|
58
|
-
|
|
59
|
-
### Possible investigation steps
|
|
60
|
-
|
|
61
|
-
- Review the AWS CloudTrail logs to identify the user or role associated with the event.action values "DeleteDBSnapshot" or "DeleteDBClusterSnapshot" to determine if the action was authorized or expected.
|
|
62
|
-
- Check the timestamp of the deletion event to correlate with any known maintenance activities or incidents that might explain the snapshot deletion.
|
|
63
|
-
- Investigate the source IP address and location from which the deletion request was made to identify any anomalies or unauthorized access patterns.
|
|
64
|
-
- Examine the AWS IAM policies and permissions associated with the user or role to ensure they have the appropriate level of access and to identify any potential over-permissioning.
|
|
65
|
-
- Look for any recent changes in the AWS environment, such as modifications to IAM roles or policies, that could have allowed unauthorized snapshot deletions.
|
|
66
|
-
- If the event.action is "ModifyDBInstance" with "backupRetentionPeriod=0", verify if there was a legitimate reason for disabling automated backups and assess the impact on data recovery capabilities.
|
|
67
|
-
|
|
68
|
-
### False positive analysis
|
|
69
|
-
|
|
70
|
-
- Routine maintenance activities by database administrators may involve deleting old or unnecessary snapshots. To manage this, create exceptions for specific user accounts or roles known to perform these tasks regularly.
|
|
71
|
-
- Automated scripts or tools used for database management might delete snapshots as part of their normal operation. Identify these scripts and exclude their actions from triggering alerts by whitelisting their associated IAM roles or user accounts.
|
|
72
|
-
- Testing environments often involve frequent creation and deletion of snapshots. Consider excluding specific RDS instances or environments used solely for testing purposes to reduce noise in alerts.
|
|
73
|
-
- Scheduled cleanup jobs that remove outdated snapshots to manage storage costs can trigger false positives. Document these jobs and adjust the detection rule to ignore actions performed by these jobs' IAM roles.
|
|
74
|
-
|
|
75
|
-
### Response and remediation
|
|
76
|
-
|
|
77
|
-
- Immediately revoke access to AWS accounts or roles suspected of unauthorized activity to prevent further malicious actions.
|
|
78
|
-
- Restore the deleted RDS snapshots from any available backups or replicas to ensure data recovery and continuity.
|
|
79
|
-
- Enable and configure automated backups for the affected RDS instances to prevent future data loss, ensuring the backupRetentionPeriod is set to a non-zero value.
|
|
80
|
-
- Conduct a thorough review of AWS CloudTrail logs to identify any unauthorized access patterns or anomalies leading up to the snapshot deletion.
|
|
81
|
-
- Escalate the incident to the security operations team for further investigation and to determine if additional AWS resources were compromised.
|
|
82
|
-
- Implement stricter IAM policies and multi-factor authentication for accessing AWS RDS resources to enhance security and prevent unauthorized deletions.
|
|
83
|
-
- Update and test the incident response plan to include specific procedures for handling AWS RDS snapshot deletions, ensuring rapid response in future incidents."""
|
|
84
157
|
|
|
85
158
|
|
|
86
159
|
[[rule.threat]]
|
|
@@ -96,3 +169,20 @@ id = "TA0040"
|
|
|
96
169
|
name = "Impact"
|
|
97
170
|
reference = "https://attack.mitre.org/tactics/TA0040/"
|
|
98
171
|
|
|
172
|
+
[rule.investigation_fields]
|
|
173
|
+
field_names = [
|
|
174
|
+
"@timestamp",
|
|
175
|
+
"user.name",
|
|
176
|
+
"user_agent.original",
|
|
177
|
+
"source.ip",
|
|
178
|
+
"aws.cloudtrail.user_identity.arn",
|
|
179
|
+
"aws.cloudtrail.user_identity.type",
|
|
180
|
+
"aws.cloudtrail.user_identity.access_key_id",
|
|
181
|
+
"event.action",
|
|
182
|
+
"event.outcome",
|
|
183
|
+
"cloud.account.id",
|
|
184
|
+
"cloud.region",
|
|
185
|
+
"aws.cloudtrail.request_parameters",
|
|
186
|
+
"aws.cloudtrail.response_elements",
|
|
187
|
+
]
|
|
188
|
+
|
nldcsc_elastic_rules/rules/integrations/aws/impact_s3_object_encryption_with_external_key.toml
CHANGED
|
@@ -2,61 +2,143 @@
|
|
|
2
2
|
creation_date = "2024/07/02"
|
|
3
3
|
integration = ["aws"]
|
|
4
4
|
maturity = "production"
|
|
5
|
-
updated_date = "2025/
|
|
5
|
+
updated_date = "2025/12/02"
|
|
6
6
|
|
|
7
7
|
[rule]
|
|
8
8
|
author = ["Elastic"]
|
|
9
9
|
description = """
|
|
10
|
-
Identifies
|
|
11
|
-
|
|
12
|
-
key
|
|
10
|
+
Identifies use of the S3 CopyObject API where the destination object is encrypted using an AWS KMS key from an external
|
|
11
|
+
AWS account. This behavior may indicate ransomware-style impact activity where an adversary with access to a
|
|
12
|
+
misconfigured S3 bucket encrypts objects using a KMS key they control, preventing the bucket owner from decrypting their
|
|
13
|
+
own data. This technique is a critical early signal of destructive intent or cross-account misuse.
|
|
13
14
|
"""
|
|
14
15
|
false_positives = [
|
|
15
16
|
"""
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
taking action.
|
|
17
|
+
Cross-account KMS key usage may be legitimate in multi-account AWS Organizations architectures where centralized
|
|
18
|
+
encryption keys are used for data governance or auditing workflows. Confirm whether the external KMS key belongs to
|
|
19
|
+
an expected account before taking action. Data migration or cross-account backup workflows may legitimately
|
|
20
|
+
re-encrypt S3 objects using a key in another account. Ensure these workflows are documented, tied to known IAM
|
|
21
|
+
roles, and occur on predictable schedules.
|
|
19
22
|
""",
|
|
20
23
|
]
|
|
21
|
-
from = "now-
|
|
24
|
+
from = "now-6m"
|
|
22
25
|
language = "esql"
|
|
23
26
|
license = "Elastic License v2"
|
|
24
27
|
name = "AWS S3 Object Encryption Using External KMS Key"
|
|
25
28
|
note = """## Triage and analysis
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
This rule uses [ESQL](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-esql-rule) to look for use of the `CopyObject` operation where the target bucket's `cloud.account.id` is different from the `key.account.id` dissected from the AWS KMS key used for encryption.
|
|
31
|
-
|
|
32
|
-
#### Possible Investigation Steps:
|
|
33
|
-
|
|
34
|
-
- **Identify the Actor**: Review the `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` fields to identify who performed the action. Verify if this actor typically performs such actions and if they have the necessary permissions.
|
|
35
|
-
- **Review the Request Details**: Examine the `aws.cloudtrail.request_parameters` to understand the specific details of the `CopyObject` action. Look for any unusual parameters that could suggest unauthorized or malicious modifications or usage of an unknown KMS keyId.
|
|
36
|
-
- **Analyze the Source of the Request**: Investigate the `source.ip` and `source.geo` fields to determine the geographical origin of the request. An external or unexpected location might indicate compromised credentials or unauthorized access.
|
|
37
|
-
- **Contextualize with Timestamp**: Use the `@timestamp` field to check when the object was copied. Changes during non-business hours or outside regular maintenance windows might require further scrutiny.
|
|
38
|
-
- **Correlate with Other Activities**: Search for related CloudTrail events before and after this action to see if the same actor or IP address engaged in other potentially suspicious activities.
|
|
39
|
-
- **Check for Object Deletion or Access**: Look for `DeleteObject`, `DeleteObjects`, or `GetObject` API calls to the same S3 bucket that may indicate the adversary accessing and destroying objects including older object versions.
|
|
40
|
-
- **Interview Relevant Personnel**: If the copy event was initiated by a user, verify the intent and authorization for this action with the person or team responsible for managing S3 buckets.
|
|
41
|
-
|
|
42
|
-
### False Positive Analysis:
|
|
43
|
-
|
|
44
|
-
- **Legitimate Administrative Actions**: Confirm if the `CopyObject` action aligns with scheduled updates, maintenance activities, or legitimate administrative tasks documented in change management systems.
|
|
45
|
-
- **Consistency Check**: Compare the action against historical data of similar activities performed by the user or within the organization. If the action is consistent with past legitimate activities, it might indicate a false alarm.
|
|
46
|
-
|
|
47
|
-
### Response and Remediation:
|
|
30
|
+
> **Disclaimer**:
|
|
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.
|
|
48
33
|
|
|
49
|
-
|
|
50
|
-
- **Enhance Monitoring and Alerts**: Adjust monitoring systems to alert on similar `CopyObject` actions, especially those involving sensitive data or unusual file extensions.
|
|
51
|
-
- **Educate and Train**: Provide additional training to users with administrative rights on the importance of security best practices concerning S3 bucket management and the risks of ransomware.
|
|
52
|
-
- **Audit S3 Bucket Policies and Permissions**: Conduct a comprehensive audit of all S3 bucket policies and associated permissions to ensure they adhere to the principle of least privilege.
|
|
53
|
-
- **Incident Response**: If there's an indication of malicious intent or a security breach, initiate the incident response protocol to mitigate any damage and prevent future occurrences.
|
|
54
|
-
|
|
55
|
-
### Additional Information:
|
|
34
|
+
### Investigating AWS S3 Object Encryption Using External KMS Key
|
|
56
35
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
36
|
+
This rule detects when an S3 `CopyObject` operation encrypts an object using a KMS key belonging to a different AWS account than the bucket owner. This behavior is unusual and a strong indicator of:
|
|
37
|
+
|
|
38
|
+
- Cloud ransomware techniques, where adversaries encrypt data using a key only they control.
|
|
39
|
+
- Cross-account privilege misuse, especially when an unauthorized principal has write access to S3.
|
|
40
|
+
- Misconfigured bucket permissions, enabling principals from another account to perform privileged copy operations.
|
|
41
|
+
- Early impact-stage activity in incidents where attackers prepare to destroy availability or deny the owner access.
|
|
42
|
+
|
|
43
|
+
The rule uses ESQL to identify cases where the `cloud.account.id` (bucket owner) differs from the dissected `kms_key_account_id` used for encrypting the new object version.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
#### Possible investigation steps
|
|
47
|
+
|
|
48
|
+
**Identify the actor and access pathway**
|
|
49
|
+
- Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id`.
|
|
50
|
+
- Check whether the caller is:
|
|
51
|
+
- A legitimate cross-account automation role,
|
|
52
|
+
- A compromised IAM user or workload identity, or
|
|
53
|
+
- A federated identity behaving outside of normal patterns.
|
|
54
|
+
- Inspect `user_agent.original` to determine whether the action came from the AWS Console, CLI, SDK, or unusual tooling.
|
|
55
|
+
|
|
56
|
+
**Analyze the encryption behavior**
|
|
57
|
+
- Inspect the dissected KMS key fields:
|
|
58
|
+
- `Esql.aws_cloudtrail_request_parameters_kms_key_account_id`
|
|
59
|
+
- `Esql.aws_cloudtrail_request_parameters_kms_key_id`
|
|
60
|
+
- Confirm whether the external key:
|
|
61
|
+
- Belongs to an attacker-controlled account,
|
|
62
|
+
- Is unknown to your organization, or
|
|
63
|
+
- Lives in a shared or security tooling account.
|
|
64
|
+
|
|
65
|
+
**Assess the objects affected**
|
|
66
|
+
- Review:
|
|
67
|
+
- `Esql.aws_cloudtrail_request_parameters_target_bucket_name`
|
|
68
|
+
- `Esql.aws_cloudtrail_request_parameters_target_object_key`
|
|
69
|
+
- Identify:
|
|
70
|
+
- Whether objects were overwritten or new encrypted copies were created.
|
|
71
|
+
- The sensitivity or criticality of the affected data.
|
|
72
|
+
- Whether object versioning is enabled (important for recovery).
|
|
73
|
+
|
|
74
|
+
**Correlate surrounding access patterns**
|
|
75
|
+
Pivot in CloudTrail on:
|
|
76
|
+
- The same access key ID
|
|
77
|
+
- The same IAM principal
|
|
78
|
+
- Affected bucket ARN
|
|
79
|
+
|
|
80
|
+
Look for:
|
|
81
|
+
- `DeleteObject` or `DeleteObjects` calls (common in ransomware behavior)
|
|
82
|
+
- Mass enumeration prior to the event (`ListObjectsV2`, `GetObject`)
|
|
83
|
+
- Other impact-stage actions (`PutBucketPolicy`, `PutBucketAcl`, disabling logging)
|
|
84
|
+
- Attempts to encrypt additional objects in rapid succession
|
|
85
|
+
|
|
86
|
+
**Evaluate bucket permissions and exposure**
|
|
87
|
+
Review:
|
|
88
|
+
- S3 bucket policy changes
|
|
89
|
+
- IAM roles with `s3:PutObject` or `s3:PutObjectAcl` permissions
|
|
90
|
+
- Whether unintended cross-account `Principal` entries exist
|
|
91
|
+
- Whether the KMS key policy explicitly trusts your account or a foreign one
|
|
92
|
+
|
|
93
|
+
**Validate business justification**
|
|
94
|
+
- Confirm with storage, data engineering, or application teams whether:
|
|
95
|
+
- Any migration, transformation, or backup workflows should be encrypting objects cross-account.
|
|
96
|
+
- Scheduled jobs or CI/CD pipelines were operating at the time of the event.
|
|
97
|
+
|
|
98
|
+
### False positive analysis
|
|
99
|
+
|
|
100
|
+
- **Expected cross-account encryption**
|
|
101
|
+
Many organizations use centralized encryption accounts or shared security accounts. Validate:
|
|
102
|
+
- Whether the KMS key account is part of your AWS Organization
|
|
103
|
+
- Whether the workflow, role, or application is documented
|
|
104
|
+
- Whether the principal routinely performs CopyObject operations
|
|
105
|
+
|
|
106
|
+
### Response and remediation
|
|
107
|
+
|
|
108
|
+
**Contain and prevent further impact**
|
|
109
|
+
- Immediately restrict S3 write access for the principal involved.
|
|
110
|
+
- If the KMS key is attacker-controlled, the impacted objects may be unrecoverable without versioning.
|
|
111
|
+
- If object versioning is disabled, enable it on the affected bucket to strengthen future resilience.
|
|
112
|
+
|
|
113
|
+
**Investigate scope and severity**
|
|
114
|
+
- Identify:
|
|
115
|
+
- Additional objects encrypted using external keys
|
|
116
|
+
- Related suspicious actions (delete, modify, exfiltration events)
|
|
117
|
+
- Whether any ransom markers or unauthorized files were uploaded
|
|
118
|
+
- Validate whether the external KMS key grants *decrypt* permission back to the bucket owner (rare in attacker use).
|
|
119
|
+
|
|
120
|
+
**Recover and secure the bucket**
|
|
121
|
+
- Restore accessible previous versions if versioning is enabled.
|
|
122
|
+
- Revoke unauthorized access key pairs or session credentials.
|
|
123
|
+
- Audit bucket policies, ACLs, and IAM conditions (`aws:PrincipalArn`, `aws:SourceAccount`, `aws:SourceArn`).
|
|
124
|
+
- Tighten cross-account access controls:
|
|
125
|
+
- Remove unintended `Principal` clauses
|
|
126
|
+
- Restrict KMS usage to known accounts
|
|
127
|
+
- Enforce SCPs that block cross-account KMS use unless explicitly approved
|
|
128
|
+
|
|
129
|
+
**Long-term hardening**
|
|
130
|
+
- Integrate object-level access logging and S3 server access logging into security monitoring.
|
|
131
|
+
- Add AWS Config rules (or Security Hub controls) detecting:
|
|
132
|
+
- Public buckets
|
|
133
|
+
- Cross-account access to S3
|
|
134
|
+
- KMS policies permitting foreign principals
|
|
135
|
+
- Document required cross-account workflows and add explicit allowlists.
|
|
136
|
+
|
|
137
|
+
### Additional information
|
|
138
|
+
|
|
139
|
+
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
|
|
140
|
+
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
|
|
141
|
+
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
|
|
60
142
|
"""
|
|
61
143
|
references = [
|
|
62
144
|
"https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html/",
|
|
@@ -66,7 +148,7 @@ references = [
|
|
|
66
148
|
]
|
|
67
149
|
risk_score = 47
|
|
68
150
|
rule_id = "ab8f074c-5565-4bc4-991c-d49770e19fc9"
|
|
69
|
-
setup = "AWS S3 data event types need to be enabled in the CloudTrail trail configuration."
|
|
151
|
+
setup = "AWS S3 data event types need to be enabled in the CloudTrail trail configuration for CopyObject events."
|
|
70
152
|
severity = "medium"
|
|
71
153
|
tags = [
|
|
72
154
|
"Domain: Cloud",
|
|
@@ -101,13 +183,25 @@ from logs-aws.cloudtrail-* metadata _id, _version, _index
|
|
|
101
183
|
// keep ECS and dissected fields
|
|
102
184
|
| keep
|
|
103
185
|
@timestamp,
|
|
186
|
+
data_stream.namespace,
|
|
187
|
+
user.name,
|
|
188
|
+
user_agent.original,
|
|
189
|
+
source.ip,
|
|
104
190
|
aws.cloudtrail.user_identity.arn,
|
|
105
|
-
|
|
191
|
+
aws.cloudtrail.user_identity.type,
|
|
192
|
+
aws.cloudtrail.user_identity.access_key_id,
|
|
193
|
+
aws.cloudtrail.resources.arn,
|
|
194
|
+
aws.cloudtrail.resources.type,
|
|
106
195
|
event.action,
|
|
196
|
+
event.outcome,
|
|
197
|
+
cloud.account.id,
|
|
198
|
+
cloud.region,
|
|
199
|
+
aws.cloudtrail.request_parameters,
|
|
200
|
+
aws.cloudtrail.response_elements,
|
|
107
201
|
Esql.aws_cloudtrail_request_parameters_target_bucket_name,
|
|
202
|
+
Esql.aws_cloudtrail_request_parameters_target_object_key,
|
|
108
203
|
Esql.aws_cloudtrail_request_parameters_kms_key_account_id,
|
|
109
|
-
Esql.aws_cloudtrail_request_parameters_kms_key_id
|
|
110
|
-
Esql.aws_cloudtrail_request_parameters_target_object_key
|
|
204
|
+
Esql.aws_cloudtrail_request_parameters_kms_key_id
|
|
111
205
|
'''
|
|
112
206
|
|
|
113
207
|
|
|
@@ -124,3 +218,26 @@ id = "TA0040"
|
|
|
124
218
|
name = "Impact"
|
|
125
219
|
reference = "https://attack.mitre.org/tactics/TA0040/"
|
|
126
220
|
|
|
221
|
+
[rule.investigation_fields]
|
|
222
|
+
field_names = [
|
|
223
|
+
"@timestamp",
|
|
224
|
+
"user.name",
|
|
225
|
+
"user_agent.original",
|
|
226
|
+
"source.ip",
|
|
227
|
+
"aws.cloudtrail.user_identity.arn",
|
|
228
|
+
"aws.cloudtrail.user_identity.type",
|
|
229
|
+
"aws.cloudtrail.user_identity.access_key_id",
|
|
230
|
+
"aws.cloudtrail.resources.arn",
|
|
231
|
+
"aws.cloudtrail.resources.type",
|
|
232
|
+
"event.action",
|
|
233
|
+
"event.outcome",
|
|
234
|
+
"cloud.account.id",
|
|
235
|
+
"cloud.region",
|
|
236
|
+
"aws.cloudtrail.request_parameters",
|
|
237
|
+
"aws.cloudtrail.response_elements",
|
|
238
|
+
"Esql.aws_cloudtrail_request_parameters_target_bucket_name",
|
|
239
|
+
"Esql.aws_cloudtrail_request_parameters_target_object_key",
|
|
240
|
+
"Esql.aws_cloudtrail_request_parameters_kms_key_account_id",
|
|
241
|
+
"Esql.aws_cloudtrail_request_parameters_kms_key_id",
|
|
242
|
+
]
|
|
243
|
+
|