AWS RDS DB Snapshot Shared with Another Account

Identifies when an AWS RDS DB snapshot is shared with another AWS account or made public. DB snapshots contain complete backups of database instances, including schemas, table data, and sensitive application content. When shared externally, snapshots can be restored in another AWS environment, enabling unauthorized access, offline analysis, or data exfiltration. Adversaries who obtain valid credentials or exploit misconfigurations may modify snapshot attributes to grant access to accounts they control, bypassing network, IAM, and monitoring controls.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2024/06/25"
  3integration = ["aws"]
  4maturity = "production"
  5updated_date = "2026/01/21"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies when an AWS RDS DB snapshot is shared with another AWS account or made public. DB snapshots contain complete
 11backups of database instances, including schemas, table data, and sensitive application content. When shared externally,
 12snapshots can be restored in another AWS environment, enabling unauthorized access, offline analysis, or data
 13exfiltration. Adversaries who obtain valid credentials or exploit misconfigurations may modify snapshot attributes to
 14grant access to accounts they control, bypassing network, IAM, and monitoring controls.
 15"""
 16event_category_override = "event.type"
 17false_positives = [
 18    """
 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.
 22    """,
 23]
 24from = "now-6m"
 25index = ["filebeat-*", "logs-aws.cloudtrail-*"]
 26language = "eql"
 27license = "Elastic License v2"
 28name = "AWS RDS DB Snapshot Shared with Another Account"
 29note = """## Triage and analysis
 30
 31### Investigating AWS RDS DB Snapshot Shared with Another Account
 32
 33Amazon RDS DB snapshots capture full backups of database instances and clusters. Modifying a snapshot’s restore
 34attributes to include external AWS accounts allows those accounts to restore and fully access the underlying data.
 35While cross-account snapshot sharing is widely used for migrations and disaster-recovery workflows, adversaries may
 36abuse this mechanism for stealthy data exfiltration, restoring the snapshot in infrastructure they control, outside of your monitoring boundary.
 37
 38This rule detects successful modifications to snapshot attributes where one or more additional AWS accounts are added to the snapshot’s restore permissions.
 39
 40#### Possible investigation steps
 41
 42- **Identify the actor and context**
 43  - Review `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id`.
 44  - Determine whether the caller is an automation role, interactive user, CI/CD pipeline, or previously unseen principal.
 45  - Check `source.ip` and `user_agent.original` for signs of unauthorized access or atypical tooling.
 46
 47- **Understand what snapshot was shared**
 48  - From `aws.cloudtrail.request_parameters`, extract:
 49    - The snapshot or cluster snapshot identifier.
 50    - The list of `valuesToAdd` accounts added to `attributeName=restore`.
 51  - Identify the associated database instance or cluster and evaluate:
 52    - Data classification level (PII, customer data, secrets, credentials, financials, etc.)
 53    - Application ownership and business impact.
 54
 55- **Validate the external account**
 56  - Determine whether the recipient account:
 57    - Belongs to your AWS Organization.
 58    - Has previously been authorized for snapshot restore operations.
 59    - Represents a new or unexpected dependency.
 60  - Cross-reference with known partner accounts or migration plans.
 61
 62- **Correlate with related activity**
 63  - Pivot in CloudTrail on the same user identity or account to identify:
 64    - Prior reconnaissance actions (`DescribeDBSnapshots`, `DescribeDBInstances`).
 65    - Snapshot copying or creation of manual snapshots just before sharing.
 66    - IAM privilege escalation (`AttachRolePolicy`, `PutUserPolicy`, `AssumeRole` patterns).
 67    - Unusual RDS configuration changes (backup retention decrease, deletion protection toggles).
 68
 69- **Assess for exfiltration indicators**
 70  - Look for:
 71    - Subsequent `CopyDBSnapshot` or `StartExportTask` events.
 72    - Snapshot downloads, exports, or restoration from the external account.
 73    - Snapshot attributes set to `all` (public sharing), which is extremely dangerous.
 74
 75- **Validate operational intent**
 76  - Contact application owners, DBAs, or platform teams to confirm:
 77    - Whether migration, replication, or DR workflows explain the share.
 78    - Whether new accounts were intentionally onboarded.
 79    - Whether the timing aligns with approved change windows.
 80
 81### False positive analysis
 82
 83- **Legitimate migration or DR workflows**
 84  - Many organizations routinely share snapshots with other accounts for staging, analytics, or DR replication.
 85
 86- **Automation roles**
 87  - Infrastructure-as-code pipelines and backup automation tools may modify snapshot permissions as part of normal behavior.
 88
 89If behavior is expected and consistently performed by a known principal, tune the rule using exceptional user identities, service roles, or controlled organizational accounts.
 90
 91### Response and remediation
 92
 93- **Revoke unauthorized sharing**
 94  - Immediately remove unauthorized accounts from snapshot restore attributes.
 95  - Ensure the snapshot is not publicly shared.
 96
 97- **Contain potential compromise**
 98  - Rotate access keys or credentials for the principal that performed the modification.
 99  - Review IAM permissions to ensure only approved roles can share snapshots.
