Privilege escalation through AWS RDS IAM Connect
When misconfigured, the pathway from IAM to RDS becomes a ladder for attackers—one they can climb without touching database credentials. Understanding this vector is critical, because it exploits trust, not brute force.
AWS RDS IAM authentication lets clients generate temporary database credentials using their IAM identity. This means access is tied to AWS policies, not static passwords. The feature is powerful, but it expands the attack surface. If an IAM role with overly broad permissions is exposed, an attacker could escalate privileges by connecting to RDS instances they should never reach.
The chain is usually short:
- Acquire IAM credentials from a vulnerable user, EC2 instance, or Lambda role.
- Use
rds generate-db-auth-tokento create a temporary access token. - Connect to the target RDS instance over SSL using that token.
- Leverage database-level privileges to expand control or exfiltrate data.
Keys to preventing escalation:
- Apply least privilege in IAM roles. Grant
rds-db:connectonly to trusted roles. - Use resource-level restrictions in IAM policies, specifying allowed DB instance ARNs.
- Rotate and audit IAM roles regularly.
- Monitor CloudTrail for unusual
generate-db-auth-tokencalls. - Enforce database role separation; IAM access should map to limited DB accounts.
In many incidents, the flaw is not in RDS itself but in IAM policy sprawl. A single * wildcard on resource or action can bypass layers of security. Coupled with the temporary nature of IAM Connect tokens, this makes detection harder if you are not looking.
Engineers need to treat AWS RDS IAM Connect as both a convenience and a potential entry point. The simplicity of token generation is deceptive. Every connected service, every environment variable holding credentials, every CI/CD runner with an attached role is a possible step in an escalation chain.
Stop guessing if your setup is secure. Model it. Test it. Break it yourself before someone else does.
See how privilege escalation through AWS RDS IAM Connect can be detected and blocked—run it live in minutes at hoop.dev.