feat(secret-rotation): updated docs for secret rotation

This commit is contained in:
Akhil Mohan
2023-10-31 16:49:59 +05:30
parent c36352f05f
commit 8b522a3fb5
6 changed files with 158 additions and 4 deletions

View File

@@ -5,13 +5,13 @@ export const SENDGRID_TEMPLATE = {
type: "object" as const,
properties: {
admin_api_key: { type: "string" as const, desc: "Sendgrid admin api key to create new keys" },
scopes: {
api_key_scopes: {
type: "array",
items: { type: "string" as const },
desc: "Scopes for created tokens by rotation(Array)"
}
},
required: ["admin_api_key", "scopes"],
required: ["admin_api_key", "api_key_scopes"],
additionalProperties: false
},
outputs: {
@@ -30,7 +30,7 @@ export const SENDGRID_TEMPLATE = {
},
body: {
name: "infisical-${random | 16}",
scopes: { ref: "inputs.scopes" }
scopes: { ref: "inputs.api_key_scopes" }
},
setter: {
"outputs.api_key": {

View File

@@ -0,0 +1,37 @@
---
title: "MySQL/MariaDB"
description: "Rotated database user password of a MySQL or MariaDB"
---
Infisical will update periodically the provided database user's password.
<Warning>
At present Infisical do require access to your database. We will soon be released Infisical agent based rotation which would help you rotate without direct database access from Infisical cloud.
</Warning>
## Working
1. User's has to create the two user's for Infisical to rotate and provide them required database access
2. Infisical will connect with your database with admin access
3. If last rotated one was username1, then username2 is chosen to be rotated
5. Update it's password with random value
6. After testing it gets saved to the provided secret mapping
## Rotation Configuration
1. Head over to Secret Rotation configuration page of your project by clicking on side bar `Secret Rotation`
2. Click on `MySQL`
3. Provide the inputs
- Admin Username: DB admin username
- Admin Password: DB admin password
- Host: DB host
- Port: DB port(number)
- Username1: The first username in two to rotate
- Username2: The second username in two to rotate
- CA: Certificate to connect with database(string)
4. Final step
- Select `Environment`, `Secret Path` and `Interval` to rotate the secrets
- Finally select the secrets in your provided board to replace with new secret after each rotation
- Your done and good to go.
Congrats. You have 10x your MySQL/MariaDB access security.

View File

@@ -0,0 +1,37 @@
---
title: "Secret Rotation Overview"
description: "Keep your credentials safe by rotation"
---
Secret rotation is the process of periodically changing the values of secrets. This is done to reduce the risk of secrets being compromised and used to gain unauthorized access to systems or data.
Rotated secrets can be
1. API key for an external service
2. Database credentials
## How does the rotation happen?
There are four phases in secret rotation and its triggered periodically in an internval.
1. Creation
System will create secret by calling an external service like an API call, or randomly generate a value.
Now there exist three valid secrets.
2. Test
Test the new secret key by some check to ensure its working one. Thus only two will be considered active and the other is considered inactive.
3. Deletion
System will remove the inactive secret and now there exist two valid secrets
4. Finish
System will switch the secret value from the rotated ones and trigger side effects like webhooks and events.
## Infisical Secret Rotation Strategies
1. [SendGrid](./sendgrid)
2. [PostgreSQL/CockroachDB](./postgres)
3. [MySQL/MariaDB](./mysql)

View File

@@ -0,0 +1,37 @@
---
title: "PostgreSQL/CockroachDB"
description: "Rotated database user password of a postgreSQL or cochroach db"
---
Infisical will update periodically the provided database user's password.
<Warning>
At present Infisical do require access to your database. We will soon be released Infisical agent based rotation which would help you rotate without direct database access from Infisical cloud.
</Warning>
## Working
1. User's has to create the two user's for Infisical to rotate and provide them required database access
2. Infisical will connect with your database with admin access
3. If last rotated one was username1, then username2 is chosen to be rotated
5. Update it's password with random value
6. After testing it gets saved to the provided secret mapping
## Rotation Configuration
1. Head over to Secret Rotation configuration page of your project by clicking on side bar `Secret Rotation`
2. Click on `PostgreSQL`
3. Provide the inputs
- Admin Username: DB admin username
- Admin Password: DB admin password
- Host: DB host
- Port: DB port(number)
- Username1: The first username in two to rotate
- Username2: The second username in two to rotate
- CA: Certificate to connect with database(string)
4. Final step
- Select `Environment`, `Secret Path` and `Interval` to rotate the secrets
- Finally select the secrets in your provided board to replace with new secret after each rotation
- Your done and good to go.
Congrats. You have 10x your PostgreSQL/CockroachDB access security.

View File

@@ -0,0 +1,31 @@
---
title: "Twilio SendGrid"
description: "Rotate Twilio SendGrid API keys"
---
Twilio SendGrid is a cloud-based email delivery platform that helps businesses send transactional and marketing emails.
It uses an API key to do various operations. Using Infisical you can easily dynamically change the keys.
## Working
1. Infisical will need an admin token of SendGrid to create API keys dynamically.
2. Using the given admin token and scope by user Infisical will create and rotate API keys periodically
3. Under the hood infisical uses [SendGrid API](https://docs.sendgrid.com/api-reference/api-keys/create-api-keys)
## Rotation Configuration
1. Head over to Secret Rotation configuration page of your project by clicking on side bar `Secret Rotation`
2. Click on `Twilio SendGrid Card`
3. Provide the inputs
- Admin API Key:
SendGrid admin key to create lower scoped API keys.
- API Key Scopes
SendGrid generated API Key's scopes. For more info refer [this doc](https://docs.sendgrid.com/api-reference/api-key-permissions/api-key-permissions)
4. Final step
- Select `Environment`, `Secret Path` and `Interval` to rotate the secrets
- Finally select the secrets in your provided board to replace with new secret after each rotation
- Your done and good to go.
Now your output mapped secret value will be replaced periodically by SendGrid.

View File

@@ -34,7 +34,10 @@
}
},
"topbarLinks": [
{ "name": "Log In", "url": "https://app.infisical.com/login" }
{
"name": "Log In",
"url": "https://app.infisical.com/login"
}
],
"topbarCtaButton": {
"name": "Start for Free",
@@ -120,6 +123,15 @@
"documentation/platform/audit-logs",
"documentation/platform/token",
"documentation/platform/mfa",
{
"group": "Secret Rotation",
"pages": [
"documentation/platform/secret-rotation/overview",
"documentation/platform/secret-rotation/sendgrid",
"documentation/platform/secret-rotation/postgres",
"documentation/platform/secret-rotation/mysql"
]
},
{
"group": "SSO",
"pages": [