100
101- **Assess impact**
102  - Determine whether the external account restored the snapshot and accessed data.
103  - If data exposure is likely, notify compliance, legal, and incident response teams.
104
105- **Hardening and preventive controls**
106  - Restrict snapshot sharing via IAM condition keys (`kms:ViaService`, `rds:dbSnapshotArn`, `aws:PrincipalArn`).
107  - Use AWS Organizations SCPs to block cross-account snapshot sharing in production accounts.
108  - Enable Config rules and Security Hub controls for public or cross-account snapshot access.
109
110### Additional information
111- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)** 
112- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)** 
113- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
114"""
115references = [
116    "https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBSnapshotAttribute.html",
117    "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ShareSnapshot.html",
118    "https://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-post-exploitation/aws-rds-post-exploitation#rds-modifydbsnapshotattribute-rds-createdbsnapshot",
119]
120risk_score = 47
121rule_id = "4577ef08-61d1-4458-909f-25a4b10c87fe"
122severity = "medium"
123tags = [
124    "Domain: Cloud",
125    "Data Source: AWS",
126    "Data Source: Amazon Web Services",
127    "Data Source: AWS RDS",
128    "Resources: Investigation Guide",
129    "Use Case: Threat Detection",
130    "Tactic: Exfiltration",
131]
132timestamp_override = "event.ingested"
133type = "eql"
134
135query = '''
136info where event.dataset == "aws.cloudtrail"
137    and event.provider == "rds.amazonaws.com"
138    and event.outcome == "success"
139    and event.action in ("ModifyDBSnapshotAttribute", "ModifyDBClusterSnapshotAttribute")
140    and stringContains(aws.cloudtrail.request_parameters, "attributeName=restore")
141    and stringContains(aws.cloudtrail.request_parameters, "valuesToAdd=[*]")
142'''
143
144
145[[rule.threat]]
146framework = "MITRE ATT&CK"
147[[rule.threat.technique]]
148id = "T1537"
149name = "Transfer Data to Cloud Account"
150reference = "https://attack.mitre.org/techniques/T1537/"
151
152
153[rule.threat.tactic]
154id = "TA0010"
155name = "Exfiltration"
156reference = "https://attack.mitre.org/tactics/TA0010/"
157
158[rule.investigation_fields]
159field_names = [
160    "@timestamp",
161    "user.name",
162    "user_agent.original",
163    "source.ip",
164    "aws.cloudtrail.user_identity.arn",
165    "aws.cloudtrail.user_identity.type",
166    "aws.cloudtrail.user_identity.access_key_id",
167    "event.action",
168    "event.outcome",
169    "cloud.account.id",
170    "cloud.region",
171    "aws.cloudtrail.request_parameters",
172    "aws.cloudtrail.response_elements",
173]

Triage and analysis

Investigating AWS RDS DB Snapshot Shared with Another Account

Amazon RDS DB snapshots capture full backups of database instances and clusters. Modifying a snapshot’s restore attributes to include external AWS accounts allows those accounts to restore and fully access the underlying data. While cross-account snapshot sharing is widely used for migrations and disaster-recovery workflows, adversaries may abuse this mechanism for stealthy data exfiltration, restoring the snapshot in infrastructure they control, outside of your monitoring boundary.

This rule detects successful modifications to snapshot attributes where one or more additional AWS accounts are added to the snapshot’s restore permissions.

Possible investigation steps

  • Identify the actor and context

    • Review aws.cloudtrail.user_identity.arn and aws.cloudtrail.user_identity.access_key_id.
    • Determine whether the caller is an automation role, interactive user, CI/CD pipeline, or previously unseen principal.
    • Check source.ip and user_agent.original for signs of unauthorized access or atypical tooling.
  • Understand what snapshot was shared

    • From aws.cloudtrail.request_parameters, extract:
      • The snapshot or cluster snapshot identifier.
      • The list of valuesToAdd accounts added to attributeName=restore.
    • Identify the associated database instance or cluster and evaluate:
      • Data classification level (PII, customer data, secrets, credentials, financials, etc.)
      • Application ownership and business impact.
  • Validate the external account

    • Determine whether the recipient account:
      • Belongs to your AWS Organization.
      • Has previously been authorized for snapshot restore operations.
      • Represents a new or unexpected dependency.
    • Cross-reference with known partner accounts or migration plans.
  • Correlate with related activity

    • Pivot in CloudTrail on the same user identity or account to identify:
      • Prior reconnaissance actions (DescribeDBSnapshots, DescribeDBInstances).
      • Snapshot copying or creation of manual snapshots just before sharing.
      • IAM privilege escalation (AttachRolePolicy, PutUserPolicy, AssumeRole patterns).
      • Unusual RDS configuration changes (backup retention decrease, deletion protection toggles).
  • Assess for exfiltration indicators

    • Look for:
      • Subsequent CopyDBSnapshot or StartExportTask events.
      • Snapshot downloads, exports, or restoration from the external account.
      • Snapshot attributes set to all (public sharing), which is extremely dangerous.
  • Validate operational intent

    • Contact application owners, DBAs, or platform teams to confirm:
      • Whether migration, replication, or DR workflows explain the share.
      • Whether new accounts were intentionally onboarded.
      • Whether the timing aligns with approved change windows.

False positive analysis

  • Legitimate migration or DR workflows

    • Many organizations routinely share snapshots with other accounts for staging, analytics, or DR replication.
  • Automation roles

    • Infrastructure-as-code pipelines and backup automation tools may modify snapshot permissions as part of normal behavior.

If behavior is expected and consistently performed by a known principal, tune the rule using exceptional user identities, service roles, or controlled organizational accounts.

Response and remediation

  • Revoke unauthorized sharing

    • Immediately remove unauthorized accounts from snapshot restore attributes.
    • Ensure the snapshot is not publicly shared.
  • Contain potential compromise

    • Rotate access keys or credentials for the principal that performed the modification.
    • Review IAM permissions to ensure only approved roles can share snapshots.
  • Assess impact

    • Determine whether the external account restored the snapshot and accessed data.
    • If data exposure is likely, notify compliance, legal, and incident response teams.
  • Hardening and preventive controls

    • Restrict snapshot sharing via IAM condition keys (kms:ViaService, rds:dbSnapshotArn, aws:PrincipalArn).
    • Use AWS Organizations SCPs to block cross-account snapshot sharing in production accounts.
    • Enable Config rules and Security Hub controls for public or cross-account snapshot access.

Additional information

References

Related rules

to-top