GoogleCloudPlatform / GoogleCloudPlatform/cloud-run-proxy

Proposal: Add -impersonate-service-account flag

Open
#52 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
136
Forks
20
PR merge metrics
No merged PRs in 30d

Description

I'm aware this tool is now partially integrated into `gcloud run services proxy`, but I find it useful for accessing IAP-protected services without modifying the application.

## Proposal

Add a new `-impersonate-service-account` flag that uses [google.golang.org/api/impersonate](https://pkg.go.dev/google.golang.org/api/impersonate) to generate ID tokens with the correct audience.

This enables access to IAP-protected services with `gcloud auth application-default login`, without needing service account key files.

## Usage

```bash
cloud-run-proxy \
-host "https://iap-protected-app.example.com" \
-audience "SA_UNIQUE_ID" \
-authorization-header "Authorization" \
-impersonate-service-account "my-sa@my-project.iam.gserviceaccount.com"
```

The user needs `roles/iam.serviceAccountTokenCreator` on the target service account.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.