Repository navigation
feat(warehouse): bigquery workload identity federation authentication - #7361
Merged
Merged
Conversation
Let the BigQuery destination's `credentials` field hold a Workload Identity Federation (WIF) credential configuration (external_account / external_account_authorized_user), not just a static service account key. Such a configuration can carry a service_account_impersonation_url, so a customer can authenticate through an external identity provider (AWS, Azure, OIDC/SAML) and impersonate a GCP service account for short-lived tokens - no static private key stored in the destination config. - connect() and jobStatistics() now share a new authOptions() helper, which validates the credentials via googleutil.CompatibleFederatedCredentialsJSON (accepts service_account, external_account, external_account_authorized_user) and passes the actual credential type through to option.WithAuthCredentialsJSON, instead of hardcoding option.ServiceAccount. - Fixes a pre-existing gap along the way: jobStatistics() used to always require a static service_account key and skip the ShouldSkipCredentialsInit check that connect() already applied, so it broke under GKE Workload Identity (empty credentials) even though connect() worked fine. It now goes through the same authOptions() path as connect(). Depends on rudderlabs/rudder-go-kit#1214 (adds googleutil.CompatibleFederatedCredentialsJSON / CredentialType) - this PR is opened as a draft and won't build against the currently pinned go-kit v0.78.2 until that lands and go.mod is bumped. Co-Authored-By: Claude Sonnet 5 <[email protected]> Scanned-by: gitleaks 8.29.0
…ration Add authMethod "workloadIdentityFederation" to the BigQuery destination. With it, no credentials are stored: rudder-server assumes RudderStack's AWS federation role (RUDDER_GCP_FEDERATION_AWS_ROLE_ARN, AWS_REGION) with the workspace ID as the role session name, exchanges those credentials through the customer's workload identity pool, and impersonates the customer's service account. The customer binds the service account to their workspace ID, so the grant cannot be used by any other workspace. - bigquery: authOptions branches on authMethod; the default path accepts only a service account key again, reverting acceptance of pasted external_account configurations whose credential_source a destination could control. - misc: GetObjectStorageConfig passes the workspace ID and federation role to GCS configs, so staging uploads authenticate the same way. - model: authMethod, targetServiceAccount and workload identity pool settings. - bump rudder-go-kit for googleutil.AWSFederatedTokenSource; this raises the go directive to 1.27.1. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
…query Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
…tion When RUDDER_GCP_FEDERATION_AWS_ROLE_ARN is unset, rudder-go-kit now assumes the pod's IRSA role via web identity with the workspace ID as the session name, so no dedicated IAM role is required. The federation region follows the existing AWS_S3_REGION_HINT convention via misc.GetRegionHint(). Bump rudder-go-kit for the fallback. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
…tyTargetServiceAccount Match the workloadIdentity prefix of the other workload identity federation destination settings, and bump rudder-go-kit for the GCS manager rename. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7361 +/- ##
==========================================
- Coverage 84.41% 83.86% -0.55%
==========================================
Files 620 620
Lines 62640 62683 +43
==========================================
- Hits 52876 52569 -307
- Misses 9761 10111 +350
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ervice account Bump rudder-go-kit so workload identity federation impersonates the target service account only when set and otherwise uses the federated token directly. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
Bump rudder-go-kit and inject workspaceID, workloadIdentityAWSRoleARN and workloadIdentityAWSRegion for GCS object storage. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
…ntity uploads Build the BigQuery auth options once in connect so job statistics do not exchange federated credentials again for every table load, pass the workspace ID to identity resolution uploads, read the federation role through injected config, and bump rudder-go-kit for the read/write GCS federation scope. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
…n test Load data through service account impersonation and through federated identities, authenticating to Cloud Storage and BigQuery only via AWS workload identity federation, and check that another workspace is denied. CI assumes the federation test role with the Ginkgo AWS credentials. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
achettyiitr
marked this pull request as ready for review
September 17, 2026 08:49
achettyiitr
self-requested a review
September 17, 2026 08:56
…n TestIntegration make test-warehouse runs -run 'TestIntegration', which never selected the separate TestWorkloadIdentityFederationIntegration. Move it into bigquery_test.go as a subtest and check both credential secrets up front. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
krishna2020
commented
Sep 18, 2026
Use the standard AWS_REGION variable instead of the S3-specific AWS_S3_REGION_HINT for workload identity federation, defaulting to us-east-1. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
achettyiitr
approved these changes
Sep 21, 2026
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
…s locked The shared Redshift test user is locked (pq 28000: account locked due to multiple failed login attempts), failing every run across PRs. Re-enable once it is unlocked. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
This was referenced Sep 21, 2026
Merged
achettyiitr
pushed a commit
that referenced
this pull request
Sep 21, 2026
🤖 I have created a release *beep* *boop* --- ## [1.88.0-rc.1](v1.87.0...v1.88.0-rc.1) (2026-09-21) ### Features * **warehouse:** bigquery workload identity federation authentication ([#7361](#7361)) ([d16ab5f](d16ab5f)) ### Bug Fixes * bound clickHouse v2 s3 copy memory ([#7407](#7407)) ([a17a78f](a17a78f)) ### Miscellaneous * cleanup python mirroring ([#7395](#7395)) ([9f9bcde](9f9bcde)) * default failed-keys error capture on ([#7404](#7404)) ([db84987](db84987)) * sync release v1.87.0 to main branch ([#7394](#7394)) ([80353d1](80353d1)) * tag namespace config http client stats with version and mode ([#7401](#7401)) ([d152ae5](d152ae5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
mihir20
pushed a commit
that referenced
this pull request
Sep 22, 2026
🤖 I have created a release *beep* *boop* --- ## [1.88.0](v1.87.0...v1.88.0) (2026-09-21) ### Features * **warehouse:** bigquery workload identity federation authentication ([#7361](#7361)) ([d16ab5f](d16ab5f)) ### Bug Fixes * bound clickHouse v2 s3 copy memory ([#7407](#7407)) ([a17a78f](a17a78f)) ### Miscellaneous * cleanup python mirroring ([#7395](#7395)) ([9f9bcde](9f9bcde)) * default failed-keys error capture on ([#7404](#7404)) ([db84987](db84987)) * sync release v1.87.0 to main branch ([#7394](#7394)) ([80353d1](80353d1)) * tag namespace config http client stats with version and mode ([#7401](#7401)) ([d152ae5](d152ae5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds Workload Identity Federation as an authentication method for the BigQuery warehouse destination, so no static service account key has to be stored.
With
authMethod: workloadIdentityFederation, rudder-server usesgoogleutil.AWSFederatedTokenSource(rudderlabs/rudder-go-kit#1214):RUDDER_GCP_FEDERATION_AWS_ROLE_ARNwhen set, otherwise from the pod's IRSA role (AWS_ROLE_ARN/AWS_WEB_IDENTITY_TOKEN_FILE). The region comes fromAWS_REGION(defaultus-east-1).workloadIdentityProjectNumber,workloadIdentityPoolId,workloadIdentityProviderId).workloadIdentityTargetServiceAccountif set. Otherwise it uses the federated token directly (roles granted to the pool principal).Customers can restrict the grant to their workspace with the attribute mapping
attribute.workspace=assertion.arn.extract('assumed-role/<role>/{workspace}').Without
authMethodor withserviceAccountKey, behaviour is unchanged:credentialsmust be a service account key, or empty under GKE Workload Identity.Changes
warehouse/integrations/bigquery:authOptions()picks federation or the service account key.connect()builds the options once and stores them, andjobStatistics()reuses them, so federation does not exchange credentials again for every table load. As a side effect,jobStatistics()now honoursgoogleutil.ShouldSkipCredentialsInitlikeconnect()(under GKE workload identity with empty credentials it uses Application Default Credentials instead of failing).warehouse/internal/model: settings forauthMethodand the four workload identity keys, in their own group.warehouse/identity: identity resolution uploads pass the workspace ID, so their GCS uploads authenticate with federation too.utils/misc:GetRudderGCPFederationAWSRoleAndRegion(conf)(BigQuery passes its injected config).GetObjectStorageConfiginjectsworkspaceID,workloadIdentityAWSRoleARNandworkloadIdentityAWSRegionfor GCS, so staging uploads through the go-kit GCS manager authenticate the same way.go.mod: rudder-go-kit bumped tov0.80.0(includes feat: authenticate to GCP via AWS workload identity federation rudder-go-kit#1214).Temporary: Redshift integration test skipped
warehouse/integrations/redshiftTestIntegrationis skipped because the shared Redshift test user is locked (pq: Account locked due to multiple failed login attempts (28000)), which fails the Redshift job on every PR, not just this one. Unrelated to this change; re-enable once the user is unlocked.Testing
TestWorkloadIdentityFederation: with and without a target service account,connect()succeeds without readingcredentials(anauthorized_uservalue that would be rejected) and stores the auth options reused by job statistics.TestUnsupportedCredentialType(new):authorized_useris still rejected for the service account key method.TestUnsupportedCredentialsis unchanged.utils/misc: federation fields are injected for GCS object storage config.TestIntegration/Workload identity federation(real AWS and GCP,BIGQUERY_WIF_INTEGRATION_TEST_CREDENTIALS, checked with the other BigQuery secret at the start ofTestIntegration): for both service account impersonation and federated identities, stages a load file through the GCS manager, creates the dataset and table, loads 14 rows and reads them back using only federation; a different workspace is denied. CI assumes the federation test role with the Ginkgo AWS credentials (tests.yamlnow sets them forbigquerytoo). Passed locally.pr-7361, rudderlabs/rudder-devops#8528) with both options.Related: rudderlabs/rudder-integrations-config#2740 (dashboard config).
🤖 Generated with Claude Code