Skip to content

feat(google): keyless auth via Workload Identity Federation - #346

Closed
sjawhar wants to merge 1 commit into
awslabs:masterfrom
trajectory-labs-pbc:keyless-wif-auth
Closed

feat(google): keyless auth via Workload Identity Federation#346
sjawhar wants to merge 1 commit into
awslabs:masterfrom
trajectory-labs-pbc:keyless-wif-auth

Conversation

@sjawhar

@sjawhar sjawhar commented Jul 16, 2026

Copy link
Copy Markdown

What

Adds a keyless authentication path to internal/google.NewClient: when no service-account key is supplied, it uses Application Default Credentials to impersonate the target service account (google.golang.org/api/impersonate), carrying the Workspace admin in Subject so domain-wide delegation still works.

  • The existing downloaded-key path (google.JWTConfigFromJSON) is unchanged — fully backward compatible.
  • The keyless path activates only when serviceAccountKey is empty and GOOGLE_IMPERSONATE_SERVICE_ACCOUNT names the service account to impersonate.
  • Requested OAuth scopes and the DWD Subject are unchanged.

Why

ssosync currently requires a downloaded SA key, which is a blocker under iam.disableServiceAccountKeyCreation or when running outside GCP. This enables the modern keyless pattern: e.g. an AWS Lambda federated to GCP via Workload Identity Federation, impersonating the sync SA, with no long-lived credential.

Testing

go build / go vet pass. Running in production: an AWS Lambda federated to GCP via WIF, impersonating the Workspace sync service account, syncing groups into IAM Identity Center on a schedule.

Closes #345.

NewClient now branches on whether a service-account key is supplied:
- key present  -> existing JWTConfigFromJSON + Subject (domain-wide delegation)
- key absent   -> ADC (e.g. an AWS Lambda role federated to GCP via Workload
                  Identity Federation) + impersonate.CredentialsTokenSource with
                  Subject, so DWD still applies. Target SA is named by the
                  GOOGLE_IMPERSONATE_SERVICE_ACCOUNT env var.

Lets ssosync run with zero long-lived credentials where org policy forbids
service-account key creation (constraints/iam.disableServiceAccountKeyCreation).
@sjawhar

sjawhar commented Jul 16, 2026

Copy link
Copy Markdown
Author

Superseded by #347. Re-homed onto the branch our build already pins (wif-keyless) so we don't maintain two fork branches for the same one-file patch. Identical change; closing this one.

@sjawhar sjawhar closed this Jul 16, 2026
@legion-implementer
legion-implementer Bot deleted the keyless-wif-auth branch July 16, 2026 21:56
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.

Keyless Google auth via Workload Identity Federation (no downloaded service-account key)

1 participant