Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

docs: gcp pam

Sheen Capadnganebea94492207
diff --git a/docs/cli/commands/pam.mdx b/docs/cli/commands/pam.mdx
index 2ac39c9746..10137ed234 100644
--- a/docs/cli/commands/pam.mdx
+++ b/docs/cli/commands/pam.mdx
@@ -1,6 +1,6 @@
---
title: "infisical pam"
-description: "Access databases, SSH servers, Kubernetes clusters, AWS IAM roles, and Windows servers through Infisical's Privileged Access Management"
+description: "Access databases, SSH servers, Kubernetes clusters, AWS IAM roles, GCP service accounts, and Windows servers through Infisical's Privileged Access Management"
---
```bash
@@ -9,7 +9,7 @@ infisical pam access <path> [flags]
## Description
-The `infisical pam` command provides privileged access management capabilities for securely accessing databases, SSH servers, Kubernetes clusters, AWS IAM roles, and Windows/RDP servers through Infisical's Gateway.
+The `infisical pam` command provides privileged access management capabilities for securely accessing databases, SSH servers, Kubernetes clusters, AWS IAM roles, GCP service accounts, and Windows/RDP servers through Infisical's Gateway.
All PAM commands require the user to be logged in via `infisical login`.
@@ -22,7 +22,7 @@ infisical pam
## infisical pam access
-Access PAM-managed resources through Infisical's Gateway. This unified command handles all resource types — databases, SSH servers, Kubernetes clusters, AWS IAM roles, and Windows/RDP servers. The account type is determined by the template assigned to the account.
+Access PAM-managed resources through Infisical's Gateway. This unified command handles all resource types — databases, SSH servers, Kubernetes clusters, AWS IAM roles, GCP service accounts, and Windows/RDP servers. The account type is determined by the template assigned to the account.
```bash
infisical pam access <path> [flags]
@@ -171,6 +171,24 @@ aws s3 ls
The session blocks until `Ctrl+C` or credential expiry. When the session ends, the profile is removed from the credentials file.
+### GCP Service Account
+
+Starts a local proxy on `127.0.0.1` and automatically configures `gcloud` to route through it (via the `proxy/*`, `auth/access_token_file`, and `core/custom_ca_certs_file` config properties). Requires the [`gcloud` CLI](https://cloud.google.com/sdk/docs/install) to be installed. All traffic is proxied through the Infisical Gateway, which injects the brokered credentials before forwarding to `googleapis.com`.
+
+```bash
+# Example
+infisical pam access gcp/prod-deployer
+```
+
+Run `gcloud` and other Google Cloud tooling as normal — no per-command configuration needed:
+
+```bash
+gcloud compute instances list
+gcloud storage ls
+```
+
+The access token is capped at Google's maximum lifetime of 1 hour. The session blocks until `Ctrl+C` or token expiry; on shutdown the CLI reverts the `gcloud` configuration and deletes the temporary token and certificate files.
+
### Windows / RDP
Starts a local RDP proxy. Connect your RDP client to `127.0.0.1` on the assigned port.
diff --git a/docs/docs.json b/docs/docs.json
index 88586297c9..0441bf3b71 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -996,6 +996,7 @@
"documentation/platform/pam/accounts/ssh",
"documentation/platform/pam/accounts/kubernetes",
"documentation/platform/pam/accounts/aws-iam",
+ "documentation/platform/pam/accounts/gcp-service-account",
"documentation/platform/pam/accounts/windows",
"documentation/platform/pam/accounts/windows-ad"
]
diff --git a/docs/documentation/platform/pam/accounts/gcp-service-account.mdx b/docs/documentation/platform/pam/accounts/gcp-service-account.mdx
new file mode 100644
index 0000000000..808c7ed751
--- /dev/null
+++ b/docs/documentation/platform/pam/accounts/gcp-service-account.mdx
@@ -0,0 +1,126 @@
+---
+title: "GCP Service Accounts"
+sidebarTitle: "GCP Service Account"
+description: "Add and connect to GCP service accounts via impersonation or a static key."
+---
+
+GCP Service Accounts let you broker credential-less access to Google Cloud. Instead of handing out long-lived service account keys, users request access through Infisical and connect to Google Cloud as the target service account through a [Gateway](/documentation/platform/gateways/overview), with every access logged.
+
+<Note>
+GCP Service Accounts are available through the **CLI and API only** — there is no in-browser (web) access.
+</Note>
+
+## How It Works
+
+Each account points at a single GCP service account (identified by its email). When a user starts a session:
+
+1. Infisical obtains a short-lived OAuth 2.0 access token for the target service account (see [authentication methods](#authentication-methods) below).
+2. The user's Google Cloud requests are routed through a local proxy to the Infisical **Gateway**, which reaches `googleapis.com` on their behalf.
+3. The Gateway injects the access token into each request before forwarding it, so the user never handles the token directly.
+
+<Note>
+Because Google caps service account tokens at a 1-hour lifetime, GCP sessions are limited to a maximum of 1 hour, even if the template allows a longer duration.
+</Note>
+
+### Authentication Methods
+
+You pick one of these when creating the account. The setup for each is covered in the steps below.
+
+- **Impersonation (recommended)** — Infisical itself runs under its own Google Cloud service account. Instead of storing any credentials for your target service account, it [impersonates](https://cloud.google.com/iam/docs/service-account-impersonation) that account, asking Google to issue short-lived tokens on demand. This is the cleanest option because no keys for the target service account are ever created or stored.
+- **Static Key** — You provide a service account key JSON, which Infisical stores encrypted and uses to obtain tokens. Choose this if you can't (or don't want to) set up impersonation. The key can belong to the target service account itself, or to a separate privileged service account allowed to impersonate it.
+
+## Creating an Account
+
+<Steps>
+ <Step title="Start adding an account">
+ Go to **Privileged Access Management → Accounts** and click **Add Account**.
+ </Step>
+ <Step title="Select a folder and template">
+ Choose which [folder](/documentation/platform/pam/folders/overview) to add the account to, then select a GCP Service Account [template](/documentation/platform/pam/templates/overview).
+
+ The template (or the account) must be assigned a [Gateway](/documentation/platform/gateways/overview) — GCP traffic is proxied through it, so the Gateway needs outbound access to `googleapis.com` on port `443`.
+ </Step>
+ <Step title="Enter connection details">
+ | Field | Description |
+ |-------|-------------|
+ | **Name** | A descriptive name (e.g., `prod-deployer`) |
+ | **Service Account Email** | The email of the target GCP service account (must end in `.iam.gserviceaccount.com`) |
+ </Step>
+ <Step title="Choose an authentication method">
+ Pick how Infisical should obtain tokens for the target service account, then follow the matching setup.
+
+ <Tabs>
+ <Tab title="Impersonation">
+ There are no credentials to enter — but you need to authorize Infisical's service account to impersonate your target service account. This is a one-time grant per target service account.
+
+ **1. Find Infisical's service account**
+
+ | Environment | Infisical's service account |
+ |-------------|-----------------------------|
+ | Infisical Cloud US | `[email protected]` |
+ | Infisical Cloud EU | `[email protected]` |
+ | Self-hosted | The service account configured via the `INF_APP_CONNECTION_GCP_SERVICE_ACCOUNT_CREDENTIAL` environment variable |
+
+ **2. Grant it the Token Creator role**
+
+ In the Google Cloud Console, go to **IAM & Admin → Service Accounts**, select your **target** service account, open the **PERMISSIONS** tab, click **Grant Access**, add Infisical's service account (from step 1) as a principal, and assign it the **Service Account Token Creator** (`roles/iam.serviceAccountTokenCreator`) role.
+
+ <Note>
+ **Self-hosted only:** impersonation first needs a platform GCP service account configured on your instance — a one-time setup covered in [Configuring GCP for a self-hosted instance](/integrations/app-connections/gcp).
+ </Note>
+ </Tab>
+ <Tab title="Static Key">
+ Provide a service account key JSON. Infisical stores it encrypted and never returns it to clients.
+
+ **1. Create a key**
+
+ In the Google Cloud Console, go to **IAM & Admin → Service Accounts** and select the service account to use — either the target service account itself, or a privileged one allowed to impersonate it. Open the **KEYS** tab, click **Add Key → Create new key**, and choose **JSON**. The file downloads automatically.
+
+ **2. Paste it into the form**
+
+ | Field | Description |
+ |-------|-------------|
+ | **Service Account Key JSON** | The full contents of the downloaded JSON key (must contain `client_email` and `private_key`) |
+ </Tab>
+ </Tabs>
+ </Step>
+ <Step title="Save">
+ Click **Create**.
+ </Step>
+</Steps>
+
+## Connecting
+
+Use the CLI to start a session. This requires the [`gcloud` CLI](https://cloud.google.com/sdk/docs/install) to be installed locally.
+
+```bash
+infisical pam access my-folder/prod-deployer
+```
+
+The command **automatically configures `gcloud`** for the session — you don't need to change anything or run any extra commands. Once it's active, use `gcloud` (and other Google Cloud tooling) as normal:
+
+```bash
+gcloud compute instances list
+gcloud storage ls
+```
+
+Press **Ctrl+C** to stop the session (or wait for it to expire, max 1 hour). Your `gcloud` configuration is automatically restored when the session ends.
+
+**Flags:**
+- `--reason <reason>` — provide an access reason (if required by the template)
+- `--duration <duration>` — request a session duration (e.g., `30m`), capped at the template maximum and never more than 1 hour
+
+<Note>
+A GCP session recording is a log of the HTTP requests and responses made to Google Cloud during the session — each request's method and URL, and its response status.
+</Note>
+
+## Next Steps
+
+<CardGroup cols={2}>
+ <Card title="AWS IAM Accounts" icon="aws" href="/documentation/platform/pam/accounts/aws-iam">
+ Add AWS IAM role accounts.
+ </Card>
+ <Card title="Sessions" icon="display" href="/documentation/platform/pam/sessions/overview">
+ View and manage sessions.
+ </Card>
+</CardGroup>
diff --git a/docs/documentation/platform/pam/accounts/overview.mdx b/docs/documentation/platform/pam/accounts/overview.mdx
index e364fcbcbe..e3ca5e3972 100644
--- a/docs/documentation/platform/pam/accounts/overview.mdx
+++ b/docs/documentation/platform/pam/accounts/overview.mdx
@@ -21,6 +21,7 @@ PAM supports the following account types:
| [**SSH**](/documentation/platform/pam/accounts/ssh) | Linux/Unix servers | ✓ |
| [**Kubernetes**](/documentation/platform/pam/accounts/kubernetes) | Kubernetes clusters | |
| [**AWS IAM**](/documentation/platform/pam/accounts/aws-iam) | AWS IAM roles | ✓ |
+| [**GCP Service Account**](/documentation/platform/pam/accounts/gcp-service-account) | GCP service accounts | |
| [**Windows**](/documentation/platform/pam/accounts/windows) | Windows servers (RDP) | ✓ |
| [**Windows AD**](/documentation/platform/pam/accounts/windows-ad) | Windows via Active Directory | ✓ |