diff --git a/backend/src/services/app-connection/gcp/gcp-connection-fns.ts b/backend/src/services/app-connection/gcp/gcp-connection-fns.ts index 997021076..3c4abb6d9 100644 --- a/backend/src/services/app-connection/gcp/gcp-connection-fns.ts +++ b/backend/src/services/app-connection/gcp/gcp-connection-fns.ts @@ -153,7 +153,7 @@ export const validateGcpConnectionCredentials = async (appConnection: TGcpConnec const serviceAccountId = appConnection.credentials.serviceAccountEmail.split("@")[0]; if (!serviceAccountId.endsWith(expectedAccountIdSuffix)) { throw new BadRequestError({ - message: `GCP service account ID (the part of the email before '@') must have a suffix of "${expectedAccountIdSuffix}"` + message: `GCP service account ID must have a suffix of "${expectedAccountIdSuffix}" e.g. service-account-${expectedAccountIdSuffix}@my-project.iam.gserviceaccount.com"` }); } } diff --git a/docs/images/app-connections/gcp/create-gcp-impersonation-method.png b/docs/images/app-connections/gcp/create-gcp-impersonation-method.png index 141e24430..9d2467689 100644 Binary files a/docs/images/app-connections/gcp/create-gcp-impersonation-method.png and b/docs/images/app-connections/gcp/create-gcp-impersonation-method.png differ diff --git a/docs/images/app-connections/gcp/service-account-credentials-api.png b/docs/images/app-connections/gcp/service-account-credentials-api.png new file mode 100644 index 000000000..50a0be814 Binary files /dev/null and b/docs/images/app-connections/gcp/service-account-credentials-api.png differ diff --git a/docs/integrations/app-connections/gcp.mdx b/docs/integrations/app-connections/gcp.mdx index 3a23535ad..d75d2ae12 100644 --- a/docs/integrations/app-connections/gcp.mdx +++ b/docs/integrations/app-connections/gcp.mdx @@ -10,16 +10,21 @@ Infisical supports [service account impersonation](https://cloud.google.com/iam/ configuring your instance to use it. + + ![Service Account API](/images/app-connections/gcp/service-account-credentials-api.png) + - ![Service Account Page](/images/app-connections/gcp/service-account-overview.png) + ![Service Account IAM Page](/images/app-connections/gcp/service-account-overview.png) Create a new service account that will be used to impersonate other GCP service accounts for your app connections. - ![Service Account Page](/images/app-connections/gcp/create-instance-service-account.png) + ![Create Service Account Page](/images/app-connections/gcp/create-instance-service-account.png) + + Press "DONE" after creating the service account. Download the JSON key file for your service account. This will be used to authenticate your instance with GCP. - ![Service Account Page](/images/app-connections/gcp/create-service-account-credential.png) + ![Service Account Credential Page](/images/app-connections/gcp/create-service-account-credential.png) 1. Copy the entire contents of the downloaded JSON key file. @@ -55,9 +60,19 @@ Infisical supports [service account impersonation](https://cloud.google.com/iam/ ![Assign Service Account Permission](/images/app-connections/gcp/service-account-secret-sync-permission.png) + After configuring the appropriate roles, press "DONE". - On the new service account, assign the `Service Account Token Creator` role to the Infisical instance's service account. This allows Infisical to impersonate the new service account. + To enable service account impersonation, you'll need to grant the **Service Account Token Creator** role to the Infisical instance's service account. This configuration allows Infisical to securely impersonate the new service account. + - Navigate to the IAM & Admin > Service Accounts section in your Google Cloud Console + - Select the newly created service account + - Click on the "PERMISSIONS" tab + - Click "Grant Access" to add a new principal + + If you're using Infisical Cloud US, use the following service account: infisical-us@infisical-us.iam.gserviceaccount.com + + If you're using Infisical Cloud EU, use the following service account: infisical-eu@infisical-eu.iam.gserviceaccount.com + ![Service Account Page](/images/app-connections/gcp/service-account-grant-access.png) diff --git a/frontend/src/pages/organization/SettingsPage/components/AppConnectionsTab/components/AppConnectionForm/GcpConnectionForm.tsx b/frontend/src/pages/organization/SettingsPage/components/AppConnectionsTab/components/AppConnectionForm/GcpConnectionForm.tsx index 1a392063b..26160fe17 100644 --- a/frontend/src/pages/organization/SettingsPage/components/AppConnectionsTab/components/AppConnectionForm/GcpConnectionForm.tsx +++ b/frontend/src/pages/organization/SettingsPage/components/AppConnectionsTab/components/AppConnectionForm/GcpConnectionForm.tsx @@ -114,36 +114,42 @@ export const GcpConnectionForm = ({ appConnection, onSubmit }: Props) => { className="group" helperText={ <> - - {`Service account ID (the part of the email before '@') must be suffixed with "${expectedAccountIdSuffix}"`} - - - { - if (isCopied) { - return; - } +
+ {`Service account ID must be suffixed with "${expectedAccountIdSuffix}"`} + + { + if (isCopied) { + return; + } - navigator.clipboard.writeText(expectedAccountIdSuffix); + navigator.clipboard.writeText(expectedAccountIdSuffix); - createNotification({ - text: "Copied to clipboard", - type: "info" - }); + createNotification({ + text: "Copied to clipboard", + type: "info" + }); - toggleIsCopied(2000); - }} - className="hover:bg-bunker-100/10" - > - - - + toggleIsCopied(2000); + }} + className="hover:bg-bunker-100/10" + > + + + +
+
+ Example: + service-account- + {expectedAccountIdSuffix} + @my-project.iam.gserviceaccount.com +
} >