Access AWS, Google Cloud, and JFrog Without Static Credentials
For the complete documentation index, see llms.txt. For a full content snapshot, see llms-full.txt. Append.mdto anykestra.io/docs/*URL for plain Markdown.
Available on: Enterprise Edition
Kestra Enterprise can act as an OpenID Connect (OIDC) identity provider, so your flows get temporary AWS, Google Cloud, and JFrog credentials without any access key or service account key stored in Kestra.
This matters most when Kestra runs outside the cloud it needs to reach, for example on-premises or on another cloud provider. There is no instance role or workload identity to fall back on, so the usual alternative is a long-lived access key stored as a secret. When Kestra already runs on AWS or Google Cloud, the worker’s own identity gives keyless access too, and the issuer adds a separate identity per tenant, namespace, or flow.
The issuer identifies tenants, namespaces, and flows to other services. It doesn’t sign users in to Kestra: for that, see Single Sign-On.
The OIDC issuer isn’t available on Kestra Cloud yet. If you’d like to use it, contact your Kestra account team.
How it works
A task calls the oidcToken() function, and Kestra signs a short-lived JSON Web Token (JWT) that identifies the running execution. The task’s plugin sends that token to the cloud provider, which checks the signature against the public keys Kestra publishes and returns temporary credentials for a role or service account you have configured to trust Kestra. This is the same model GitHub Actions uses to reach AWS and Google Cloud.
The cloud provider trusts a token based on its subject, which Kestra builds from the execution and never from the flow’s code:
tenant:<tenant>:namespace:<namespace>:flow:<flow>The segments go from broad to narrow, so a trust policy can match one flow, or every flow in a namespace with a wildcard such as tenant:prod:namespace:team.data:*.
Prerequisites
The issuer URL must be reachable from the public internet over HTTPS, with a certificate the service trusts. AWS, Google Cloud, and other services download the discovery document and the public keys from that URL, without credentials, to verify each token. An instance that is only reachable on a private network can’t use the issuer.
- An RSA private key in PEM format (PKCS#8 or PKCS#1) for each issuer you declare. For example, generate a 2048-bit key with
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out kestra-oidc.pem. Anyone who holds the key can create tokens that your cloud accounts trust, so store it like a secret and pass it to Kestra through an environment variable or your secret manager, never in a committed file. - For remote workers, worker authentication enabled on the controller and the workers.
Configure the issuer
Enable the issuer and give it a signing key in the Kestra configuration. This example reads the key from the OIDC_KEY_INSTANCE environment variable:
kestra: url: https://kestra.acme.com security: oidc: issuer: enabled: true allowed-audiences: - sts.amazonaws.com keys: - kid: 2026-11 active: true private-key: ${OIDC_KEY_INSTANCE}Kestra checks the configuration at startup and doesn’t start if there is no key, no active key or more than one, a duplicate kid, a malformed key, or a URL that isn’t HTTPS. The error names the property at fault, for example kestra.security.oidc.issuer.issuers[1].keys. The issuer runs on the controller, webserver, and standalone servers only, so you don’t need to give the private key to your workers. Workers request their tokens from the controller.
Once Kestra restarts, it serves two public documents that the cloud provider reads, with no authentication:
| Path | Content |
|---|---|
/.well-known/openid-configuration | The discovery document: the issuer URL and the location of the public keys. |
/oidc/jwks.json | The public keys (JWKS) of every configured key. |
Check that the issuer is up by opening https://kestra.acme.com/.well-known/openid-configuration. The issuer value is the URL that you register with the cloud provider.
The issuer accepts the following properties under kestra.security.oidc.issuer:
| Property | Default | Description |
|---|---|---|
enabled | false | Turn on the issuer. Applies to every issuer. |
url | kestra.url | The issuer URL, used as the iss claim of the instance issuer’s tokens. Dedicated issuer URLs are built from it. |
allow-insecure-url | false | Allow an http URL. Use it for local testing only, since AWS and Google Cloud require HTTPS. Applies to every issuer. |
token-ttl | PT5M | Lifetime of a token. A token only has to last until the cloud provider exchanges it, so keep it short. Kestra logs a warning above 15 minutes. |
cache-max-age | PT10M | How long the cloud provider may cache the discovery document and the public keys. Applies to every issuer. |
allowed-audiences | Any | The audiences tokens may be issued for. oidcToken() fails for any other audience. |
keys | The signing keys, each with an optional kid, active, and private-key. Exactly one key is active. Without kid, Kestra uses the key’s RFC 7638 thumbprint. | |
issuers | Dedicated issuers for a tenant or a namespace. |
Use the token in a flow
The oidcToken() function returns a token for the running execution. Its required audience argument names the service the token is for, and becomes the token’s aud claim:
{{ oidcToken(audience='sts.amazonaws.com') }}{{ oidcToken(audience='//iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/kestra/providers/kestra') }}Kestra masks the token in execution logs, the same way it masks secrets. Pass it to the task’s identity property rather than storing it: the AWS and Google Cloud plugins render the expression again each time they refresh their credentials, so a task that runs longer than the token’s lifetime keeps working.
Each token carries these claims:
| Claim | Value |
|---|---|
iss | The issuer URL. |
sub | tenant:<tenant>:namespace:<namespace>:flow:<flow> |
aud | The audience argument. |
iat, nbf, exp | Issued at, not before, and expiry. exp is token-ttl after iat. |
jti | A unique token ID. |
tenant, namespace, flow, execution_id | The execution’s identity, as separate claims for providers that map claims to attributes. |
task_id | The task that requested the token. |
Connect AWS
AWS exchanges the token for a role’s temporary credentials through sts:AssumeRoleWithWebIdentity.
-
Register Kestra as an OIDC identity provider in AWS IAM, with
sts.amazonaws.comas the audience:aws iam create-open-id-connect-provider \--url https://kestra.acme.com \--client-id-list sts.amazonaws.com -
Create an IAM role whose trust policy allows that provider to assume it, with conditions on the token’s audience and subject. This policy lets every flow in the
team.datanamespace of theprodtenant assume the role:{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Principal": {"Federated": "arn:aws:iam::123456789012:oidc-provider/kestra.acme.com"},"Action": "sts:AssumeRoleWithWebIdentity","Condition": {"StringEquals": {"kestra.acme.com:aud": "sts.amazonaws.com"},"StringLike": {"kestra.acme.com:sub": "tenant:prod:namespace:team.data:*"}}}]}Use
StringEqualswith a full subject to allow a single flow. -
In the flow, set
stsRoleArnto the role andwebIdentityTokento a token fromoidcToken():id: list_bucketnamespace: team.datatasks:- id: listtype: io.kestra.plugin.aws.s3.Listregion: eu-west-1bucket: my-bucketstsRoleArn: arn:aws:iam::123456789012:role/kestra-team-datawebIdentityToken: "{{ oidcToken(audience='sts.amazonaws.com') }}"
The task needs no accessKeyId or secretKeyId. The role session lasts stsRoleSessionDuration. If webIdentityToken is set without stsRoleArn, the task fails instead of falling back to the worker’s own AWS identity.
webIdentityToken is available on the tasks of the AWS plugin. The AWS Batch task runner doesn’t support it yet.
To avoid repeating the role and the token on every task, put them in a reference policy and list it in each task’s policyRefs. Create one policy per role:
id: aws-team-datadescription: "Assume the kestra-team-data role with a Kestra OIDC token."enforcement: REFERENCErules: - type: io.kestra.plugin.ee.rules.Add on: PLUGIN where: - field: type operator: STARTS_WITH value: io.kestra.plugin.aws values: stsRoleArn: arn:aws:iam::123456789012:role/kestra-team-data webIdentityToken: "{{ oidcToken(audience='sts.amazonaws.com') }}"The task then only names the policy:
id: list_bucketnamespace: team.data
tasks: - id: list type: io.kestra.plugin.aws.s3.List region: eu-west-1 bucket: my-bucket policyRefs: - aws-team-dataKestra renders the injected oidcToken() expression at runtime, the same way as one written in the flow. The same approach works for the Google Cloud properties below.
Connect Google Cloud
Google Cloud exchanges the token through Workload Identity Federation. A flow then acts as a service account that the workload identity pool can impersonate.
-
Create a workload identity pool and an OIDC provider that trusts Kestra. Map
google.subjectfrom the token’ssub, and map the claims you want to write conditions on, such asnamespace:gcloud iam workload-identity-pools create kestra \--location=globalgcloud iam workload-identity-pools providers create-oidc kestra \--location=global \--workload-identity-pool=kestra \--issuer-uri=https://kestra.acme.com \--attribute-mapping="google.subject=assertion.sub,attribute.namespace=assertion.namespace" -
Let identities from the pool impersonate a service account. This binding allows every flow in the
team.datanamespace:gcloud iam service-accounts add-iam-policy-binding kestra-team-data@my-project.iam.gserviceaccount.com \--role=roles/iam.workloadIdentityUser \--member="principalSet://iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/kestra/attribute.namespace/team.data" -
In the flow, set
workloadIdentityAudienceto the provider’s full resource name, pass the same value as the token’s audience, and set the service account to impersonate:id: list_bucketnamespace: team.datatasks:- id: listtype: io.kestra.plugin.gcp.gcs.ListprojectId: my-projectfrom: gs://my-bucket/workloadIdentityAudience: "//iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/kestra/providers/kestra"workloadIdentityToken: "{{ oidcToken(audience='//iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/kestra/providers/kestra') }}"impersonatedServiceAccount: kestra-team-data@my-project.iam.gserviceaccount.com
Set projectId explicitly: without a service account key, the task has nothing to read the project from. workloadIdentityToken requires workloadIdentityAudience and can’t be combined with serviceAccount. If you set allowed-audiences on the issuer, add the provider’s resource name to it.
Connect JFrog
The JFrog Platform exchanges the token for a short-lived JFrog access token through its OIDC integration. Any service that accepts tokens from a generic OIDC provider works the same way: register the issuer URL, then exchange the token in your flow.
-
In the JFrog Platform, go to Administration > General Management > Manage Integrations, open the OpenID Connect tab, and click New Integration to add an integration:
- Provider Name:
kestra. The flow sends this name with each exchange. - Provider Type: Generic OpenID Connect.
- Provider URL: the issuer URL, for example
https://kestra.acme.com. - Audience:
jfrog. The flow passes the same value tooidcToken().
Each issuer needs its own integration. To trust a dedicated issuer, use its URL as the provider URL, for example
https://kestra.acme.com/oidc/tenants/prod. - Provider Name:
-
Add an identity mapping to the integration. Its claims decide which tokens it accepts, and its token scope decides what the resulting access token can do. This mapping accepts every flow in the
team.datanamespace of theprodtenant:{"sub": "tenant:prod:namespace:team.data:*"}Always set claims: without them, any token from the issuer gets the mapping’s scope. For the token scope, pick a group that can read the repositories the flow needs, and keep the expiration short, for example 10 minutes.
To script this step and the previous one, use JFrog’s REST API:
POST /access/api/v1/oidccreates the integration, andPOST /access/api/v1/oidc/<provider-name>/identity_mappingsadds the mapping. -
In the flow, exchange the token and use the access token within the same task, so it never appears in the execution’s outputs:
id: download_artifactnamespace: team.datatasks:- id: downloadtype: io.kestra.plugin.scripts.shell.CommandstaskRunner:type: io.kestra.plugin.core.runner.Processenv:OIDC_TOKEN: "{{ oidcToken(audience='jfrog') }}"outputFiles:- app.tar.gzcommands:- |ACCESS_TOKEN=$(curl -sf -X POST https://acme.jfrog.io/access/api/v1/oidc/token \-H "Content-Type: application/json" \-d "{\"grant_type\": \"urn:ietf:params:oauth:grant-type:token-exchange\", \"subject_token_type\": \"urn:ietf:params:oauth:token-type:id_token\", \"subject_token\": \"$OIDC_TOKEN\", \"provider_name\": \"kestra\"}" \| jq -r .access_token)curl -sf -H "Authorization: Bearer $ACCESS_TOKEN" -o app.tar.gz \https://acme.jfrog.io/artifactory/releases/app/1.0/app.tar.gzThis example runs on the worker with the
Processtask runner, so the worker needscurlandjq. If you setallowed-audienceson the issuer, addjfrogto it.
Dedicated issuers per tenant or namespace
With a single instance issuer, every token carries the same issuer URL and verifies against the same keys, whatever tenant it comes from. A cloud account that trusts the instance issuer trusts every tenant, and only the subject condition in its trust policy keeps the other tenants out.
A dedicated issuer gives a tenant, or a namespace and its children, its own issuer URL and keys. A cloud account registered on a dedicated issuer can’t verify a token from anywhere else, whatever its subject says. Use one when a cloud account must trust a single tenant or team, or when tenants must not share a signing key.
kestra: url: https://kestra.acme.com security: oidc: issuer: enabled: true issuers: - tenant: prod keys: - kid: prod-2026-11 active: true private-key: ${OIDC_KEY_PROD} - tenant: prod namespace: finance token-ttl: PT3M allowed-audiences: - sts.amazonaws.com keys: - kid: finance-2026-11 active: true private-key: ${OIDC_KEY_FINANCE}Each entry under issuers accepts the following properties:
| Property | Default | Description |
|---|---|---|
tenant | The tenant the issuer signs for. Required. | |
namespace | Every namespace of the tenant | Restrict the issuer to this namespace and its child namespaces. |
url | Built from the instance url | The issuer’s iss. The discovery document and the public keys stay on their default paths, so a custom URL needs a proxy that maps it onto them. |
token-ttl | The instance token-ttl | Lifetime of the issuer’s tokens. |
allowed-audiences | The instance allowed-audiences | Replaces the instance list for this issuer. |
keys | The issuer’s signing keys, with the same rules as the instance keys. A kid only has to be unique within one issuer. |
Two issuers can’t share a scope or an issuer URL: Kestra doesn’t start if they do. A tenant with namespace issuers but no tenant issuer only logs a warning, and its other namespaces use the instance issuer.
Which issuer signs a token
Kestra signs each token with the most specific issuer that covers the execution:
- The issuer of the namespace, or of its closest parent namespace that has one. The
financeissuer coversfinance,finance.ap, andfinance.ap.eu. - Otherwise, the tenant’s issuer.
- Otherwise, the instance issuer, if it has keys.
With the configuration above:
| Execution | Issuer | iss |
|---|---|---|
Tenant prod, namespace finance.ap | Namespace finance | https://kestra.acme.com/oidc/tenants/prod/namespaces/finance |
Tenant prod, namespace sales | Tenant prod | https://kestra.acme.com/oidc/tenants/prod |
Tenant dev, any namespace | Instance | https://kestra.acme.com |
The sub claim is the same whichever issuer signs the token. Flows need no change either: oidcToken() picks the issuer from the execution’s tenant and namespace.
Instance keys are optional when you declare dedicated issuers. Without them, there is no instance issuer: /.well-known/openid-configuration and /oidc/jwks.json return 404, and oidcToken() fails in any namespace that no dedicated issuer covers. Leave them out when only some tenants use the issuer and no key should sign for all of them.
Dedicated issuer URLs
Each dedicated issuer has its own URL and documents:
| Scope | Issuer URL | Public keys |
|---|---|---|
| Tenant | <url>/oidc/tenants/<tenant> | <url>/oidc/tenants/<tenant>/jwks.json |
| Namespace | <url>/oidc/tenants/<tenant>/namespaces/<namespace> | <url>/oidc/tenants/<tenant>/namespaces/<namespace>/jwks.json |
The discovery document is at the issuer URL followed by /.well-known/openid-configuration. A child namespace has no documents of its own, because its tokens carry the parent issuer’s URL. A scope with no dedicated issuer returns 404, whether the tenant exists or not.
Dedicated issuer URLs are built from the instance url, which defaults to kestra.url. Changing it changes the URL of every dedicated issuer and breaks their registrations with cloud providers. Set the issuer’s url when its URL must survive such a change.
Register a dedicated issuer
Register the dedicated issuer’s URL wherever the examples above use https://kestra.acme.com.
On AWS, the provider ARN and the condition keys of the trust policy include the URL’s path:
aws iam create-open-id-connect-provider \ --url https://kestra.acme.com/oidc/tenants/prod \ --client-id-list sts.amazonaws.com{ "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::123456789012:oidc-provider/kestra.acme.com/oidc/tenants/prod" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "kestra.acme.com/oidc/tenants/prod:aud": "sts.amazonaws.com" }, "StringLike": { "kestra.acme.com/oidc/tenants/prod:sub": "tenant:prod:namespace:finance:*" } }}AWS rejects tokens from other tenants before it evaluates any condition, because they carry another issuer URL and another signature. Keep the sub condition anyway: it limits the role to specific namespaces or flows within the tenant.
On Google Cloud, pass the dedicated issuer’s URL to --issuer-uri when you create the pool’s provider. If the issuer sets allowed-audiences, add the provider’s resource name to it.
Rotate signing keys
Kestra publishes every configured key, active or not, and signs only with the active one. Each issuer rotates its keys separately, and only the services registered on that issuer are affected. To rotate a key without breaking token verification:
- Add the new key to the issuer’s
keyswithactive: false, and restart Kestra. Kestra now publishes the new public key alongside the old one. - Wait at least
cache-max-age, so cloud providers pick up the new public key. Then setactive: trueon the new key andactive: falseon the old one, and restart Kestra. - Once every token signed with the old key has expired, after
token-ttl, remove the old key and restart Kestra.
Troubleshooting
| Error | Cause |
|---|---|
The 'oidcToken' function expects an 'audience' argument ... | Pass audience, for example oidcToken(audience='sts.amazonaws.com'). |
The 'oidcToken' function is not available on this server type, or the OIDC issuer is not enabled. | enabled isn’t true on the server that renders the expression. |
The audience '<audience>' is not allowed by 'allowed-audiences' of the OIDC issuer for the <scope>. | Add the audience to allowed-audiences of the issuer that covers the namespace. |
No OIDC issuer covers tenant '<tenant>' namespace '<namespace>' ... | There are no instance keys and no dedicated issuer for this tenant or namespace. |
OIDC tokens are only minted for authenticated workers ... | A remote worker requested a token without worker authentication. Enable it on the controller and its workers. |
webIdentityToken is set but stsRoleArn is empty ... | Set stsRoleArn to the role to assume with the token. |
AWS returns InvalidIdentityToken | The token’s iss differs from the registered provider URL. Check which issuer covers the execution: a namespace issuer takes precedence over the tenant issuer. |
| 404 on a dedicated issuer’s discovery document | No issuer is configured for exactly that scope, for example because you requested a child namespace’s URL. Register the parent namespace’s issuer URL, or add an issuer for that scope. |
404 on /.well-known/openid-configuration | There are no instance keys. This is expected when you only declare dedicated issuers: register a dedicated issuer’s URL instead. |
Was this page helpful?