feat: migrate Docker workflows to Workload Identity Federation#7650
feat: migrate Docker workflows to Workload Identity Federation#7650paulbalaji wants to merge 15 commits intomainfrom
Conversation
- Add Dockerfile for standalone ccip-server image - Add GitHub Actions workflow to build and push to GCR - Update helm chart to support both standalone and monorepo images - Add `image.standalone` flag to switch between images - Document image options in values.yaml Note: Uses tsc build (not ncc) due to Prisma native binaries which don't bundle well with ncc. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The starknet-core package's fetch-contracts-release.sh script requires jq. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The ccip-server Docker build depends on provider-sdk via radix-sdk, so changes to provider-sdk should trigger a rebuild. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The SDK imports from @hyperlane-xyz/deploy-sdk which was missing. Also added deploy-sdk to workflow triggers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove conditional standalone flag (match rebalancer pattern) - Update image repository to hyperlane-offchain-lookup-server - Simplify deployment.yaml by removing command/args (use Dockerfile CMD) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Prisma 6 requires a url in the datasource block. Add dummy DATABASE_URL env var during build time for schema validation. Actual URL is provided at runtime. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace stored GCLOUD_SERVICE_KEY with OIDC-based authentication using Google Cloud Workload Identity Federation. This eliminates long-lived service account keys in favor of short-lived tokens generated on-demand. Changes: - Update monorepo-docker.yml to use WIF - Update rust-docker.yml to use WIF - Update simapp-docker.yml to use WIF - Update ccip-server-docker.yml to use WIF The workflows now use: - google-github-actions/auth@v2 for OIDC authentication - google-github-actions/setup-gcloud@v2 for Cloud SDK - gcloud auth configure-docker for Docker registry auth Required GitHub repository variables: - GCP_WORKLOAD_IDENTITY_PROVIDER: The full WIF provider path - GCP_SERVICE_ACCOUNT: The service account email 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
Summary
Replace stored
GCLOUD_SERVICE_KEYwith OIDC-based authentication using Google Cloud Workload Identity Federation. This eliminates long-lived service account keys in favor of short-lived tokens generated on-demand.Changes
monorepo-docker.ymlto use WIFrust-docker.ymlto use WIFsimapp-docker.ymlto use WIFccip-server-docker.ymlto use WIFBenefits
GitHub Repository Variables Required
After GCP setup is complete, add these repository variables (Settings → Secrets and variables → Actions → Variables):
GCP_WORKLOAD_IDENTITY_PROVIDERprojects/116541836866/locations/global/workloadIdentityPools/github-actions/providers/githubGCP_SERVICE_ACCOUNTgithub-actions-gcr@abacus-labs-dev.iam.gserviceaccount.comGCP Setup Instructions
See setup gist for complete GCP configuration instructions for the security engineer.
Stacked on #7565
🤖 Generated with Claude Code
Greptile Summary
This PR migrates Docker workflows from long-lived service account keys to OIDC-based Workload Identity Federation (WIF) for Google Cloud authentication. All four Docker workflows (
monorepo-docker.yml,rust-docker.yml,simapp-docker.yml, and the newccip-server-docker.yml) now use short-lived tokens generated on-demand viagoogle-github-actions/auth@v2.Key changes:
docker/login-actionwithgoogle-github-actions/auth@v2+gcloud auth configure-dockerGCLOUD_SERVICE_KEYsecret toGCP_WORKLOAD_IDENTITY_PROVIDERandGCP_SERVICE_ACCOUNTvariablesid-token: writepermission to all workflows (required for OIDC token generation)check-envjob to gracefully skip builds when WIF not configuredSecurity improvements:
Dependencies:
This PR depends on GCP infrastructure setup (workload identity pool + service account bindings) and requires repository variables
GCP_WORKLOAD_IDENTITY_PROVIDERandGCP_SERVICE_ACCOUNTto be configured before workflows will execute.Confidence Score: 5/5
check-envjob provides graceful degradation if variables aren't configured. No breaking changes to existing functionality - workflows simply won't run until variables are set.Important Files Changed
id-token: write) and fallback behavior when WIF not configureddocker/login-actionwithgoogle-github-actions/auth@v2for WIF, removedGCLOUD_SERVICE_KEYsecret dependencySequence Diagram
sequenceDiagram participant GHA as GitHub Actions participant OIDC as GitHub OIDC Provider participant WIF as GCP Workload Identity Pool participant SA as Service Account participant GCR as Google Container Registry participant Depot as Depot Build Note over GHA: Workflow Triggered (push/PR/tag) GHA->>GHA: check-env job validates<br/>GCP_WORKLOAD_IDENTITY_PROVIDER<br/>& GCP_SERVICE_ACCOUNT vars alt WIF not configured GHA->>GHA: Skip build-and-push job else WIF configured GHA->>GHA: Generate GitHub App token<br/>(for PR comments) GHA->>GHA: Checkout code with submodules Note over GHA,SA: WIF Authentication Flow GHA->>OIDC: Request OIDC token<br/>(id-token: write permission) OIDC-->>GHA: Return JWT token GHA->>WIF: Exchange JWT for GCP token<br/>(google-github-actions/auth@v2) WIF->>WIF: Validate token claims<br/>(repo, branch, environment) WIF->>SA: Impersonate service account SA-->>WIF: Generate short-lived credentials WIF-->>GHA: Return GCP access token GHA->>GHA: Setup gcloud SDK GHA->>GHA: Configure Docker auth<br/>(gcloud auth configure-docker) Note over GHA,Depot: Build & Push GHA->>Depot: depot/build-push-action<br/>(multi-platform build) Depot->>Depot: Build Docker image Depot->>GCR: Push image with tags<br/>(branch/PR/SHA-timestamp) GCR-->>Depot: Push complete Depot-->>GHA: Build complete alt Pull Request Event GHA->>GHA: Check for relevant changes alt Has Changes GHA->>GHA: Comment image tags on PR<br/>(via GitHub App token) end end end