Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

When software needs its own identity

The printer's backend makes requests all day and all night with nobody directing them. This lesson follows it from one secret that every service shares to one identity for each piece of software: what a workload is, why borrowing a person's account fails, and how to name a workload so its name means the same thing everywhere it travels.

A key everyone shares

In Client credentials, the printer's nightly job sent finished photo books to the print lab, authenticating as itself. Since then the printer has grown. An order service takes your order. A render service turns your album into print-ready pages. The nightly batch job still sends the finished books to the print lab. A storage service keeps the files in between, and a deployment pipeline ships new versions of all of it to the cloud platform the printer runs on.

None of these pieces is a person, and none of them waits for one. Each request they make still raises the questions from the first lesson: who is asking, and should they be allowed to? When the printer was small, one engineer answered the first question with a single configuration file that every service reads when it starts:

# printer-backend.conf, read by every service
PRINTLAB_CLIENT_ID=printer-orders
PRINTLAB_CLIENT_SECRET=demo-only-not-a-real-secret
STORAGE_API_KEY=demo-storage-key-not-real

All domains, credentials, and tokens in these examples are fictional. The deployment pipeline is set up differently: it deploys with a cloud access token that one of the engineers created from their own account a few years ago, because that account already had the permissions it needed.

One morning the print lab gets in touch. Overnight it received several hundred print-job requests from the printer, far more than any normal evening. Every request was authenticated with the printer's client secret. The print lab's records say printer-orders made them, and that is all they can say.

The printer's team now has questions its setup cannot answer. Which service sent those requests? The order service, the render service and the batch job all hold the same secret, so any of them could have. Can they stop the source without stopping everything? Changing the secret stops the source, but it also stops the evening batch and anything else that reads the file. And where else has the secret gone? It sits in every service's configuration, on every laptop that ever ran the services locally, and in any log that ever printed the configuration.

The secret was not weak, and nobody did anything unusual with it. The trouble is what it identifies. It says "the printer" when every question being asked is about one particular piece of software, so the print lab cannot tell the callers apart, the render service holds the power to place print jobs it never needs, and no single caller can be cut off on its own.

What a workload is

A workload is software that runs and acts without a person directing each request. A long-running service like the order service is a workload. So is a scheduled job, a function that runs whenever a file arrives, and a single step in a deployment pipeline.

One workload rarely runs as one copy. On a busy evening the render service runs as twelve copies at once. Each new release replaces all of them, and the platform starts and stops copies as demand changes, so any copy might handle any order. These running copies are called instances, and most of them live for hours or minutes.

The identity belongs to the logical workload, "the render service in production", rather than to any one instance. That is the level at which permissions make sense: the render service may read your album from storage and write finished pages, and that rule is the same for every copy. The instances share that identity, but each one should hold its own credential, so one copy's credential can be replaced or expire without affecting the others.

Environments need separate identities too. The render service the team tests changes against should not be able to read real customers' albums, and if test and production share an identity, a mistake made while testing carries production's access.

Borrowing a person's account

The deployment pipeline shows a different shortcut: running automation as a person. It is common because it is easy. The engineer already had access, so their token made the pipeline work on the first try. The costs arrive later.

The cloud platform's audit log says the engineer deployed a new release at three in the morning, every night. That record is wrong, and anyone investigating a real problem has to know it is wrong. When the engineer moves to another team and their access is reduced, the pipeline breaks. More often nobody remembers the token, and it keeps the engineer's broad access long after they stopped needing it. When they leave the company, disabling their account stops deployments, and someone will be tempted to keep a former employee's account alive to avoid that.

Authentication suffers as well. The protections built for people, such as passkeys, MFA prompts and checks on unfamiliar sign-ins, assume a person is present. To run unattended, the pipeline needs a long-lived token that skips them, and a token that bypasses MFA and carries an engineer's access is exactly what an attacker hopes to find in a pipeline's settings.

Finally, the engineer can do far more than deploy. A person's access covers everything their work involves, and the pipeline inherits all of it: it needs one narrow permission and holds dozens.

How workload identity differs

The ideas from What is Identity? still apply. A workload needs an identifier that says which workload it is, a credential that supports that claim, authentication to check the credential, and authorization to decide what it may do. What changes is the situation around them.

There is nobody to prompt. A person can type a password, answer a challenge or approve a sign-in. A workload has to hold or obtain its credential by itself, at three in the morning, with nobody watching.

There are many more of them. The printer has four engineers and, across its environments, several dozen workload identities. Larger organizations commonly have many times more workload identities than employees.

They change quickly. People join and leave over months or years. Workloads are created by one code change and retired by another, and their instances come and go every few minutes.

Nobody owns them by default. A person is responsible for their own account, and a manager for what that person can access. Nothing equivalent exists for a workload unless someone records which team owns it and why it exists.

You will also hear the terms non-human identity and machine identity, which cover workloads, devices and other software together. These lessons say workload identity for software that runs on its own, and agent identity for software that acts for a person while choosing its own steps.

Naming a workload

Inside the printer, "render" might seem name enough. But names travel. The storage service sees the printer's workloads, the print lab may see one of them, and the cloud platform sees all of them. A name needs to say whose workload it is as well as which one.

A common structure combines a trust domain, the authority that vouches for a set of names, with a path chosen by that authority. SPIFFE, an open standard for workload identity, writes such a name as a URI:

spiffe://printer.example/prod/render

Here printer.example is the trust domain: the printer vouches for every name under it, and nobody else can. The path /prod/render is the printer's own choice, naming the environment and the service. The batch job would be spiffe://printer.example/prod/print-batch, and the test copy of the render service spiffe://printer.example/test/render.

Good names describe what the workload is and stay the same from one release to the next. Leave out what changes all the time, such as instance numbers, hostnames and network addresses, and leave out anything secret. A name is copied into logs, policies and error messages, so it should be safe to show.

With a name for each workload, the print lab's overnight question has an answer. It can admit only the batch job to print jobs, refuse the render service, and record which workload called:

With one shared secret, every service holds the power of all of them. With one identity per workload, the print lab can admit only the batch job and see which workload called.

A name on its own proves nothing, because anyone can write spiffe://printer.example/prod/render into a request. The name is what policies and records refer to. Each workload still needs a credential of its own that a checker can trust, and the printer gives one to every name it vouches for.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

The order service, render service and batch job all authenticate to the print lab with one client secret. The print lab reports a flood of print jobs overnight. Why can the printer not stop the source on its own? 1 of 3

Choose one answer.

The deployment pipeline deploys with a cloud token that belongs to an engineer. The engineer moves to another team and their access is reduced. What is the underlying problem? 2 of 3

Choose one answer.

The render service runs as twelve containers that restart several times a day. At what level should its identity be defined? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity