1. Resources
  2. Detection rules
  3. RDS or Aurora Master User Password Reset

RDS or Aurora Master User Password Reset detection rules

An attacker with rds:ModifyDBInstance or rds:ModifyDBCluster sets a new master user password on a database, then signs in to the database engine as its administrative user without ever holding a database credential.

Platform
AWS
Severity
High
Log source
AWS CloudTrail
Last updated
MITRE ATT&CK technique
T1098Account Manipulation
Rule formats
Sigmaand queries for: SplunkMicrosoft Sentinel
What an attacker needs
Permission to call rds:ModifyDBInstance or rds:ModifyDBCluster on the database, and a network path to its endpoint for the sign-in that follows.
Impact
A sign-in to the database engine as the master user, with its privileges over the data, gained without any existing database credential.
Response
Set a new master password through the approved path, end the master user's sessions, and contain the principal that made the reset.
Mitigation
Restrict the RDS modify actions to database administrators, manage the master password in Secrets Manager, and keep the master user out of daily use.
CloudTrail events
ModifyDBInstanceModifyDBCluster

How the attack works

Every Amazon RDS DB instance and Aurora DB cluster has a master user, the administrative database account that RDS creates together with the database. ModifyDBInstance and, for Aurora, ModifyDBCluster accept a MasterUserPassword parameter that sets a new password for that user. The RDS API reference describes it as the way to regain access to the master user when the password is lost, because RDS API operations never return the password, and notes that the change causes no outage.

For an attacker this turns an AWS permission into a database credential. Whoever may call these actions on a database can choose the master password and sign in to the engine as its administrative user, provided they can reach the endpoint. The same request can also switch off the management of the password in AWS Secrets Manager, because a request that sets ManageMasterUserPassword to false must carry a new MasterUserPassword. CloudTrail records the call under rds.amazonaws.com with the caller in userIdentity. AWS's example record shows the password parameter in requestParameters as masterUserPassword with the value masked as ****, so the event shows that a password was set, never which one.

What an attacker needs

  • Credentials for a principal allowed to call rds:ModifyDBInstance or rds:ModifyDBCluster on the database.
  • A network path to the database endpoint for the sign-in that follows, or permissions that create one, such as making the instance publicly accessible or opening a security group.

Impact

A sign-in to the database engine as the master user, with its privileges over the data in that database. Applications and people that sign in as the master user lose access until the password is set back, which is often how the change is noticed.

Detection rules

RDS or Aurora Master User Password Reset

Detects ModifyDBInstance and ModifyDBCluster requests that carry a new master user password. AWS's example CloudTrail record for RDS shows the parameter in requestParameters as masterUserPassword with its value masked, and the RDS API reference documents MasterUserPassword as the way to set a new password for the master user of an existing database. Whoever makes the call can sign in to the database engine as its administrative user. It also matches attempts that failed (errorCode present).

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: RDS or Aurora Master User Password Reset
id: 2d617687-8207-4732-8f84-7d5b7065a0f7
status: experimental
description: >-
  Detects ModifyDBInstance and ModifyDBCluster requests that carry a new master
  user password. AWS's example CloudTrail record for RDS shows the parameter in
  requestParameters as masterUserPassword with its value masked, and the RDS
  API reference documents MasterUserPassword as the way to set a new password
  for the master user of an existing database. Whoever makes the call can sign
  in to the database engine as its administrative user. It also matches
  attempts that failed (errorCode present).
references:
  - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/logging-using-cloudtrail.html
  - https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html
  - https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBCluster.html
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: rds.amazonaws.com
    eventName:
      - ModifyDBInstance
      - ModifyDBCluster
    requestParameters.masterUserPassword|exists: true
  condition: selection
falsepositives:
  - Database administrators who reset a lost master password, and deployment pipelines or infrastructure code that set the master password on every run. Exclude those roles by userIdentity.arn after confirming them.
level: medium

False positives

  • Database administrators who reset a lost master password, and deployment pipelines or infrastructure code that set the master password on every run. Exclude those roles by userIdentity.arn after confirming them.

Triage

  • Identify the caller (userIdentity.arn), the source IP address and the user agent. Is it a database administrator or the pipeline that manages this database?
  • Read the database identifier of the request (the DBInstanceIdentifier or DBClusterIdentifier parameter) and find out which data the database holds.
  • Check whether the same request or a following one turned off Secrets Manager management (ManageMasterUserPassword false) or made the database reachable, for example with PubliclyAccessible or a security group change.
  • Check whether the owners of the database or of the secret asked for a password reset.
  • Where the engine's logs are collected, look for sign-ins as the master user after the call and note their client addresses.

Response

Once the attack is confirmed:

  1. Set a new master password through the approved path, or turn Secrets Manager management back on, and end the database sessions of the master user.
  2. Contain the principal that reset the password by deactivating its access keys or revoking its role sessions.
  3. Undo the network changes made around the reset, such as public accessibility and new security group rules.
  4. Review the database audit logs, where they exist, for what the master user did since the reset, with priority on exports, new users and changed privileges.

Mitigation

  • Grant rds:ModifyDBInstance and rds:ModifyDBCluster only to database administrators and the deployment roles that manage the databases, and keep them out of broad developer policies.
  • Let RDS manage the master user password in AWS Secrets Manager, restrict who can read that secret, and treat any request that sets the password directly as an exception.
  • Keep applications and people off the master user. Use separate database users or IAM database authentication, so that sign-ins as the master user are rare and easy to review.
  • Keep databases private and limit their security groups to the networks that need them, so that a reset password cannot be used from anywhere.

Frequently asked questions

Can I see the new password in CloudTrail?

No. AWS's example CloudTrail record for an RDS request shows the masterUserPassword parameter with the value ****. The event tells you that a password was set, by whom, from where and for which database, never the password itself.

Why does AWS allow the master password to be reset through the API?

The RDS API reference describes the MasterUserPassword parameter of ModifyDBInstance as the way to regain access to the master user when the password is lost, because RDS API operations never return the password. That makes it a normal administrative action, and also a takeover path for anyone who holds the permission.

Does the rule fire when a database is created?

No. The rule matches ModifyDBInstance and ModifyDBCluster requests that carry a master user password. CreateDBInstance also carries one, but setting the first password of a new database takes over nothing.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.