Skip to content

fix: Use IAM Sign Blob API for GCS signed URLs on GKE with Workload Identity#195

Draft
morgan-wowk wants to merge 1 commit intomasterfrom
fix/artifact-signed-url-workload-identity-signing
Draft

fix: Use IAM Sign Blob API for GCS signed URLs on GKE with Workload Identity#195
morgan-wowk wants to merge 1 commit intomasterfrom
fix/artifact-signed-url-workload-identity-signing

Conversation

@morgan-wowk
Copy link
Copy Markdown
Collaborator

@morgan-wowk morgan-wowk commented Apr 2, 2026

The signed URL implementation was broken on GKE because Workload Identity credentials (compute_engine.Credentials) are token-based and have no private key, so generate_signed_url() would fail with "you need a private key to sign credentials".

Fix this by using the IAM Sign Blob API via google.auth.iam.Signer, which lets the service account sign on its own behalf without a JSON key file. This avoids credential leak risk and maintenance overhead of rotating SA keys.

Requires iam.serviceAccounts.signBlob to be granted to the service account on itself — see the paired terraform-the-cloud change which adds a minimal org-scoped custom role containing only that permission.

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown
Collaborator

camielvs commented Apr 2, 2026

noreply@anthropic.com

top-notch

@morgan-wowk morgan-wowk force-pushed the fix/artifact-signed-url-workload-identity-signing branch from 7d4412c to cc4d02b Compare April 2, 2026 23:06
@morgan-wowk morgan-wowk changed the title fix: Use IAM Sign Blob for artifact signed URLs on GKE Workload Identity fix: Use IAM Sign Blob API for GCS signed URLs on GKE with Workload Identity Apr 2, 2026
The signed URL implementation was broken on GKE because Workload Identity
credentials (compute_engine.Credentials) are token-based and have no private
key, so generate_signed_url() would fail with "you need a private key to
sign credentials".

Fix this by using the IAM Sign Blob API via google.auth.iam.Signer, which
lets the service account sign on its own behalf without a JSON key file. This
avoids credential leak risk and maintenance overhead of rotating SA keys.

Requires roles/iam.serviceAccountTokenCreator to be granted to the
oasis-backend SA on itself — see the paired terraform-the-cloud change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@morgan-wowk morgan-wowk force-pushed the fix/artifact-signed-url-workload-identity-signing branch from cc4d02b to e7afe64 Compare April 3, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants