Workload identity
Marmot signs short-lived tokens for its pipelines, secret stores and service accounts, so a source can sign in without a password or key that someone has to create, store and rotate. The system you sign in to fetches Marmot's public keys from Marmot, and Marmot connects out to that system with a token it checks against them. It works the same on Marmot Cloud and on a server you run, as long as the system can reach Marmot's keys.
Workload identity reference lists every claim, subject, endpoint and setting.
How it works
Each call a pipeline makes carries a token minted for that call:
- You set the system up once to trust Marmot's issuer, and grant the pipeline what it needs there.
- Before each run, connection test, query or tool call, Marmot mints a token that names the pipeline and the system it is for. It lasts 5 minutes, and Marmot replaces it every 2 minutes while the call lasts.
- The plugin presents the token, or swaps it for the system's own short-lived credentials.
- The system checks the token against Marmot's published keys and acts as the pipeline.
What a token says
A token answers three questions, and the system you set up checks all three:
- Who signed it. The issuer is Marmot's address, such as
https://<instance>.marmotdata.cloudorhttps://marmot.example.com. Systems trust that address, so it doesn't change once you rely on it. - Who it is for. The subject names one pipeline, so you grant access to that pipeline, not to Marmot as a whole.
- Where it may be used. The audience names the one system the token is for. A token for one system is refused by every other.
Marmot decides the audience, never the pipeline's settings. For a cloud it's the audience the cloud's token service expects. For a system the token is sent to directly, such as Grafana or a Kubernetes API server, it's that system's own address, so a pipeline pointed at someone else's server never gets a token your server would accept.
Ways a source uses it
A plugin declares how its system takes the token, and the add source form offers Marmot's identity first wherever the plugin declares it:
- Your cloud swaps it for credentials. Google Cloud, AWS and Azure exchange the token at their token service for a short-lived credential bound to the pipeline.
- Your cloud makes a database password with it. On Amazon RDS, Cloud SQL and Azure, the cloud's credentials make a short-lived password for PostgreSQL, MySQL, MariaDB or SQL Server, sent over TLS.
- The system accepts it directly. Grafana and Kubernetes check the token on each request and sign the pipeline in as a user of its own.
- The system swaps it for its own token. Databricks exchanges the token at the workspace for a Databricks token of a service principal, once per run.
- A secret store reads a password with it. For a system that can't take a token, a secret store signs in to your vault with its own token and reads the password before each run.
Choosing Marmot's identity shows the values the system needs (issuer, key set URL, subject and audience) and the plugin's own setup steps with them filled in, before you save the pipeline.
Names or ids
A pipeline's subject is pipeline:<pipeline-name> by default. Names read well in a grant, but a renamed pipeline loses what was granted to its old name, and a new pipeline given a deleted pipeline's name gains it.
A server can name pipelines by id instead, as pipeline-id:<pipeline-id>. An id never changes and is never reused, so use ids when grants should outlive renames or when many people create pipelines. Switching changes every pipeline's subject, so choose before you set up trust. On a server you run, set workload_identity.pipeline_subject; Set up workload identity shows how.
Keys
Marmot generates its signing keys, keeps them encrypted with the server's encryption key and publishes only the public halves. A key is replaced with an overlap: the next key is published a day before it signs, and the old one stays published until the last token it signed has expired, so systems that cache keys never see a token they can't check. A key that may have leaked can be replaced at once instead, which stops its tokens working straight away. Every token Marmot mints is recorded, with its subject, audience and id, never the token itself.
Runners
A runner signs in with credentials you give it in your network, such as its own Kubernetes service account or a cloud instance role, not with Marmot's identity. That keeps the point of a runner: a Marmot that someone took over still can't reach what only the runner can. A plugin's token file setting, where it has one, lets a runner present its own token.
Limitations
- The system must reach Marmot's keys. AWS, Azure and most SaaS systems fetch them from the internet, so Marmot's address must be public for them. Grafana, Kubernetes and Vault need network reach only, and Google Cloud and Grafana can take the keys as a file instead.
- A system that can't trust an external issuer, such as GitHub or a self-managed PostgreSQL, still needs a connection or a password from a secret store.
- Cloud SQL signs in service accounts, not pipelines, so each pipeline impersonates a service account of its own.
- Azure allows 20 federated credentials per identity, each matching one subject exactly, so plan 1 app registration or managed identity per 20 pipelines.
- Kubernetes takes one authentication config per cluster, and GKE takes no external issuer at all. Use the GKE plugin there.
Next steps
- Set up workload identity: turn it on for a server you run.
- Workload identity reference: claims, subjects, endpoints and settings.
- Connect Grafana: a pipeline that signs in to Grafana with no service account token.
- Connect Databricks: a pipeline that signs in to Databricks with no personal access token.