Skip to main content
Version: Preview

Workload identity reference

Everything a system trusting Marmot's tokens can check, and every setting that changes them. For how it fits together, see Workload identity.

Endpoints​

EndpointReturnsAuthentication
GET <issuer>/.well-known/openid-configurationThe discovery document: issuer, key set URL, signing algorithm and claimsNone, cached for 1 hour
GET <issuer>/.well-known/jwks.jsonThe public keys: the signing key, the next key during a rotation, and replaced keys until their tokens expireNone, cached for 5 minutes
GET /api/v1/workload-identityThe issuer, key set URL, pipeline subject form and the published keys with their stateingestion:manage
POST /api/v1/workload-identity/keys/rotateRotates the signing keyusers:manage
POST /api/v1/ingestion/identityThe issuer, key set URL, subject and audience for a pipeline's settings, before it is savedingestion:manage

Every pipeline the API returns also carries an identity with its issuer, key set URL, subject and, for a source that signs in with Marmot's identity, audience.

Claims​

ClaimValue
issThe issuer
subThe subject, see Subjects
audThe audience, a single string
iat, nbfWhen the token was minted
exp5 minutes after iat
jtiA unique id, recorded with every mint
marmot.io/kindpipeline, secretStore or serviceAccount
marmot.io/pipeline, marmot.io/pipeline_idThe pipeline's name and id
marmot.io/secret_store, marmot.io/secret_store_id, marmot.io/secret_store_typeThe secret store's name, id and backend
marmot.io/service_account, marmot.io/service_account_idThe service account's name and id
marmot.io/operationWhat the token is for: discover, test, query, tool or get

Every marmot.io/ claim is present in every token, empty when it doesn't apply, because a Google Cloud attribute mapping that reads a missing claim fails the exchange. Tokens are signed with RS256, and the kid header names the key.

Subjects​

SubjectNames
pipeline:<pipeline-name>A pipeline, on a server that names pipelines by name (the default)
pipeline-id:<pipeline-id>A pipeline, on a server that names pipelines by id
secretStore:<store-name>A secret store reading a secret
serviceAccount:<account-name>A service account that asked for a token

The kind prefix keeps a grant on one kind from matching another of the same name.

Audiences​

Marmot derives the audience from how the plugin's system takes the token, never from the pipeline's settings:

SystemAudience
AWSsts.amazonaws.com
Google Cloudhttps://iam.googleapis.com/<provider>, or the //iam.googleapis.com/ form when the pipeline uses it
Azureapi://AzureADTokenExchange, or a sovereign cloud's own
Amazon RDS, Cloud SQL and Azure databasesThe cloud's own, as for AWS, Google Cloud and Azure
Grafana, Kubernetes, Databricks and other systems the token is sent to or swapped atThe scheme, host and port of the address the pipeline connects to, such as https://grafana.example.com

A plugin that declares no sign-in method gets a token only for a cloud's audience.

Sources that sign in with Marmot's identity​

PluginsSystemHow the token is usedSettings
Athena, DynamoDB, EKS, Firehose, Glue, Glue pipelines, Iceberg (Glue catalog), Kinesis, Lambda, S3, SageMaker, SNS, SQSAWSSwapped at AWS STS for an IAM role's credentialscredentials.role_arn, credentials.region
BigQuery, Bigtable, Cloud Run, Firebase, Cloud Storage, GKE, Google Drive, Pub/Sub, Vertex AIGoogle CloudSwapped at Google's token service through a workload identity providerworkload_identity_provider, optional service_account, inside credentials for Bigtable, GKE and Google Drive
Azure Blob StorageAzurePresented to Entra ID as a federated credentialtenant_id, client_id
PostgreSQL, MySQL, MariaDBAmazon RDS, AuroraSwapped for an IAM role's credentials, which make an RDS authentication token as the passwordaws.role_arn, aws.region
PostgreSQL, MySQLCloud SQLSwapped for a service account's access token, used as the passwordgcp.workload_identity_provider, gcp.service_account
PostgreSQL, Microsoft SQL ServerAzure Database for PostgreSQL, Azure SQLPresented to Entra ID, whose token signs in to the databaseazure.tenant_id, azure.client_id
Unity CatalogDatabricksSwapped at the workspace's /oidc/v1/token for a Databricks tokenhost, optional client_id
GrafanaGrafanaSent as a bearer token on each requesthost

A database password made from a cloud's credentials is only sent over TLS, so PostgreSQL's ssl_mode disable becomes require, and MySQL's and MariaDB's tls false or preferred becomes skip-verify.

Lifetimes​

WhatHow long
A token5 minutes
Refresh while a call runsEvery 2 minutes
A new key, published before it signs24 hours by default, set per rotation
A replaced key, published after the new one signs6 minutes, until its last token expires
A rotation made on one replica, reaching the othersUp to 1 minute

Settings​

These apply to a server you run. On Marmot Cloud they are set for you.

SettingEnvironment variableDefaultWhat it does
workload_identity.issuerMARMOT_WORKLOAD_IDENTITY_ISSUERserver.root_urlThe issuer. An https origin, or http on localhost only
workload_identity.pipeline_subjectMARMOT_WORKLOAD_IDENTITY_PIPELINE_SUBJECTnamename or id, the subject form for pipelines
workload_identity.allow_unencrypted_keyMARMOT_WORKLOAD_IDENTITY_ALLOW_UNENCRYPTED_KEYfalseKeeps the signing keys unencrypted without server.encryption_key, for local development only
server.encryption_keyMARMOT_SERVER_ENCRYPTION_KEYNoneEncrypts the signing keys. Without it there is no issuer

Errors​

ErrorMeaning
this source signs in with Marmot's identity, but this server has no workload identity issuerThe server has no issuer: set server.root_url to its https address and server.encryption_key
this audience is not one Marmot mints identity tokens forThe plugin declares no sign-in method with Marmot's identity, and the pipeline asked for an audience no cloud expects
signing in with Marmot's identity needs the address the token is sent toThe setting the plugin sends the token to is empty or not an http or https URL
marmot's identity token is only sent to the server its audience namesThe plugin tried to send the token, or swap it, somewhere other than the address its audience was derived from, such as after a redirect
sign in with one cloud's identity, not severalA database pipeline fills in more than one of aws, gcp and azure
Cloud SQL signs in a service account, so name the one to impersonateSet gcp.service_account
signing in with Marmot's identity needs no password; remove itA database pipeline has a password as well as a cloud's identity
Name the pipeline first: it signs in as Marmot under that nameA connection test of a new pipeline needs its name, which is its subject
this server names pipelines by id in identity tokens, so save the pipeline firstA new pipeline has no id yet; save it, then test