Skip to content

Commit 88cffa5

Browse files
Merge branch 'main' into 5355-fr-esql-remote-validation-support-newline-split-indices
2 parents 8489b95 + 5188f22 commit 88cffa5

File tree

1 file changed

+86
-31
lines changed

1 file changed

+86
-31
lines changed

rules/integrations/aws/defense_evasion_guardduty_detector_deletion.toml

Lines changed: 86 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
creation_date = "2020/05/28"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/11/12"
66

77
[rule]
88
author = ["Elastic"]
99
description = """
10-
Identifies the deletion of an Amazon GuardDuty detector. Upon deletion, GuardDuty stops monitoring the environment and
11-
all existing findings are lost.
10+
Detects the deletion of an Amazon GuardDuty detector. GuardDuty provides continuous monitoring for malicious or
11+
unauthorized activity across AWS accounts. Deleting the detector disables this visibility, stopping all threat detection
12+
and removing existing findings. Adversaries may delete GuardDuty detectors to impair security monitoring and evade
13+
detection during or after an intrusion. This rule identifies successful "DeleteDetector" API calls and can indicate a
14+
deliberate defense evasion attempt.
1215
"""
1316
false_positives = [
1417
"""
@@ -17,64 +20,99 @@ false_positives = [
1720
should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
1821
""",
1922
]
20-
from = "now-60m"
23+
from = "now-6m"
2124
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
22-
interval = "10m"
2325
language = "kuery"
2426
license = "Elastic License v2"
2527
name = "AWS GuardDuty Detector Deletion"
2628
note = """## Triage and analysis
2729
2830
> **Disclaimer**:
29-
> 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, we recommend validating the content and adapting it to suit your specific environment and operational needs.
3033
3134
### Investigating AWS GuardDuty Detector Deletion
3235
33-
AWS GuardDuty is a threat detection service that continuously monitors for malicious activity and unauthorized behavior in AWS environments. Deleting a GuardDuty detector halts this monitoring, potentially concealing malicious actions. Adversaries may exploit this by deleting detectors to evade detection. The detection rule identifies successful deletion events, signaling potential defense evasion attempts, and is crucial for maintaining security visibility.
36+
Amazon GuardDuty is a continuous threat detection service that analyzes CloudTrail, DNS, and VPC Flow Logs to identify malicious activity and compromised resources. Deleting a GuardDuty detector stops this monitoring entirely and permanently removes all historical findings for the affected AWS account. This rule detects successful `DeleteDetector` API calls, which may represent an attacker attempting to impair defenses and evade detection. Such actions should be rare and always performed under controlled administrative change processes.
3437
35-
### Possible investigation steps
38+
#### Possible investigation steps
3639
37-
- Review the CloudTrail logs for the specific event.provider:guardduty.amazonaws.com and event.action:DeleteDetector to identify the user or role responsible for the deletion.
38-
- Check the event.outcome:success to confirm the deletion was successful and not an attempted action.
39-
- Investigate the IAM permissions and recent activity of the user or role identified to determine if the deletion was authorized or potentially malicious.
40-
- Examine any recent GuardDuty findings prior to the deletion to assess if there were any critical alerts that might have prompted the deletion.
41-
- Correlate the timing of the detector deletion with other security events or anomalies in the AWS environment to identify potential patterns or coordinated actions.
42-
- Review AWS CloudTrail logs for any other suspicious activities or changes in the environment around the time of the detector deletion.
40+
- **Identify the actor**
41+
- Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.type` to determine who initiated the deletion.
42+
- Verify whether this principal normally performs GuardDuty configuration or administrative tasks.
43+
44+
- **Review request context**
45+
- Check `aws.cloudtrail.request_parameters` and `cloud.region` to confirm the targeted GuardDuty detector and scope of impact.
46+
- Determine whether multiple detectors or member accounts were affected (especially in delegated admin organizations).
47+
48+
- **Analyze source and access patterns**
49+
- Review `source.ip`, `user_agent.original` and `source.geo` fields for anomalous or previously unseen access locations or automation clients.
50+
- Check whether the deletion occurred outside standard maintenance windows or during a concurrent suspicious activity window.
51+
52+
- **Correlate with preceding or related activity**
53+
- Search for earlier GuardDuty configuration changes:
54+
- `StopMonitoringMembers`, `DisassociateMembers`, or `DeleteMembers`
55+
- IAM role or policy modifications reducing GuardDuty privileges
56+
- Look for other defense evasion indicators such as CloudTrail suspension, Security Hub configuration changes, or disabling of AWS Config rules.
57+
58+
- **Review historical GuardDuty findings**
59+
- Examine prior GuardDuty alerts and findings (if still retrievable) to determine whether the deletion followed significant detection activity.
60+
- Use centralized logs or security data lakes to recover findings removed from the console.
4361
4462
### False positive analysis
4563
46-
- Routine maintenance or administrative actions may lead to the deletion of a GuardDuty detector. Verify if the deletion aligns with scheduled maintenance or administrative tasks.
47-
- Automated scripts or tools used for environment cleanup might inadvertently delete detectors. Review and adjust automation scripts to prevent unintended deletions.
48-
- Organizational policy changes or restructuring could result in detector deletions. Ensure that policy changes are communicated and understood by all relevant teams to avoid unnecessary deletions.
49-
- Exclude known and authorized users or roles from triggering alerts by creating exceptions for specific IAM roles or user accounts that are responsible for legitimate detector deletions.
50-
- Implement logging and alerting for detector deletions to quickly identify and verify the legitimacy of the action, allowing for rapid response to potential false positives.
64+
- **Authorized administrative actions**
65+
- Verify whether the deletion corresponds to legitimate account decommissioning, region cleanup, or migration activity.
66+
- **Automation or IaC**
67+
- GuardDuty may be disabled temporarily during infrastructure provisioning or teardown in automated environments.
68+
Confirm via CI/CD logs or Infrastructure-as-Code templates.
69+
- **Organizational configuration changes**
70+
- Large organizations might consolidate GuardDuty under a delegated administrator account, causing detectors to be deleted in member accounts.
71+
Validate these actions against security architecture changes.
5172
5273
### Response and remediation
5374
54-
- Immediately re-enable GuardDuty in the affected AWS account to restore monitoring capabilities and ensure continuous threat detection.
55-
- Conduct a thorough review of CloudTrail logs to identify any unauthorized access or suspicious activities that occurred during the period when GuardDuty was disabled.
56-
- Isolate any compromised resources identified during the log review to prevent further unauthorized access or damage.
57-
- Notify the security operations team and relevant stakeholders about the incident for awareness and further investigation.
58-
- Implement additional access controls and monitoring on the AWS account to prevent unauthorized deletion of GuardDuty detectors in the future.
59-
- Review and update IAM policies to ensure that only authorized personnel have permissions to delete GuardDuty detectors.
60-
- Consider enabling AWS Config rules to monitor and alert on changes to GuardDuty configurations for proactive detection of similar incidents.
75+
- **Containment and restoration**
76+
- If unauthorized, immediately re-enable GuardDuty in the affected account and region using the `CreateDetector` API or AWS console.
77+
- Verify that findings aggregation and member account associations are restored to expected configurations.
78+
79+
- **Investigation**
80+
- Review CloudTrail for related privilege escalation or resource tampering events around the deletion time.
81+
- Assess whether any attacker activity occurred during the monitoring gap between deletion and restoration.
6182
62-
## Setup
83+
- **Recovery and hardening**
84+
- Restrict `guardduty:DeleteDetector` permissions to a limited administrative role.
85+
- Implement AWS Config rules or Security Hub controls to alert on changes to GuardDuty detectors or configuration states.
86+
- Enforce least privilege IAM policies, ensuring operational automation cannot disable GuardDuty outside maintenance workflows.
87+
- Document approved GuardDuty maintenance activities and correlate them with change tickets for traceability.
6388
64-
The AWS Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
89+
### Additional information
90+
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
91+
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
92+
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
93+
"""
6594
references = [
66-
"https://awscli.amazonaws.com/v2/documentation/api/latest/reference/guardduty/delete-detector.html",
6795
"https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DeleteDetector.html",
6896
]
6997
risk_score = 73
7098
rule_id = "523116c0-d89d-4d7c-82c2-39e6845a78ef"
7199
severity = "high"
72-
tags = ["Domain: Cloud", "Data Source: AWS", "Data Source: Amazon Web Services", "Tactic: Defense Evasion", "Resources: Investigation Guide"]
100+
tags = [
101+
"Domain: Cloud",
102+
"Data Source: AWS",
103+
"Data Source: Amazon Web Services",
104+
"Data Source: AWS GuardDuty",
105+
"Tactic: Defense Evasion",
106+
"Resources: Investigation Guide",
107+
]
73108
timestamp_override = "event.ingested"
74109
type = "query"
75110

76111
query = '''
77-
event.dataset:aws.cloudtrail and event.provider:guardduty.amazonaws.com and event.action:DeleteDetector and event.outcome:success
112+
event.dataset: aws.cloudtrail
113+
and event.provider: guardduty.amazonaws.com
114+
and event.action: DeleteDetector
115+
and event.outcome: success
78116
'''
79117

80118

@@ -96,3 +134,20 @@ id = "TA0005"
96134
name = "Defense Evasion"
97135
reference = "https://attack.mitre.org/tactics/TA0005/"
98136

137+
[rule.investigation_fields]
138+
field_names = [
139+
"@timestamp",
140+
"user.name",
141+
"user_agent.original",
142+
"source.ip",
143+
"aws.cloudtrail.user_identity.arn",
144+
"aws.cloudtrail.user_identity.type",
145+
"aws.cloudtrail.user_identity.access_key_id",
146+
"target.entity.id",
147+
"event.action",
148+
"event.outcome",
149+
"cloud.account.id",
150+
"cloud.region",
151+
"aws.cloudtrail.request_parameters",
152+
]
153+

0 commit comments

Comments
 (0)