feat: switch GCP auth to direct WIF - #856
Conversation
|
fullsend review is working on this — view logs |
Site previewPreview: https://a08a3763-site.fullsend-ai.workers.dev Commit: |
|
fullsend review is working on this — view logs |
Review: automated reviewOutcome: failure The review agent reviewed commit Previous runReview: #856Head SHA: 128e3a1 SummaryThis PR is a well-executed security improvement that eliminates SA key auth, tightens WIF scope to the FindingsMedium
Low
Info
FooterOutcome: comment-only Previous run (2)Review: #856Head SHA: 89dadb4 SummaryThis PR switches GCP authentication from SA-based WIF to direct WIF, tightens the WIF scope from org-wide to repo-scoped ( Code quality is good overall: the IAM helper refactoring is clean, backward compatibility for FindingsHigh
Medium
Low
FooterOutcome: request-changes Previous run (3)Review: #856Head SHA: 6003347 SummaryThe change is well-structured and achieves its stated goal: switching from SA-impersonation WIF to direct WIF with repo-scoped access. The scope reduction from FindingsMedium
Low
FooterOutcome: comment-only Previous run (4)Review: #856Head SHA: 89dadb4 SummaryThis PR eliminates the intermediate service account from the WIF auth flow, switching to direct Workload Identity Federation where the WIF principalSet receives FindingsMedium / Low / Info
FooterOutcome: approve Previous run (5)Review: #856Head SHA: 4e4ca0f SummaryThis PR tightens GCP authentication by switching from SA-based WIF (with an intermediate service account) to direct WIF, scoping access to each org's FindingsCriticalNone. HighNone. MediumNone. Low
Info
FooterOutcome: approve |
|
fullsend review is working on this — view logs |
|
fullsend review is working on this — view logs |
|
fullsend review is working on this — view logs |
|
fullsend review is working on this — view logs |
|
fullsend fix is working on this — view logs |
🔧 Fix agent — iteration 1 (bot-triggered)Addressed all 3 review findings: (1) preserved quota_project_id in sandbox credentials jq filter, (2) added serviceUsageConsumer role grant in provisioner and install docs, (3) fixed indentation. All tests pass. Fixed (3):
Tests: passed Decision points
Updated by fullsend fix agent |
…ect WIF - Add quota_project_id to the jq conditional merge in prepare-sandbox-credentials.sh so the field is preserved in sandbox credential files (required for x-goog-user-project header). - Add SetProjectIAMBinding call for roles/serviceusage.serviceUsageConsumer alongside roles/aiplatform.user in provisionSelfManaged, so direct WIF principals can send the x-goog-user-project header without 403. - Add corresponding gcloud command to the installation guide (step 1c). - Fix --mint-project indentation in migration section of installation guide. - Update provisioner tests for the additional IAM binding. Addresses review feedback on #856 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: fullsend-fix <fullsend-code@users.noreply.github.com>
|
fullsend review is working on this — view logs |
|
fullsend review is working on this — view logs |
|
fullsend review is working on this — view logs |
|
fullsend review is working on this — view logs |
Replace SA-based Workload Identity Federation with direct WIF where the WIF pool principalSet gets IAM permissions on GCP resources directly. This eliminates the intermediate service account for Vertex AI access, following the google-github-actions/auth recommended pattern. - Add SetProjectIAMBinding to GCFClient for project-level IAM bindings - Grant roles/aiplatform.user to org principalSets in provisioner - Remove --gcp-wif-sa-email CLI flag and WIFServiceAccount config field - Remove service_account parameter from setup-gcp composite action - Remove gcp_wif_sa_email secret from all 6 workflow files - Make service_account_impersonation_url conditional in sandbox creds - Rename SA from fullsend-dispatch to fullsend-mint Signed-off-by: Wayne Sun <gsun@redhat.com>
…ndbox Direct WIF (no intermediate service account) requires project_id in the google-github-actions/auth call so the runner sets GOOGLE_CLOUD_PROJECT. Inside the OpenShell sandbox this env var is lost, so pass it through gcp-vertex.env to let the Google Auth library skip the CRM projects.get fallback that WIF principals cannot call. Signed-off-by: Wayne Sun <gsun@redhat.com>
Drop gcp_sa_key_json input, SA key provisioning, AuthModeSAKey, GCPClient interface, gcp.go, and extractProjectID. Vertex provider now only handles direct WIF with workload_identity_provider + project_id. Update all test fixtures to use WIF secret names. Signed-off-by: Wayne Sun <gsun@redhat.com>
|
fullsend review is working on this — view logs |
Summary
roles/aiplatform.userdirectly on the GCP project, eliminating the intermediate service account for Vertex AI access. Follows the google-github-actions/auth recommended pattern..fullsendrepo only — attribute condition usesassertion.repository == 'org/.fullsend'instead ofassertion.repository_owner == 'org', and IAM binding usesattribute.repository/{org}/.fullsendprincipalSet. Only the.fullsendconfig repo can authenticate to Vertex AI, not arbitrary repos in the org.parseConditionOrgsis backward-compatible with legacyrepository_ownerconditions.gcp.go(LiveGCPClient),AuthModeSAKey,SecretCredentials,CredentialJSON,GCPClientinterface,--gcp-credentials-file/--gcp-service-accountCLI flags,gcp_sa_key_jsonaction input, andextractProjectID. WIF is now the only GCP auth mode.SetProjectIAMBindingtoGCFClientinterface for project-level IAM bindings via Cloud Resource Manager v1 API, with retry-on-409 for concurrent updates.trySetIAMBinding/trySetIAMBindingWithMethodinto a single method parameterized by get method and body.--gcp-wif-sa-emailCLI flag,WIFServiceAccountconfig field,FULLSEND_GCP_WIF_SA_EMAILsecret, andservice_accountparameter from the setup-gcp composite action.fullsend-dispatchtofullsend-mint(now purely the mint Cloud Function runtime identity).service_account_impersonation_urlconditional in sandbox credentials script — direct WIF credentials don't have this field, so omit it rather than writing a null value.GOOGLE_CLOUD_PROJECTinto sandbox viagcp-vertex.envandproject_idto the auth action across all stage workflows.FULLSEND_GCP_SA_KEY_JSONfrom secret table, simplify WIF-only language).IAM requirements for direct WIF
Direct WIF principals need one role on the GCP project:
roles/aiplatform.user— Vertex AI model accessChanged files (33)
internal/dispatch/gcf/gcp.go,gcp_test.gointernal/dispatch/gcf/provisioner.go,provisioner_test.gointernal/inference/vertex/vertex.go,vertex_test.gointernal/inference/vertex/gcp.go(deleted)internal/cli/admin.go,admin_test.goe2e/admin/admin_test.go.github/actions/setup-gcp/action.ymlscripts/prepare-sandbox-credentials.shinternal/scaffold/scaffold_test.gointernal/layers/inference_test.godocs/guides/admin/installation.md, ADR-0014 SPEC.mdTest plan
go test ./...— all 18 packages passgo vet ./...— cleango build -tags e2e ./e2e/admin/— compilesSetProjectIAMBinding: success, already-bound (idempotent), 409 retry, error pathsassertion.repositorywith.fullsendsuffixrepository_ownerconditions (merge test)Containsfor WIF inputs/params,NotContainsfor removed SA key fieldsFULLSEND_GCP_WIF_PROVIDERsecret namesE2E_HALFSEND_WIF_PROVIDERreplacesE2E_HALFSEND_VERTEX_KEY,extractProjectIDremoved