Microsoft SQL Server
Learn how to automatically rotate Microsoft SQL Server user passwords.
The Infisical SQL Server secret rotation allows you to automatically rotate your database users’ passwords at a predefined interval.
Prerequisites
- Create two SQL Server logins and database users with the required permissions. We’ll refer to them as
user-a
anduser-b
. - Create another SQL Server login with permissions to alter logins for
user-a
anduser-b
. We’ll refer to this as theadmin
login.
Here’s how to set up the prerequisites:
To learn more about SQL Server’s permission system, please visit this documentation.
How it works
- Infisical connects to your database using the provided
admin
login credentials. - A random value is generated and the password for
user-a
is updated with the new value. - The new password is then tested by logging into the database.
- If test is successful, it’s saved to the output secret mappings so that rest of the system gets the newly rotated value(s).
- The process is then repeated for
user-b
on the next rotation. - The cycle repeats until secret rotation is deleted/stopped.
Rotation Configuration
Open Secret Rotation Page
Head over to Secret Rotation configuration page of your project by clicking on Secret Rotation
in the left side bar
Click on Microsoft SQL Server card
Provide the inputs
SQL Server admin username
SQL Server admin password
SQL Server host url (e.g., your-server.database.windows.net)
Database port number (default: 1433)
Database name (default: master)
The first login name to rotate - user-a
The second login name to rotate - user-b
Optional database certificate to connect with database
Configure the output secret mapping
When a secret rotation is successful, the updated values needs to be saved to an existing key(s) in your project.
The environment where the rotated credentials should be mapped to.
The secret path where the rotated credentials should be mapped to.
What interval should the credentials be rotated in days.
Select an existing secret key where the rotated database username value should be saved to.
Select an existing select key where the rotated database password value should be saved to.
FAQ
Was this page helpful?