How can I get the history of all the credential changes for my database?

Issue

I want to get the logs for all the credentials created for my database including the default credential for audit purpose.

Resolution

There is no direct way or single query to get the history of the database credentials.
However, all the credentials rotation is always reflected in the app releases history (https://devcenter.heroku.com/articles/releases#listing-release-history) with their corresponding config var changes.

So, one may use something like:
heroku releases -n <last_n_releases -a <app_name> | grep -E '<database_name>|<COLOUR>'

For example,
heroku releases -n 100 —app my-prod-app | grep -E 'postgresql-metric-73103|BRONZE|SILVER'

The above command would display last “100” releases for the “my-prod-app” app attached to the databases. You can add multiple database using Pipe(|).

Note: Not all the results displayed from the above is a result of credential rotations, most of them will be the effect of maintenances, but you could run heroku releases:info <RELEASE_NUMBER> to see the details and the credentials in each.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support