You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [Rule Tunings] AWS RDS Rules
#### AWS RDS DB Instance Made Public
- updated description and investigation guide
- added highlighted fields
#### AWS RDS DB Instance or Cluster Deletion Protection Disabled
- updated description and investigation guide
- added highlighted fields
#### AWS RDS Snapshot Deleted
- excluded `backup.amazonaws.com` as this is expected behavior. This exclusion reduces noise in telemetry by ~77%
- updated description and investigation guide
- added highlighted fields
#### AWS Deletion of RDS Instance or Cluster > AWS RDS DB Instance or Cluster Deleted
- reduced execution window
- slight name change to align with other rules
- updated description and investigation guide
- added highlighted fields
#### AWS RDS DB Instance Restored
- `event.type` used for `event_category_override` because event.category is not mapped for these API calls
- updated description and investigation guide
- added highlighted fields
#### AWS RDS DB Instance or Cluster Password Modified
- `event.type` used for `event_category_override` because event.category is not mapped for these API calls
- updated description and investigation guide
- added highlighted fields
#### AWS RDS Snapshot Export
- reduced execution window
- updated mitre mapping
- updated description and investigation guide
- added highlighted fields
* rule type change from eql to kql
changing rule type to kql since there's not eql specific functions needed for the query
An adversary with a set of compromised credentials may attempt to make copies of running or deleted RDS databases in order to evade defense mechanisms or access data. This rule identifies successful attempts to restore a DB instance using the RDS `RestoreDBInstanceFromDBSnapshot` or `RestoreDBInstanceFromS3` API operations.
10
+
Identifies the restoration of an AWS RDS database instance from a snapshot or S3 backup. Adversaries with access to
11
+
valid credentials may restore copies of existing databases to bypass logging and monitoring controls or to exfiltrate
12
+
sensitive data from a duplicated environment. This rule detects successful restoration operations using
13
+
"RestoreDBInstanceFromDBSnapshot" or "RestoreDBInstanceFromS3", which may indicate unauthorized data access or
14
+
post-compromise defense evasion.
11
15
"""
12
16
false_positives = [
13
17
"""
14
-
Restoring DB instances may be done by a system or network administrator. Verify whether the user identity, user agent,
15
-
and/or hostname should be making changes in your environment. Instance restoration by unfamiliar users or hosts
16
-
should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
18
+
Restoring an RDS DB instance may be performed legitimately during troubleshooting, development refresh processes,
19
+
migrations, or disaster-recovery drills. Validate the user identity, source IP, automation context, and whether the
20
+
restoration aligns with a known maintenance or testing workflow before treating the event as suspicious. Expected
21
+
behavior can be exempted through rule exceptions.
17
22
""",
18
23
]
19
24
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
20
-
language = "eql"
25
+
language = "kuery"
21
26
license = "Elastic License v2"
22
27
name = "AWS RDS DB Instance Restored"
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 DB Instance Restored
35
+
36
+
Restoring an RDS DB instance from a snapshot or from S3 is a powerful operation that recreates a full database environment. While legitimate for recovery, migrations, or cloning, adversaries may use restore actions to access historical data, duplicate sensitive environments, evade guardrails, or prepare for data exfiltration.
37
+
38
+
This rule detects successful invocation of `RestoreDBInstanceFromDBSnapshot` and `RestoreDBInstanceFromS3`, both of which may indicate attempts to rehydrate old datasets, bypass deletion protection, or establish a shadow environment for further malicious actions.
39
+
40
+
#### Possible investigation steps
41
+
42
+
- **Identify the actor and execution context**
43
+
- Review `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.type`, and `aws.cloudtrail.user_identity.access_key_id`.
44
+
- Check `user.name`, `source.ip`, and `user_agent.original` to determine how the restore was executed (console, CLI, automation, SDK).
45
+
46
+
- **Understand what was restored and why**
47
+
- Inspect `aws.cloudtrail.request_parameters` to identify:
48
+
- Snapshot identifier or S3 location used as the restore source.
49
+
- The new DB instance identifier and configuration parameters.
50
+
- Determine:
51
+
- Whether the snapshot/backup used for the restore contains sensitive or high-value data.
52
+
- Whether this restore created a publicly accessible instance, changed security groups, or used unusual storage/instance classes.
53
+
54
+
- **Reconstruct the activity flow**
55
+
- Use `@timestamp` to correlate the restore event with:
56
+
- Snapshot creation, copy, or export events.
57
+
- IAM policy changes or privilege escalations.
58
+
- Deletion or modification of the original database.
59
+
- Other RDS lifecycle actions such as `ModifyDBInstance`, `DeleteDBInstance`, or backup configuration changes.
- Recent logins from unusual IPs or federated sessions without MFA.
63
+
64
+
- **Correlate with broader behavior**
65
+
- Pivot in CloudTrail on:
66
+
- The same snapshot identifier.
67
+
- The same actor or access key ID.
68
+
- The newly created DB instance identifier.
69
+
- Examine:
70
+
- Whether the restored DB was modified immediately after (e.g., security groups opened, deletion protection disabled).
71
+
- Whether there were large-volume read operations or export actions following the restore.
72
+
- Whether the restore is part of a pattern of parallel suspicious activity (snapshot copying, S3 backups, cross-account actions).
73
+
74
+
- **Validate intent with owners**
75
+
- Confirm with the application/database/platform teams:
76
+
- Whether the restore was requested or part of an authorized operational workflow.
77
+
- Whether this restore corresponds to migration, testing, DR drill, or another planned activity.
78
+
- Whether the restored environment should exist (and for how long).
79
+
80
+
### False positive analysis
81
+
82
+
- **Legitimate maintenance and DR workflows**
83
+
- Many teams restore databases for patch testing, DR validation, schema testing, or migration.
84
+
- **Automated restore workflows**
85
+
- CI/CD pipelines or internal automation may restore DBs to generate staging or dev environments.
86
+
- **Third-party tooling**
87
+
- Backup/DR solutions, migration tools, or observability platforms may restore DB instances for operational reasons. Tune based on `user_agent.original` or known service roles.
88
+
89
+
### Response and remediation
90
+
91
+
- **Contain the restored environment**
92
+
- If unauthorized:
93
+
- Apply restrictive security groups to block access.
94
+
- Disable public accessibility if enabled.
95
+
- Evaluate whether deletion protection or backup retention is misconfigured.
96
+
97
+
- **Assess data exposure and intent**
98
+
- Work with data owners to evaluate:
99
+
- The sensitivity of the restored environment.
100
+
- Whether any reads, dumps, or exports occurred post-restore.
101
+
- Whether the restore enabled the attacker to access older or deleted data.
102
+
103
+
- **Investigate scope and related activity**
104
+
- Review CloudTrail for:
105
+
- Additional restores, exports, or copies.
106
+
- IAM changes allowing expanded privileges.
107
+
- Unusual authentication events or federated sessions without MFA.
108
+
- Related destructive actions (snapshot deletion, backup disabled, instance deletion).
109
+
110
+
- **Hardening and preventive controls**
111
+
- Enforce least privilege for `rds:RestoreDBInstanceFromDBSnapshot` and `rds:RestoreDBInstanceFromS3`.
112
+
- Use IAM conditions to restrict restore actions by network, principal, or region.
113
+
- Add AWS Config and Security Hub controls for monitoring:
114
+
- Unapproved restores.
115
+
- Public or misconfigured restored instances.
116
+
- Consider SCPs that prevent RDS restores in production accounts except through controlled roles.
117
+
118
+
- **Post-incident improvements**
119
+
- Rotate credentials for affected IAM users/roles.
120
+
- Update change management processes to ensure restore actions are tracked and approved.
121
+
- Adjust rule exceptions sparingly and ensure high-risk restores continue to generate alerts.
122
+
123
+
### Additional information
124
+
125
+
- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
and event.action in ("RestoreDBInstanceFromDBSnapshot", "RestoreDBInstanceFromS3")
48
-
and event.outcome == "success"
151
+
event.dataset: "aws.cloudtrail"
152
+
and event.provider: "rds.amazonaws.com"
153
+
and event.action: ("RestoreDBInstanceFromDBSnapshot" or "RestoreDBInstanceFromS3")
154
+
and event.outcome: "success"
49
155
'''
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 DB Instance Restored
56
-
57
-
Amazon RDS (Relational Database Service) allows users to set up, operate, and scale databases in the cloud. Adversaries may exploit RDS by restoring DB instances from snapshots or S3 to access sensitive data or bypass security controls. The detection rule identifies successful restoration attempts, signaling potential unauthorized access or data exfiltration activities, by monitoring specific API operations and outcomes.
58
-
59
-
### Possible investigation steps
60
156
61
-
- Review the CloudTrail logs to identify the user or role associated with the successful `RestoreDBInstanceFromDBSnapshot` or `RestoreDBInstanceFromS3` API call by examining the `user.identity` field.
62
-
- Check the source IP address and location from which the API call was made using the `sourceIPAddress` field to determine if it aligns with expected or known locations.
63
-
- Investigate the timing of the restoration event by looking at the `@timestamp` field to see if it coincides with any other suspicious activities or anomalies in the environment.
64
-
- Examine the specific DB instance details restored, such as the DB instance identifier, to assess the sensitivity of the data involved and potential impact.
65
-
- Verify if there are any associated alerts or logs indicating unauthorized access or data exfiltration attempts around the same time frame.
66
-
- Contact the user or team responsible for the credentials used, if legitimate, to confirm whether the restoration was authorized and intended.
67
-
68
-
### False positive analysis
69
-
70
-
- Routine database maintenance or testing activities may trigger the rule. Organizations should identify and document regular restoration activities performed by authorized personnel and exclude these from alerts.
71
-
- Automated backup and restore processes used for disaster recovery or data migration can result in false positives. Users should configure exceptions for known automated processes by filtering based on specific user accounts or roles.
72
-
- Development and staging environments often involve frequent restoration of databases for testing purposes. Exclude these environments by identifying and filtering out specific instance identifiers or tags associated with non-production environments.
73
-
- Scheduled tasks or scripts that restore databases as part of regular operations can be mistaken for unauthorized activity. Ensure these tasks are well-documented and create exceptions based on the source IP or IAM role used for these operations.
74
-
- Third-party services or integrations that require database restoration for functionality may trigger alerts. Verify these services and exclude their associated actions by identifying their unique user agents or API keys.
75
-
76
-
### Response and remediation
77
-
78
-
- Immediately isolate the restored RDS instance to prevent unauthorized access. This can be done by modifying the security group rules to restrict inbound and outbound traffic.
79
-
- Conduct a thorough review of CloudTrail logs to identify the source of the compromised credentials and any other suspicious activities associated with the same user or account.
80
-
- Revoke the compromised credentials and issue new credentials for the affected user or service account. Ensure that multi-factor authentication (MFA) is enabled for all accounts.
81
-
- Notify the security team and relevant stakeholders about the incident, providing details of the unauthorized restoration and any potential data exposure.
82
-
- Perform a security assessment of the restored RDS instance to identify any unauthorized changes or data exfiltration. This includes checking for unusual queries or data exports.
83
-
- Implement additional monitoring and alerting for similar API operations to detect future unauthorized restoration attempts promptly.
84
-
- Review and update IAM policies to ensure that only authorized users have the necessary permissions to restore RDS instances, reducing the risk of future incidents."""
0 commit comments