AWS Detective Graph Deleted
Detects the deletion of an Amazon Detective behavior graph via the DeleteGraph API. Amazon Detective automatically collects log data from AWS services and uses machine learning, statistical analysis, and graph theory to build an interactive model of resource behaviors and interactions. Deleting a behavior graph destroys its historical analysis data and removes the ability to investigate security incidents using Detective's relationship mapping. An attacker with sufficient IAM permissions may delete the Detective graph to impair forensic investigation of a compromise.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/08/14"
3integration = ["aws"]
4maturity = "production"
5updated_date = "2026/08/14"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects the deletion of an Amazon Detective behavior graph via the DeleteGraph API. Amazon
11Detective automatically collects log data from AWS services and uses machine learning, statistical
12analysis, and graph theory to build an interactive model of resource behaviors and interactions.
13Deleting a behavior graph destroys its historical analysis data and removes the ability to
14investigate security incidents using Detective's relationship mapping. An attacker with sufficient
15IAM permissions may delete the Detective graph to impair forensic investigation of a compromise.
16"""
17false_positives = [
18 """
19 Legitimate decommissioning of an AWS account, regional consolidation, or removal of an unused
20 Detective deployment may trigger this rule. Validate the caller identity and confirm a
21 corresponding change management ticket exists before closing.
22 """,
23]
24from = "now-6m"
25index = ["logs-aws.cloudtrail-*"]
26language = "kuery"
27license = "Elastic License v2"
28name = "AWS Detective Graph Deleted"
29note = """## Triage and analysis
30
31### Investigating AWS Detective Graph Deleted
32
33Amazon Detective builds a behavior graph from CloudTrail, VPC Flow Logs, and GuardDuty findings, enabling investigation teams to trace the full scope and timeline of a security incident. `DeleteGraph` is a rare, irreversible operation — the historical graph data cannot be recovered after deletion. An adversary who deletes the Detective graph removes a key forensic investigation tool, making it harder to understand the scope of a compromise.
34
35### Possible investigation steps
36
37- Identify the caller in `aws.cloudtrail.user_identity.arn` and `user.name`. Confirm whether this is an authorized cloud administrator or an anomalous identity.
38- Check whether the deletion was preceded by other defense-evasion actions in the same time window: GuardDuty detector deletion, CloudTrail StopLogging, Security Hub disable.
39- Determine how long the Detective graph had been active and what historical data was lost.
40- Review all IAM actions by this identity in the 24 hours before the deletion.
41
42### False positive analysis
43
44- Account decommissioning workflows may include Detective graph deletion as part of teardown. Verify via change management records.
45
46### Response and remediation
47
48- Re-enable Amazon Detective for the affected account and region.
49- Reconstruct investigation context from raw CloudTrail, VPC Flow Logs, and GuardDuty findings.
50- Revoke active sessions for the deleting identity if the action was unauthorized.
51- Add an SCP restricting `detective:DeleteGraph` to break-glass administrator roles.
52"""
53references = [
54 "https://docs.aws.amazon.com/detective/latest/APIReference/API_DeleteGraph.html",
55]
56risk_score = 21
57rule_id = "fa0177e5-b065-444a-a94e-872cbb28ffee"
58setup = "The AWS integration must be ingesting management events into `logs-aws.cloudtrail-*`. Amazon Detective must be enabled in the account for this event to appear."
59severity = "low"
60tags = [
61 "Domain: Cloud",
62 "Platform: AWS",
63 "Data Source: AWS CloudTrail",
64 "Service: AWS Detective",
65 "Rule Type: Custom Query (KQL)",
66 "Tactic: Defense Evasion",
67 "Resources: Investigation Guide",
68]
69timestamp_override = "event.ingested"
70type = "query"
71
72query = '''
73data_stream.dataset: "aws.cloudtrail"
74 and event.provider: "detective.amazonaws.com"
75 and event.action: "DeleteGraph"
76 and event.outcome: "success"
77'''
78
79
80[[rule.threat]]
81framework = "MITRE ATT&CK"
82[[rule.threat.technique]]
83id = "T1562"
84name = "Impair Defenses"
85reference = "https://attack.mitre.org/techniques/T1562/"
86[[rule.threat.technique.subtechnique]]
87id = "T1562.001"
88name = "Disable or Modify Tools"
89reference = "https://attack.mitre.org/techniques/T1562/001/"
90
91[rule.threat.tactic]
92id = "TA0005"
93name = "Defense Evasion"
94reference = "https://attack.mitre.org/tactics/TA0005/"
95
96[rule.investigation_fields]
97field_names = [
98 "@timestamp",
99 "aws.cloudtrail.user_identity.arn",
100 "aws.cloudtrail.user_identity.type",
101 "aws.cloudtrail.user_identity.access_key_id",
102 "user.name",
103 "event.action",
104 "event.outcome",
105 "source.ip",
106 "cloud.region",
107 "cloud.account.id",
108]
Triage and analysis
Investigating AWS Detective Graph Deleted
Amazon Detective builds a behavior graph from CloudTrail, VPC Flow Logs, and GuardDuty findings, enabling investigation teams to trace the full scope and timeline of a security incident. DeleteGraph is a rare, irreversible operation — the historical graph data cannot be recovered after deletion. An adversary who deletes the Detective graph removes a key forensic investigation tool, making it harder to understand the scope of a compromise.
Possible investigation steps
- Identify the caller in
aws.cloudtrail.user_identity.arnanduser.name. Confirm whether this is an authorized cloud administrator or an anomalous identity. - Check whether the deletion was preceded by other defense-evasion actions in the same time window: GuardDuty detector deletion, CloudTrail StopLogging, Security Hub disable.
- Determine how long the Detective graph had been active and what historical data was lost.
- Review all IAM actions by this identity in the 24 hours before the deletion.
False positive analysis
- Account decommissioning workflows may include Detective graph deletion as part of teardown. Verify via change management records.
Response and remediation
- Re-enable Amazon Detective for the affected account and region.
- Reconstruct investigation context from raw CloudTrail, VPC Flow Logs, and GuardDuty findings.
- Revoke active sessions for the deleting identity if the action was unauthorized.
- Add an SCP restricting
detective:DeleteGraphto break-glass administrator roles.
References
Related rules
- AWS Bedrock Guardrail Deleted or Weakened
- AWS CloudWatch Alarm Deletion
- AWS CloudWatch Log Group Deletion
- AWS CloudWatch Log Stream Deletion
- AWS Config Resource Deletion