Skip to main content
Version: Preview

Set up workload identity

Make your Marmot server an OIDC issuer, so pipelines sign in with workload identity instead of a stored password or key. The systems that trust Marmot fetch its public keys from your server, so they must be able to reach it.

Before you start​

  • Marmot is served over https at a stable address, the one systems will trust. A path after the host isn't supported.
  • You can set server.encryption_key. Marmot keeps its signing keys encrypted with it.
  • Every system you want to trust Marmot can reach that address. AWS and Azure fetch keys from the internet; Grafana, Kubernetes and Vault need network reach only.
  1. Set the issuer

    The issuer is server.root_url unless you set workload_identity.issuer. Set it only when the address systems use differs from the root URL:

    server:
    root_url: https://marmot.example.com
    encryption_key: ${MARMOT_SERVER_ENCRYPTION_KEY}
    workload_identity:
    issuer: https://marmot.example.com

    Plain http is accepted for localhost only. A root URL that can't be an issuer leaves workload identity off with a warning; an explicit workload_identity.issuer that can't be one stops the server.

  2. Optional: name pipelines by id

    Pipelines are named pipeline:<pipeline-name> in tokens. To use ids, which survive renames and are never reused, set:

    workload_identity:
    pipeline_subject: id

    Choose before you set up trust anywhere: switching changes every pipeline's subject.

  3. Restart Marmot

    Marmot creates its signing keys on first start and logs Workload identity issuer ready with the issuer. Every replica shares the same keys.

Check that it worked​

Fetch the discovery document from where a trusting system would:

curl https://marmot.example.com/.well-known/openid-configuration

The issuer in the response must match the address exactly. In the add source form, plugins that support it now offer Marmot's identity first.

Rotate the signing key​

Rotate the key on a schedule, or at once if it may have leaked. A graceful rotation publishes the next key now and signs with it after an overlap, 24 hours by default, so systems that cache keys fetch it first:

curl -X POST https://marmot.example.com/api/v1/workload-identity/keys/rotate \
-H "Authorization: Bearer ${MARMOT_API_KEY}"

For a key that may have leaked, rotate immediately. Tokens the old key signed stop working at once, and other replicas pick the new key up within a minute:

curl -X POST https://marmot.example.com/api/v1/workload-identity/keys/rotate \
-H "Authorization: Bearer ${MARMOT_API_KEY}" \
-d '{"immediate": true}'

Rotating needs users:manage. A system you gave the keys as a file, such as Grafana with jwk_set_file or a Google Cloud provider with an uploaded key set, needs the new file before the overlap ends.

The issuer is permanent

Every system that trusts Marmot names its issuer. If your server's address changes, set workload_identity.issuer to the old address while you move each trust to the new one, or tokens stop working everywhere at once.

Troubleshooting​

What you seeWhat to do
The workload identity issuer needs server.encryption_key to keep its signing keys encryptedSet server.encryption_key. For a laptop only, workload_identity.allow_unencrypted_key: true stores them unencrypted
The workload identity issuer must be this server's https originServe Marmot over https and set server.root_url to that address, with no path
this source signs in with Marmot's identity, but this server has no workload identity issuerThe server started without an issuer. Check its log for why
AWS or Azure refuses the token with an issuer or key errorThe system can't fetch your keys. Make the issuer reachable from the internet
The workload identity issuer has changed in the logSystems still trust the old issuer. Update them, or set workload_identity.issuer back

Next steps​