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
| Endpoint | Returns | Authentication |
|---|---|---|
GET <issuer>/.well-known/openid-configuration | The discovery document: issuer, key set URL, signing algorithm and claims | None, cached for 1 hour |
GET <issuer>/.well-known/jwks.json | The public keys: the signing key, the next key during a rotation, and replaced keys until their tokens expire | None, cached for 5 minutes |
GET /api/v1/workload-identity | The issuer, key set URL, pipeline subject form and the published keys with their state | ingestion:manage |
POST /api/v1/workload-identity/keys/rotate | Rotates the signing key | users:manage |
POST /api/v1/ingestion/identity | The issuer, key set URL, subject and audience for a pipeline's settings, before it is saved | ingestion: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
| Claim | Value |
|---|---|
iss | The issuer |
sub | The subject, see Subjects |
aud | The audience, a single string |
iat, nbf | When the token was minted |
exp | 5 minutes after iat |
jti | A unique id, recorded with every mint |
marmot.io/kind | pipeline, secretStore or serviceAccount |
marmot.io/pipeline, marmot.io/pipeline_id | The pipeline's name and id |
marmot.io/secret_store, marmot.io/secret_store_id, marmot.io/secret_store_type | The secret store's name, id and backend |
marmot.io/service_account, marmot.io/service_account_id | The service account's name and id |
marmot.io/operation | What 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
| Subject | Names |
|---|---|
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:
| System | Audience |
|---|---|
| AWS | sts.amazonaws.com |
| Google Cloud | https://iam.googleapis.com/<provider>, or the //iam.googleapis.com/ form when the pipeline uses it |
| Azure | api://AzureADTokenExchange, or a sovereign cloud's own |
| Amazon RDS, Cloud SQL and Azure databases | The cloud's own, as for AWS, Google Cloud and Azure |
| Grafana, Kubernetes, Databricks and other systems the token is sent to or swapped at | The 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
| Plugins | System | How the token is used | Settings |
|---|---|---|---|
| Athena, DynamoDB, EKS, Firehose, Glue, Glue pipelines, Iceberg (Glue catalog), Kinesis, Lambda, S3, SageMaker, SNS, SQS | AWS | Swapped at AWS STS for an IAM role's credentials | credentials.role_arn, credentials.region |
| BigQuery, Bigtable, Cloud Run, Firebase, Cloud Storage, GKE, Google Drive, Pub/Sub, Vertex AI | Google Cloud | Swapped at Google's token service through a workload identity provider | workload_identity_provider, optional service_account, inside credentials for Bigtable, GKE and Google Drive |
| Azure Blob Storage | Azure | Presented to Entra ID as a federated credential | tenant_id, client_id |
| PostgreSQL, MySQL, MariaDB | Amazon RDS, Aurora | Swapped for an IAM role's credentials, which make an RDS authentication token as the password | aws.role_arn, aws.region |
| PostgreSQL, MySQL | Cloud SQL | Swapped for a service account's access token, used as the password | gcp.workload_identity_provider, gcp.service_account |
| PostgreSQL, Microsoft SQL Server | Azure Database for PostgreSQL, Azure SQL | Presented to Entra ID, whose token signs in to the database | azure.tenant_id, azure.client_id |
| Unity Catalog | Databricks | Swapped at the workspace's /oidc/v1/token for a Databricks token | host, optional client_id |
| Grafana | Grafana | Sent as a bearer token on each request | host |
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
| What | How long |
|---|---|
| A token | 5 minutes |
| Refresh while a call runs | Every 2 minutes |
| A new key, published before it signs | 24 hours by default, set per rotation |
| A replaced key, published after the new one signs | 6 minutes, until its last token expires |
| A rotation made on one replica, reaching the others | Up to 1 minute |
Settings
These apply to a server you run. On Marmot Cloud they are set for you.
| Setting | Environment variable | Default | What it does |
|---|---|---|---|
workload_identity.issuer | MARMOT_WORKLOAD_IDENTITY_ISSUER | server.root_url | The issuer. An https origin, or http on localhost only |
workload_identity.pipeline_subject | MARMOT_WORKLOAD_IDENTITY_PIPELINE_SUBJECT | name | name or id, the subject form for pipelines |
workload_identity.allow_unencrypted_key | MARMOT_WORKLOAD_IDENTITY_ALLOW_UNENCRYPTED_KEY | false | Keeps the signing keys unencrypted without server.encryption_key, for local development only |
server.encryption_key | MARMOT_SERVER_ENCRYPTION_KEY | None | Encrypts the signing keys. Without it there is no issuer |
Errors
| Error | Meaning |
|---|---|
this source signs in with Marmot's identity, but this server has no workload identity issuer | The 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 for | The 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 to | The 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 names | The 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 several | A database pipeline fills in more than one of aws, gcp and azure |
Cloud SQL signs in a service account, so name the one to impersonate | Set gcp.service_account |
signing in with Marmot's identity needs no password; remove it | A database pipeline has a password as well as a cloud's identity |
Name the pipeline first: it signs in as Marmot under that name | A 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 first | A new pipeline has no id yet; save it, then test |