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
Dimitris Staratzise16da94aa5b6
diff --git a/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/create.mdx b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/create.mdxnew file mode 100644index 0000000000..0bb9979230--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/create.mdx@@ -0,0 +1,9 @@+---+title: "Create"+openapi: "POST /api/v2/secret-rotations/gcp-service-account-key"+---++<Note>+ Check out the configuration docs for [GCP Service Account Key Rotations](/documentation/platform/secret-rotation/gcp-service-account-key) to learn how to obtain the+ required parameters.+</Note>diff --git a/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/delete.mdx b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/delete.mdxnew file mode 100644index 0000000000..a337a8a1ef--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/delete.mdx@@ -0,0 +1,4 @@+---+title: "Delete"+openapi: "DELETE /api/v2/secret-rotations/gcp-service-account-key/{rotationId}"+---diff --git a/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/get-by-id.mdx b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/get-by-id.mdxnew file mode 100644index 0000000000..5d854559d8--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/get-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get by ID"+openapi: "GET /api/v2/secret-rotations/gcp-service-account-key/{rotationId}"+---diff --git a/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/get-by-name.mdx b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/get-by-name.mdxnew file mode 100644index 0000000000..afea155d94--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/get-by-name.mdx@@ -0,0 +1,4 @@+---+title: "Get by name"+openapi: "GET /api/v2/secret-rotations/gcp-service-account-key/rotation-name/{rotationName}"+---diff --git a/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/get-generated-credentials-by-id.mdx b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/get-generated-credentials-by-id.mdxnew file mode 100644index 0000000000..b132fb3db5--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/get-generated-credentials-by-id.mdx@@ -0,0 +1,4 @@+---+title: "Get credentials by ID"+openapi: "GET /api/v2/secret-rotations/gcp-service-account-key/{rotationId}/generated-credentials"+---diff --git a/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/list.mdx b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/list.mdxnew file mode 100644index 0000000000..535fbe2ddc--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/list.mdx@@ -0,0 +1,4 @@+---+title: "List"+openapi: "GET /api/v2/secret-rotations/gcp-service-account-key"+---diff --git a/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/rotate-secrets.mdx b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/rotate-secrets.mdxnew file mode 100644index 0000000000..75223311ed--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/rotate-secrets.mdx@@ -0,0 +1,4 @@+---+title: "Rotate secrets"+openapi: "POST /api/v2/secret-rotations/gcp-service-account-key/{rotationId}/rotate-secrets"+---diff --git a/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/update.mdx b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/update.mdxnew file mode 100644index 0000000000..0c09913420--- /dev/null+++ b/docs/api-reference/endpoints/secret-rotations/gcp-service-account-key/update.mdx@@ -0,0 +1,4 @@+---+title: "Update"+openapi: "PATCH /api/v2/secret-rotations/gcp-service-account-key/{rotationId}"+---diff --git a/docs/docs.json b/docs/docs.jsonindex 76913891be..5cedb4298b 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -314,6 +314,7 @@"documentation/platform/secret-rotation/auth0-client-secret","documentation/platform/secret-rotation/aws-iam-user-secret","documentation/platform/secret-rotation/azure-client-secret",+ "documentation/platform/secret-rotation/gcp-service-account-key","documentation/platform/secret-rotation/ldap-password","documentation/platform/secret-rotation/okta-client-secret"]@@ -2977,6 +2978,19 @@"api-reference/endpoints/secret-rotations/fireworks-api-key/update"]},+ {+ "group": "GCP service account key",+ "pages": [+ "api-reference/endpoints/secret-rotations/gcp-service-account-key/create",+ "api-reference/endpoints/secret-rotations/gcp-service-account-key/delete",+ "api-reference/endpoints/secret-rotations/gcp-service-account-key/get-by-id",+ "api-reference/endpoints/secret-rotations/gcp-service-account-key/get-by-name",+ "api-reference/endpoints/secret-rotations/gcp-service-account-key/get-generated-credentials-by-id",+ "api-reference/endpoints/secret-rotations/gcp-service-account-key/list",+ "api-reference/endpoints/secret-rotations/gcp-service-account-key/rotate-secrets",+ "api-reference/endpoints/secret-rotations/gcp-service-account-key/update"+ ]+ },{"group": "LDAP password","pages": [diff --git a/docs/documentation/platform/secret-rotation/gcp-service-account-key.mdx b/docs/documentation/platform/secret-rotation/gcp-service-account-key.mdxnew file mode 100644index 0000000000..fcaaa3d220--- /dev/null+++ b/docs/documentation/platform/secret-rotation/gcp-service-account-key.mdx@@ -0,0 +1,167 @@+---+title: "GCP service account key"+description: "Learn how to automatically rotate GCP service account keys."+---++Rotate the JSON keys of a Google Cloud service account on a schedule. On each rotation, Infisical creates a new key for the service account, stores the key file in a secret, and deletes the key it created one rotation earlier.++<Info>+ **Rotation Type: Dual-Phase**++ This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles.+</Info>++<Note>+ This rotation needs a [GCP app connection](/integrations/app-connections/gcp). This guide walks you through creating a project-scoped app connection.+</Note>++## Prerequisites++- A [project with secrets configured](/documentation/platform/secrets-mgmt/quick-starts/deliver-first-secret)+- A GCP service account that your applications authenticate as with a key+- A role that lets you grant roles on that service account, such as **Service Account Admin**+- The `iam.disableServiceAccountKeyCreation` organization policy not enforced on the service account's project (if it's enforced, nobody can create keys in that project)++## Step 1: Configure the service account for Infisical++Infisical needs a GCP connection whose service account has the **Service Account Key Admin** role on the service account you want to rotate. The role lets Infisical create and delete keys for the service account you want to rotate.++<Steps>+ <Step>+ If you don't have a GCP connection yet, create the connection's service account and let Infisical impersonate it, as described in [Configure service account for Infisical](/integrations/app-connections/gcp#configure-service-account-for-infisical).+ </Step>+ <Step>+ In the Google Cloud console, go to **IAM & Admin** > **Service Accounts** and select the service account you want to rotate.+ </Step>+ <Step>+ On the **Permissions** tab, select **Grant access**.+ </Step>+ <Step>+ In **New principals**, enter the email of the connection's service account. Under **Select a role**, choose **Service Account Key Admin**, then select **Save**.++ + </Step>+</Steps>++<Tip>+ To rotate the keys of several service accounts in one project, you can grant the role once on the project's **IAM** page instead. The connection can then create keys for every service account in the project, including service accounts with broad access, so choose carefully [where the connection lives](/integrations/app-connections/overview#where-a-connection-lives) and who can use it.+</Tip>++## Step 2: Set up the rotation in Infisical++<Tip>+ To create the rotation using the API, use the [Create GCP Service Account Key Rotation](/api-reference/endpoints/secret-rotations/gcp-service-account-key/create) endpoint.+</Tip>++<Steps>+ <Step>+ In your Secrets Manager project, open the dashboard, select **Add New**, then select **Add Secret Rotation**.++ ++ Then, select the **GCP Service Account Key** option.++ + </Step>+ <Step>+ Under **Configuration**, choose the app connection and when the rotation runs:++ - **Environment**: The project environment the rotated secret is stored in+ - **GCP Connection**: The app connection the rotation uses+ - **Rotation Interval (In Days)**: The number of days between rotations+ - **Rotate At (Local Time)**: The time of day the rotation runs+ - **Auto-Rotation Enabled**: When enabled, the key rotates on the schedule; turn it off to rotate manually only++ <Tabs>+ <Tab title="Create a new app connection">+ Under **GCP Connection**, select **Create Connection** in the dropdown, then fill in:++ - **Name**: A name for the connection+ - **Description** (optional): What the connection is for+ - **Method**: **Service Account Impersonation**+ - **Service Account Email**: The email of the connection's service account from [Step 1](#step-1-configure-the-service-account-for-infisical)++ Select **Connect to GCP**. Infisical returns you to the rotation form with the new connection selected.++ <Note>+ This creates a connection scoped to the current project. To share the connection across other projects, [create it at the organization level](/integrations/app-connections/gcp#setup-gcp-connection-in-infisical) first, then select it here.+ </Note>+ </Tab>+ <Tab title="Use an existing connection">+ Under **GCP Connection**, select the app connection you'd like to use.+ </Tab>+ </Tabs>++ ++ Then select **Continue**.+ </Step>+ <Step>+ Under **Parameters**, enter the service account whose keys Infisical rotates:++ - **Service Account Email**: The email of the service account you want to rotate, such as `[email protected]` (you can't change it after you create the rotation)++ ++ Then select **Continue**.+ </Step>+ <Step>+ Under **Mappings**, choose the name of the Infisical secret that holds the rotated key:++ - **Service Account Key**: The name of the secret that holds the JSON key file++ ++ Then select **Continue**.+ </Step>+ <Step>+ Give the rotation a **Name** and an optional **Description**. The name must be slug-friendly.++ ++ Then select **Continue**.+ </Step>+ <Step>+ Review your GCP Service Account Key Rotation configuration, then select **Create secret rotation**.++ ++ <Check>+ The JSON key file is now available through the mapped secret. If auto-rotation is enabled, the key rotates on your configured schedule.+ </Check>++ + </Step>+</Steps>++## Frequently asked questions++<AccordionGroup>+ <Accordion title="How do I use the key in my application?">+ The secret holds the contents of a JSON key file. Google Cloud client libraries read the key from a file whose path is in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable, so write the secret's value to a file and set the variable to that file's path. Some client libraries can also take the JSON contents directly.+ </Accordion>+ <Accordion title="How many keys does the rotation keep on the service account?">+ Infisical keeps two keys: the current key, which the secret holds, and the previous key, which keeps working until the next rotation deletes it. During a rotation, Infisical creates the new key before it deletes the previous key, so the service account needs room for a third key under GCP's limit of 10 keys per service account.++ Infisical doesn't change or delete keys that it didn't create. After your applications read the key from Infisical, delete any keys you created by hand so they stop working.+ </Accordion>+ <Accordion title="Why does a scheduled rotation take longer than a manual one?">+ GCP can take a minute or more before it accepts a new key. A scheduled rotation waits until GCP accepts the new key before it updates the secret, so applications don't read a key that GCP still rejects. If GCP doesn't accept the key within about 35 seconds, Infisical deletes the new key and the rotation fails, and the current key stays in the secret.++ If you rotate the key manually with **Rotate Secret**, or create a new rotation, Infisical updates the secret without waiting. For a short time after that, applications that read the new key can fail to authenticate. After a manual rotation, the previous key keeps working during that time.+ </Accordion>+ <Accordion title="Can I use this rotation with a key expiry policy?">+ Yes. If your Google Cloud organization enforces the `iam.serviceAccountKeyExpiryHours` policy, every key expires after the policy's duration, including the keys Infisical creates. Each key stays valid for two rotation intervals (first as the current key, then as the previous key), so set the rotation interval to at most half of the expiry. For example, with a 90-day expiry, rotate every 45 days or less.+ </Accordion>+</AccordionGroup>++## Next steps++<CardGroup cols={2}>+ <Card title="GCP" icon="plug" href="/integrations/app-connections/gcp">+ Set up the GCP connection that Infisical uses to manage service account keys.+ </Card>+ <Card title="Overview" icon="refresh-cw" href="/documentation/platform/secret-rotation/overview">+ Learn how dual-phase and single-phase rotations work.+ </Card>+</CardGroup>diff --git a/docs/images/app-connections/gcp/service-account-secret-rotation-permission.png b/docs/images/app-connections/gcp/service-account-secret-rotation-permission.pngnew file mode 100644index 0000000000..765c0b135bBinary files /dev/null and b/docs/images/app-connections/gcp/service-account-secret-rotation-permission.png differdiff --git a/docs/images/secret-rotations-v2/gcp-service-account-key/configuration.png b/docs/images/secret-rotations-v2/gcp-service-account-key/configuration.pngnew file mode 100644index 0000000000..34467d5eefBinary files /dev/null and b/docs/images/secret-rotations-v2/gcp-service-account-key/configuration.png differdiff --git a/docs/images/secret-rotations-v2/gcp-service-account-key/created.png b/docs/images/secret-rotations-v2/gcp-service-account-key/created.pngnew file mode 100644index 0000000000..6b3f61e27bBinary files /dev/null and b/docs/images/secret-rotations-v2/gcp-service-account-key/created.png differdiff --git a/docs/images/secret-rotations-v2/gcp-service-account-key/details.png b/docs/images/secret-rotations-v2/gcp-service-account-key/details.pngnew file mode 100644index 0000000000..64bb674533Binary files /dev/null and b/docs/images/secret-rotations-v2/gcp-service-account-key/details.png differdiff --git a/docs/images/secret-rotations-v2/gcp-service-account-key/parameters.png b/docs/images/secret-rotations-v2/gcp-service-account-key/parameters.pngnew file mode 100644index 0000000000..be4fb650d1Binary files /dev/null and b/docs/images/secret-rotations-v2/gcp-service-account-key/parameters.png differdiff --git a/docs/images/secret-rotations-v2/gcp-service-account-key/review.png b/docs/images/secret-rotations-v2/gcp-service-account-key/review.pngnew file mode 100644index 0000000000..e8d18a36b4Binary files /dev/null and b/docs/images/secret-rotations-v2/gcp-service-account-key/review.png differdiff --git a/docs/images/secret-rotations-v2/gcp-service-account-key/secrets-mapping.png b/docs/images/secret-rotations-v2/gcp-service-account-key/secrets-mapping.pngnew file mode 100644index 0000000000..6a6884fcd3Binary files /dev/null and b/docs/images/secret-rotations-v2/gcp-service-account-key/secrets-mapping.png differdiff --git a/docs/images/secret-rotations-v2/gcp-service-account-key/select-gcp-service-account-key.png b/docs/images/secret-rotations-v2/gcp-service-account-key/select-gcp-service-account-key.pngnew file mode 100644index 0000000000..eb0bfcb41eBinary files /dev/null and b/docs/images/secret-rotations-v2/gcp-service-account-key/select-gcp-service-account-key.png differdiff --git a/docs/integrations/app-connections/gcp.mdx b/docs/integrations/app-connections/gcp.mdxindex 9088447de0..9a8672d9f6 100644--- a/docs/integrations/app-connections/gcp.mdx+++ b/docs/integrations/app-connections/gcp.mdx@@ -119,6 +119,11 @@ Infisical supports [service account impersonation](https://cloud.google.com/iam/--project=PROJECT_ID```</Tab>+ <Tab title="Secret Rotation">+ Add the **Service Account Key Admin** role so Infisical can create and delete keys for [GCP service account key rotations](/documentation/platform/secret-rotation/gcp-service-account-key).++ If you add the role here, it applies to every service account in the project. To allow rotation for specific service accounts only, skip the role here and grant it on each of those service accounts, as described in [the rotation guide](/documentation/platform/secret-rotation/gcp-service-account-key#step-1-configure-the-service-account-for-infisical).+ </Tab></Tabs>After configuring the appropriate roles, press "DONE".</Step>diff --git a/docs/snippets/catalogs/secret-rotations.jsx b/docs/snippets/catalogs/secret-rotations.jsxindex 7fab854e05..d8c25b8946 100644--- a/docs/snippets/catalogs/secret-rotations.jsx+++ b/docs/snippets/catalogs/secret-rotations.jsx@@ -23,6 +23,14 @@ export const secretRotations = [category: "Cloud Providers",rotationType: "Dual-Phase",},+ {+ name: "GCP Service Account Key",+ slug: "gcp-service-account-key",+ path: "/documentation/platform/secret-rotation/gcp-service-account-key",+ description: "Learn how to automatically rotate GCP service account keys.",+ category: "Cloud Providers",+ rotationType: "Dual-Phase",+ },{name: "Databricks Service Principal Secret",slug: "databricks-service-principal-secret",