# Google Cloud temporary access

[Temporary access overview](/docs/concepts/temporary-access) covers target setup, connection methods, and credential handling.

GCP uses [client-encrypted delivery](/docs/concepts/temporary-access#provider-tiers) (tier 2), like
[AWS](/docs/guides/dynamic-aws), against
Google's IAM Service Account Credentials API. You register one **impersonable
service account** as a target. seekrit impersonates it with a base
**service-account key** (the wrapped admin secret) for a *source* service account
that holds `roles/iam.serviceAccountTokenCreator` on the target. What the leased
token can *do* lives entirely in GCP IAM: the target service account's roles
define its permissions, narrowed per lease by the OAuth `scopes` you grant.

Minting works like this:

1. The machine that will use the credential generates an **ephemeral P-256
   keypair locally** and sends seekrit **only the public key**, plus a TTL.
2. The broker signs a JWT with the source key, exchanges it for the source
   account's access token, and calls `generateAccessToken` to impersonate the
   target account — all with the admin key decrypted transiently in the DO.
3. The broker **wraps the returned OAuth token to your public key** (the same
   `wd1.` envelope used for DEK grants) and returns only the ciphertext.
4. Your machine unwraps it with the private key it never shared:

```
eval "$(seekrit gcp lease prod-deploy --ttl 1h)"
gcloud storage ls
```

The leased token is a standard OAuth 2.0 access token — the `export` lines set
`CLOUDSDK_AUTH_ACCESS_TOKEN` (for `gcloud`) and `GOOGLE_OAUTH_ACCESS_TOKEN` (for
the Google client libraries). As with every other provider, the control plane
only ever relays ciphertext, and only your private key can unwrap it.

> **Note:** **Revocation is by expiry.** Short-lived access tokens can't be revoked
>   individually, so — like SSH certificates and AWS — v1 relies on the short
>   `lifetime` GCP enforces (1 minute to 12 hours; tokens over 1 hour require the
>   `constraints/iam.allowServiceAccountCredentialLifetimeExtension` org policy).
>   Revoking a lease records the event in the ledger and audit trail, but an issued
>   token stays valid until it expires. Hosted execution and registered customer
>   provisioners both support GCP.

See the [CLI reference](/docs/reference/cli) and [API reference](/docs/reference/api) for commands and endpoints.
