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.
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 tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret. 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.
AuthenticationChecking evidence that someone, or some application, controls an account, such as a password or a passkey. It establishes which account is being used, not what that account may do. suffers as well. The protections built for people, such as passkeys, MFASigning in with more than one type of factor, such as a password plus a code from an enrolled authenticator app. Two passwords are still one factor type, however many screens they appear on. 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 authorizationDeciding whether a requested action is permitted, such as whether a signed-in account may delete a particular photo. Authentication says which account is asking; authorization decides what it can do. 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/renderHere 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:
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.
Try it in the Lab
- Give each service its own client, then retire the shared oneSplit one client shared by two of the printer's services into one client per service, each with only the scope it needs, then disable the shared client and see its secret refused.