aws-rds-snapshot-public-exfil
rds:ModifyDBSnapshotAttribute(AttributeName=restore, ValuesToAdd=[all]) makes a DB snapshot publicly restorable by any AWS account - full database exfiltration with no network access required.
match
A conjunctive graph pattern. Variables (?x) bind node ids; every clause must hold.
where
node_type(?snapshot) ==
Snapshot
?snapshot.provider_type in ['AWS::RDS::DBSnapshot', 'AWS::RDS::DBClusterSnapshot']
?principal has EFFECTIVE rds:ModifyDBSnapshotAttribute (or rds:ModifyDBClusterSnapshotAttribute) on ?snapshot ARN
ValuesToAdd=[all] (public snapshot, not account-scoped)
emit
Raw rule rules/derived/aws/rds.yaml
id: aws-rds-snapshot-public-exfil
emits: CanExfiltrate
description: "rds:ModifyDBSnapshotAttribute(AttributeName=restore, ValuesToAdd=[all]) makes a DB snapshot\
\ publicly restorable by any AWS account \u2014 full database exfiltration with no network access required."
match:
- - principal: null
- HasPermission
- snapshot: null
where:
- node_type(?snapshot) == Snapshot
- ?snapshot.provider_type in ['AWS::RDS::DBSnapshot', 'AWS::RDS::DBClusterSnapshot']
- ?principal has EFFECTIVE rds:ModifyDBSnapshotAttribute (or rds:ModifyDBClusterSnapshotAttribute) on
?snapshot ARN
- ValuesToAdd=[all] (public snapshot, not account-scoped)
emit:
- source_type: Identity
target_type: Snapshot
source: ?principal
target: ?snapshot
edge_type: CanExfiltrate
permissions:
- rds:ModifyDBSnapshotAttribute
- rds:ModifyDBClusterSnapshotAttribute
conditions:
- iam_permission
- scp_or_org_policy
- key_permission
state_logic: "ACTIVE when rds:ModifyDBSnapshotAttribute (or rds:ModifyDBClusterSnapshotAttribute for\
\ cluster snapshots) is confirmed EFFECTIVE on the snapshot ARN \u2014 no SCP denial, no permission\
\ boundary block. CONDITIONAL(key_permission) when the snapshot is encrypted with a CMK: any account\
\ attempting to restore the public snapshot must also be granted kms:Decrypt on the CMK \u2014 without\
\ that, the restore fails. However, the ATTACKER'S capability to SHARE the snapshot is still ACTIVE\
\ (the key condition gates the RESTORER, not the sharer). Emit ACTIVE for the sharing capability;\
\ note the CMK key-grant requirement as a downstream gate on the restoring account. BLOCKED when an\
\ SCP or permission boundary denies rds:ModifyDBSnapshotAttribute. An SCP that denies rds:ModifyDBSnapshotAttribute\
\ entirely would block this \u2014 emit BLOCKED when confirmed."
confidence: min(contributing_confidences) * 0.95
derived_from:
- ?principal HasPermission ?snapshot (rds:ModifyDBSnapshotAttribute effective permission + ValuesToAdd=[all])