LanguageEnglish
Build →

Guides · QuorumAuth

Run service accounts without a stored API key

Every API key in a CI variable is a secret someone must rotate, track and eventually explain. Most machine callers already hold an identity they could prove instead. Here are two ways to use it, and what to check so they are actually safer.

Updated

The problem: a secret for every caller

Each deploy pipeline, cron job and backend service that calls your APIs needs to prove who it is. The quick answer is an API key in an environment variable. Within a year you have dozens. Each one is a credential that works from anywhere, for as long as nobody rotates it, and rotating it means finding every copy first.

Most of those callers already hold a stronger identity. A Kubernetes pod has its cluster’s service-account token. Many CI systems mint an OpenID Connect token for each job. A service you deploy can generate a key pair at start-up. The key you stored for them is redundant, and it is the part that leaks. This is the non-human identity problem at its most concrete.

Two keyless patterns

1. Federation: exchange a token the caller’s issuer minted. You tell the receiving side to trust one issuer, for one subject, such as a specific pipeline or workload. At run time the caller asks its own issuer for a token addressed to you and exchanges it for a short session. Nothing secret is stored for the caller.

2. Key-bound assertion: sign, do not send. The caller registers a public key. To sign in, it signs a short assertion with the private key, as in a JWT client assertion (RFC 7523). The private key never crosses the network, and each assertion works once.

Signing in with a token the caller already has

  1. 1Its OIDC issuer → CI job or workloadToken for this subjectAddressed to your organization
  2. 2CI job or workload → QuorumAuthExchange the token
  3. 3QuorumAuth → QuorumAuthIssuer, subject, audience, unused?
  4. 4QuorumAuth → CI job or workloadService sessionAt most 24 hours, no refresh

A sequence between a CI job or workload, its OpenID Connect issuer, and QuorumAuth. The issuer mints a token for the job, addressed to the organization. The job exchanges it with QuorumAuth. QuorumAuth checks the issuer, subject and audience against the enrolment and that the token is unused, then returns a service session that lasts at most 24 hours and has no refresh token.

The caller presents a one-time token from its own issuer; nothing long-lived is stored.

What makes either one actually safer

  • Match all three: issuer, subject, audience. Trusting an issuer without pinning the subject lets every job on that issuer sign in as your account. Skipping the audience lets a token minted for someone else work on you.
  • Use each proof once. A replayed token or assertion should fail.
  • Keep the session short and unrefreshable. The caller can always prove itself again; a refresh token would be one more long-lived secret.
  • Bound it by a role. A machine sign-in should never reach more than the account’s role allows.
  • Make withdrawal immediate. Removing the enrolment, replacing the key or revoking the account must end what it already earned, not just the next sign-in. See how to revoke a JWT before it expires.

How QuorumAuth runs service accounts without keys

For services in your own Kubernetes clusters, start with QuorumAuth managed SPIFFE. The authority is hosted, so you run no SPIFFE server or certificate authority of your own. You run the QuorumAuth node agent in your cluster, and each service proves itself through in-process mutual TLS in the SDK or through a native sidecar. Certificates renew themselves. There is no stored secret, and no key anyone creates, copies or rotates. It comes with every plan: no plan gates managed SPIFFE or workload identity federation.

Callers the node agent cannot reach, such as a hosted CI runner or a partner’s server, use federation or a key-bound assertion. A key-bound assertion still has a key you rotate. Both patterns attach to an ordinary service account in your organization. In its tested behaviour:

Federation.

  • An enrolment names the issuer and subject exactly, and its audience is your organization’s own issuer identifier. The account then holds no key.
  • Only https issuers are accepted. The issuer’s discovery document and keys are fetched when you enrol it, and an issuer that cannot be reached is not enrolled.
  • A token for another subject of the same issuer, from an issuer you did not enrol, or addressed to another audience is refused.
  • A token is spent by its first exchange. The service session it buys lasts at most 24 hours and carries no refresh token.
  • A removed enrolment admits nothing.

Key-bound sign-in.

  • A service account signs in with its registered key. A key it never registered is refused, and a spent assertion cannot sign in again.
  • The sign-in cannot ask for more than the account’s role, or name an organization where the account holds no role.
  • Registering a new key ends what the old key earned and stops it signing in. Revoking the account ends what its key earned and refuses the next sign-in.

API key, key-bound assertion, or federation

  1. API key
    A stored secret, shown once. Reusable until rotated. For callers with nothing else.
  2. Key-bound assertion
    Private key never leaves the caller. Each signed assertion works once. For callers that can hold a key.
  3. Federation
    Nothing stored for the caller. Its issuer's token works once. For callers with an OIDC issuer.

Three layers compare service account sign-in methods. An API key is a stored secret presented to sign in, reusable until rotated. A key-bound assertion keeps the private key with the caller, and each signed assertion works once. Federation stores nothing for the caller; a token from its own issuer works once, for one subject and audience.

Federation where an issuer exists, key-bound assertions where one does not, API keys only as a stopgap.

Federation is tested end to end against a Kubernetes cluster’s OpenID Connect issuer; any other issuer must publish a discovery document and keys over https. QuorumAuth does not find the API keys already scattered across your pipelines: you replace them one caller at a time. Callers with neither an issuer nor a place for a private key still need a service account API key, and the machine-to-machine authentication platform shows how to rotate and revoke one in a single step.

Where to go next

List every caller that holds a stored key, and note which ones run where an OpenID Connect issuer exists. Move those to federation first, then give the rest key-bound sign-in. For workloads inside Kubernetes, workload identity removes the stored secret altogether.

What is workload identity federation?

Letting a caller sign in with a token its own platform issued, such as its cluster's OpenID Connect issuer, instead of a secret you stored for it. The receiving side trusts that issuer for one named subject and audience.

Is a private-key assertion better than an API key?

The private key stays with the caller and each signed assertion works once, so nothing reusable crosses the network. You still have to protect and rotate the key, which is why federation is preferable where an issuer exists.

What if a federated token leaks?

In QuorumAuth it is spent by its first exchange, and it only works for the subject and audience it was enrolled for. The session it buys lasts at most 24 hours and cannot be refreshed.

Which callers still need an API key?

Callers with neither an OpenID Connect issuer nor a place to keep a private key. Give those a service account key you can rotate, and plan to move them.

Talk to sales about QuorumAuth.

QuorumAuth is sold through our sales team. The Build page shows the drop-in sign-in on your origin and how to reach sales about your stack.

Go to Build and contact sales →