PostgreSQL
Learn how to dynamically generate PostgreSQL Database user passwords.
The Infisical PostgreSQL secret rotation allows you to automatically rotate your PostgreSQL database user’s password at a predefined interval.
Prerequisite
- Create a user with the required permission in your SQL instance.
Set up Dynamic Secrets with PostgreSQL
Open Secret Overview Dashboard
Open the Secret Overview dashboard and select the environment in which you would like to add a dynamic secret.
Click on the `Add Dynamic Secret` button
Select `SQL Database`
Provide the inputs for dynamic secret parameters
Name by which you want the secret to be referenced
Default time-to-live for a generated secret (it is possible to modify this value when a secret is generate)
Maximum time-to-live for a generated secret
Choose the service you want to generate dynamic secrets for
Database host
Database port
Username that will be used to create dynamic secrets
Password that will be used to create dynamic secrets
Name of the database for which you want to create dynamic secrets
(Optional) Modify SQL Statements
If you want to provide specific privileges for the future generated dynamic secrets, you are able to specify them as SQL statements.
Click `Submit`
After submitting the form, you will see a dynamic secret creates in the dashboard.
If this step fails, you might have to add the CA certficate.
Generate dynamic secrets
Now that the dynamic secret is created, you can start generating unique secret values by specifying the Time-to-live within the predefined range.
After you click the Submit
button, a new secret lease will be generated and the Database User and Database Password will be shown.
Audit or Revoke Leases
As soon as you have generated a few secret leases, you will be able to access them by clicking Generate
on the dynamic secret row. In this modal, you are able to see the expiration time or delete a secret preemptively.
Was this page helpful?