Owning and retiring workload identities
Workload identities pile up when nobody owns them. This lesson follows the printer's team as it takes an inventory of its cloud account, gives each identity an owner, compares what each workload may do with what it actually does, responds to a leaked key, and retires an identity nobody can explain without breaking a job nobody remembers.
Who owns this account?
The cleanup is nearly finished. Before deleting the old shared configuration file, the printer's team lists every identity in its cloud account, to make sure nothing still depends on it. The list has 61 entries, for four engineers and a handful of services. Most entries are easy to explain. One is not. It is called migrate-tmp, it has administrator access to the whole account, it was created three years ago, and it was last used 400 days ago. Nobody remembers making it.
A person's access has a lifecycle with clear starting and stopping points. Joining a company, changing roles and leaving each trigger changes to what they can reach, which identity governance follows from Joining an organization to Leaving an organization. Workload identities have nothing like that. There is no hiring date and no last day.
Instead, an engineer creates an identity for a database migration, a test, a trial integration or a quick fix, and nothing removes it when that purpose ends. These identities accumulate. They are often more powerful than they need to be, because granting broad access was the fastest way to make something work at the time. And they are often unowned, so there is nobody to ask whether one is still needed.
An identity with no owner is a credential nobody is watching. migrate-tmp still has a static access key, and if that key has leaked, nobody would notice when it is used. Access reviews look for accounts like this, as Orphaned, dormant, and shared accounts describes. A review is only as good as the list it starts from.
An inventory worth trusting
The team starts by recording, for every workload identityAn identity that belongs to software that runs and acts without a person directing each request, such as a service, a scheduled job or a pipeline step. It names the logical workload, not one running copy, and each copy holds its own credential., the facts someone would need to make a decision about it:
| Identity | Owner | Purpose | Credentials | Last used |
|---|---|---|---|---|
spiffe://printer.example/prod/render | Print services team | Builds print-ready pages for orders | Short-lived certificates, issued automatically | 2 minutes ago |
printer-deploy cloud role | Platform team | Production deployments from print-services | Federated from pipeline jobs, no stored key | Yesterday |
migrate-tmp | Unknown | Unknown | Static access key, three years old | 400 days ago |
All domains, credentials, and tokens in these examples are fictional. A list maintained by hand drifts out of date the week after it is written. The printer keeps its inventory accurate by defining each workload's identity in the same code that deploys the workload. Creating a service creates its identity, labeled with its owning team and purpose. Removing the service removes the identity. Anything found in the account that was not created this way is a discrepancy to investigate, which is how migrate-tmp was found.
Reviewing what a workload can do
The cloud platform's audit logs show which permissions each identity actually used. Over the last 90 days, the render service read customers' imported photos and wrote finished pages to one storage location, yet it was granted administrative access to all of storage. The difference is a candidate for removal, not proof that nothing needs it. Before taking the extra access away, the team asks the owner, checks that the logs cover every place the render service could have used it, and compares the 90 days with the longest schedule any of its jobs runs on: a quarterly recovery or archive job might need access that ninety quiet days never showed. Then it tests the operations the service does need with the narrower access.
Workloads make this kind of review easier than it is for people. A service does the same things day after day, so its usage is a good guide to its needs. A person's work changes from week to week. The review is worth repeating on a schedule, and whenever a workload's behavior changes, such as when it starts calling a new service.
When a workload credential leaks
Two weeks after the scanner's alerts in Credentials for workloads, the storage service's logs show something new. The old storage key from the shared configuration file is being used from an address outside the printer's network. The debug log had printed it alongside the print lab secret, but only the print lab secret was rotated. The team works through it in order.
Identify the identity. The key belongs to a storage identity called printer-backend-legacy, which can read and write every customer's files and manage its own keys. It has no recorded owner, so the incident team takes ownership for now.
Read what it did. The identity's recent activity shows what was accessed, when and from where:
2026-10-01T23:14:07Z identity=printer-backend-legacy key=...7Q2 action=list resource=customer-files/ source=203.0.113.45
2026-10-01T23:14:09Z identity=printer-backend-legacy key=...7Q2 action=read resource=customer-files/user-2281/ source=203.0.113.45
2026-10-01T23:15:31Z identity=printer-backend-legacy key=...7Q2 action=create-key resource=printer-backend-legacy source=203.0.113.45The log identifies the key by its last few characters, never by its full value. The last line matters most: whoever had the key used it to create a second key for the same identity.
Contain it. The team disables the leaked key and the new key the attacker created. Disabling an active, leaked credential cannot wait for a full picture of what depends on it. If a legitimate job breaks, it can be fixed. If only the leaked key were disabled, the attacker would simply carry on with the second one.
Look for anything else that survives. Attackers who reach one identity often try to keep access through others. The team checks for new identities, new keys on existing identities, and permissions granted since the first suspicious request. Rotating the one key that leaked is not enough until these checks are done.
Recover and replace. The team works out which customers' files were read, which leads to obligations of its own. The services that still needed this identity move to their own workload identities with short-lived credentials, and printer-backend-legacy is retired. The order matters as much as the steps, as Investigating an account compromise and Rotating credentials and keys after exposure showed for people's accounts: containing everything the attacker created comes before the cleanup that makes the identity safe to remove.
Retiring an identity
That leaves migrate-tmp. Deleting it at once is tempting, but some jobs run rarely. A quarterly report or a yearly archive might depend on it without anyone remembering.
So the team disables it first. Its key stops working, but the identity and its permissions are kept, so it can be restored in minutes if something breaks. They watch for failures for long enough to cover the rarest job they can think of. When nothing has broken, they delete the identity and its keys.
The history stays. The audit records of what migrate-tmp did over three years remain available for as long as the printer's retention period allows, because a future investigation may need them. The inventory records who retired it and why.
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
- Inventory the service clients, contain a leaked one and retire an unowned oneList every client with its owner and last use, record an owner, rotate a leaked secret with no overlap, then disable an unowned client, the safe step that comes before any deletion, and see its secret refused.