Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
docs(secrets-mgmt): clarify dual-phase rotation (#7864)
Adrian Kahalib8928fd56816
diff --git a/docs/documentation/platform/secret-rotation/mongodb-credentials.mdx b/docs/documentation/platform/secret-rotation/mongodb-credentials.mdxindex e5d1d843a0..146d15fda0 100644--- a/docs/documentation/platform/secret-rotation/mongodb-credentials.mdx+++ b/docs/documentation/platform/secret-rotation/mongodb-credentials.mdx@@ -3,17 +3,15 @@ title: "MongoDB credentials rotation"description: "Learn how to automatically rotate MongoDB credentials."----<Note>- **Rotation Type: Dual-Phase**-- This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles.-</Note>+import TwoUserRotation from "/snippets/documentation/platform/secret-rotation/two-user-rotation.mdx";## Prerequisites1. Create a [MongoDB Connection](/integrations/app-connections/mongodb) with the required **Secret Rotation** permissions2. Create two designated database users for Infisical to rotate the credentials for. Be sure to grant each user login permissions for the desired database with the necessary privileges their use case will require.+ <TwoUserRotation />+An example creation statement might look like:```bash// Switch to the target database@@ -180,4 +178,3 @@ description: "Learn how to automatically rotate MongoDB credentials."```</Tab></Tabs>-diff --git a/docs/documentation/platform/secret-rotation/mssql-credentials.mdx b/docs/documentation/platform/secret-rotation/mssql-credentials.mdxindex 250f7f57de..c429c2f12a 100644--- a/docs/documentation/platform/secret-rotation/mssql-credentials.mdx+++ b/docs/documentation/platform/secret-rotation/mssql-credentials.mdx@@ -3,17 +3,15 @@ title: "Microsoft SQL Server credentials rotation"description: "Learn how to automatically rotate Microsoft SQL Server credentials."----<Note>- **Rotation Type: Dual-Phase**-- This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles.-</Note>+import TwoUserRotation from "/snippets/documentation/platform/secret-rotation/two-user-rotation.mdx";## Prerequisites1. Create a [Microsoft SQL Server Connection](/integrations/app-connections/mssql) with the required **Secret Rotation** permissions2. Create two designated database users for Infisical to rotate the credentials for. Be sure to grant each user login permissions for the desired database with the necessary privileges their use case will require.+<TwoUserRotation />+An example creation statement might look like:```SQL-- create server-level logins@@ -65,7 +63,7 @@ An example creation statement might look like:- **Rotation Statement** - the template string query to generate password for the rotated user.- - **Password Requirements** - the requirements for the password of the Microsoft SQL Server users that will be created for the rotation.+ - **Password Requirements** - the requirements for the passwords Infisical generates for the two Microsoft SQL Server users.5. Specify the secret names that the active credentials should be mapped to. Then click **Next**.diff --git a/docs/documentation/platform/secret-rotation/mysql-credentials.mdx b/docs/documentation/platform/secret-rotation/mysql-credentials.mdxindex 80cb101dd8..122134bb72 100644--- a/docs/documentation/platform/secret-rotation/mysql-credentials.mdx+++ b/docs/documentation/platform/secret-rotation/mysql-credentials.mdx@@ -3,17 +3,15 @@ title: "MySQL credentials rotation"description: "Learn how to automatically rotate MySQL credentials."----<Note>- **Rotation Type: Dual-Phase**-- This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles.-</Note>+import TwoUserRotation from "/snippets/documentation/platform/secret-rotation/two-user-rotation.mdx";## Prerequisites1. Create a [MySQL Connection](/integrations/app-connections/mysql) with the required **Secret Rotation** permissions2. Create two designated database users for Infisical to rotate the credentials for. Be sure to grant each user login permissions for the desired database with the necessary privileges their use case will require.+ <TwoUserRotation />+An example creation statement might look like:```SQL-- create user roles@@ -60,7 +58,7 @@ description: "Learn how to automatically rotate MySQL credentials."- **Rotation Statement** - the template string query to generate password for the rotated user.- - **Password Requirements** - the requirements for the password of the MySQL users that will be created for the rotation.+ - **Password Requirements** - the requirements for the passwords Infisical generates for the two MySQL users.5. Specify the secret names that the active credentials should be mapped to. Then click **Next**.diff --git a/docs/documentation/platform/secret-rotation/oracledb-credentials.mdx b/docs/documentation/platform/secret-rotation/oracledb-credentials.mdxindex daa610365d..9fbba75fae 100644--- a/docs/documentation/platform/secret-rotation/oracledb-credentials.mdx+++ b/docs/documentation/platform/secret-rotation/oracledb-credentials.mdx@@ -3,11 +3,7 @@ title: "OracleDB credentials rotation"description: "Learn how to automatically rotate Oracle Database credentials."----<Note>- **Rotation Type: Dual-Phase**-- This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles.-</Note>+import TwoUserRotation from "/snippets/documentation/platform/secret-rotation/two-user-rotation.mdx";<Info>When working with SQL in Oracle databases, any values not surrounded by "quotes" will become UPPERCASE. Keep this in mind when creating users.@@ -18,6 +14,8 @@ description: "Learn how to automatically rotate Oracle Database credentials."1. Create a [OracleDB Connection](/integrations/app-connections/oracledb) with the required **Secret Rotation** permissions2. Create two designated database users for Infisical to rotate the credentials for. Be sure to grant each user login permissions for the desired database with the necessary privileges their use case will require.+ <TwoUserRotation />+An example creation statement might look like:```SQL-- create user roles@@ -70,7 +68,7 @@ description: "Learn how to automatically rotate Oracle Database credentials."- **Rotation Statement** - the template string query to generate password for the rotated user.- - **Password Requirements** - the requirements for the password of the Oracle Database users that will be created for the rotation.+ - **Password Requirements** - the requirements for the passwords Infisical generates for the two Oracle Database users.5. Specify the secret names that the active credentials should be mapped to. Then click **Next**.diff --git a/docs/documentation/platform/secret-rotation/overview.mdx b/docs/documentation/platform/secret-rotation/overview.mdxindex 80d92ee691..bfcb96ab99 100644--- a/docs/documentation/platform/secret-rotation/overview.mdx+++ b/docs/documentation/platform/secret-rotation/overview.mdx@@ -121,3 +121,26 @@ Infisical supports two rotation models: **Dual-Phase** (used by most providers)</Tab></Tabs>+## Database credential rotations++For most providers, including Redis and API key providers such as AWS and Cloudflare, Infisical issues a new credential on each rotation and removes the old one once it has been replaced.++Database rotations work differently. Infisical never creates or drops users in [PostgreSQL](/documentation/platform/secret-rotation/postgres-credentials), [MySQL](/documentation/platform/secret-rotation/mysql-credentials), [Microsoft SQL Server](/documentation/platform/secret-rotation/mssql-credentials), [Oracle Database](/documentation/platform/secret-rotation/oracledb-credentials), or [MongoDB](/documentation/platform/secret-rotation/mongodb-credentials). Doing so would require broader privileges than rotation needs, and a new user would not inherit the grants your applications depend on. Instead, you create two users up front and name them in the rotation.++### Why two users?++Each cycle, Infisical generates a new password for whichever of the two users is not currently active and maps it to your secrets. The other user's password stays valid as a grace-period credential until the following cycle replaces it, which is what gives the rotation its overlap.++Infisical changes passwords in place, so with a single user it would overwrite the credential currently in use and lock out every client still holding the old password. The cycle never needs more than two users, which is why the configuration form has fixed **Database Username 1** and **Database Username 2** fields.++### Who connects as the two users?++Your applications do. The pair backs one rotating credential: Infisical maps the active username and password to the secrets you choose, and your application connects as whichever user is currently active by reading those secrets.++Grant both users the same privileges, since either one may be the active credential at any time, and let Infisical be the only thing that sets their passwords. The one user you cannot name is the one your [app connection](/integrations/app-connections/overview) authenticates with, because rotating its password would break the connection that performs the rotation.++### Rotating several credentials++Create a separate rotation for each credential you need, each with its own pair of users. A rotation produces a single active credential, so a database serving three applications that need independent credentials needs three rotations and six users. Two rotations must not share a pair of users, as each would overwrite the other's passwords.++If you want credentials issued per identity and revoked after a short lease, rather than one shared credential that changes on a schedule, use a [dynamic secret](/documentation/platform/dynamic-secrets/overview) instead.diff --git a/docs/documentation/platform/secret-rotation/postgres-credentials.mdx b/docs/documentation/platform/secret-rotation/postgres-credentials.mdxindex e6ebb51335..ab8e64f0f1 100644--- a/docs/documentation/platform/secret-rotation/postgres-credentials.mdx+++ b/docs/documentation/platform/secret-rotation/postgres-credentials.mdx@@ -3,17 +3,15 @@ title: "PostgreSQL credentials rotation"description: "Learn how to automatically rotate PostgreSQL credentials."----<Note>- **Rotation Type: Dual-Phase**-- This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles.-</Note>+import TwoUserRotation from "/snippets/documentation/platform/secret-rotation/two-user-rotation.mdx";## Prerequisites1. Create a [PostgreSQL Connection](/integrations/app-connections/postgres) with the required **Secret Rotation** permissions2. Create two designated database users for Infisical to rotate the credentials for. Be sure to grant each user login permissions for the desired database with the necessary privileges their use case will require.+ <TwoUserRotation />+An example creation statement might look like:```SQL-- create user roles@@ -73,7 +71,7 @@ description: "Learn how to automatically rotate PostgreSQL credentials."- **Rotation Statement** - the template string query to generate a password for the rotated user.- - **Password Requirements** - the requirements for the password of the PostgreSQL users that will be created for the rotation.+ - **Password Requirements** - the requirements for the passwords Infisical generates for the two PostgreSQL users.5. Specify the secret names that the active credentials should be mapped to. Then click **Next**.diff --git a/docs/snippets/documentation/platform/secret-rotation/two-user-rotation.mdx b/docs/snippets/documentation/platform/secret-rotation/two-user-rotation.mdxnew file mode 100644index 0000000000..3242491ca7--- /dev/null+++ b/docs/snippets/documentation/platform/secret-rotation/two-user-rotation.mdx@@ -0,0 +1,3 @@+<Note>+ Rotation alternates between these two users, changing one password per cycle so that the other stays valid while your applications pick up the new credentials. See [why two users are required](/documentation/platform/secret-rotation/overview#why-two-users).+</Note>