A Thousand Keys, No Keymaster: Bringing Order to Machine Identity in the Cloud
Photo: david falkner from Birmingham, England, CC BY 2.0, via Wikimedia Commons
In the early phase of a company's cloud adoption, credentials are easy to account for. There is one account, a few service users, and a short list of engineers who know where the secrets live. A few years later, the same organization runs a multi-account cloud estate, several CI systems, a data warehouse that authenticates to nearly everything, and a hundred or more SaaS tools that each asked for a token on the way in. No one decided to build that sprawl. It accumulated, one reasonable integration at a time.
The Arithmetic of Accumulation
The trouble with machine identity is that it is invisible by design. A human login produces a session someone can notice. A service account produces nothing at all until it breaks or is abused. Every tool adoption adds a handful of long-lived credentials: a deploy key, an OAuth grant, a webhook secret, a read-only token for the analytics team's dashboard. Multiply that by a few years of procurement and you arrive at a state most organizations cannot describe in a single meeting.
Ask a US engineering team for a complete inventory of the credentials that can reach its production data, and the honest answer is usually that the inventory exists in fragments, spread across a password manager, a spreadsheet, an infrastructure repository, and a handful of Slack threads. That fragmentation is the actual risk. Not the existence of keys, but the absence of a place where their existence is recorded.
Why Least Privilege Collapses Under Tool Proliferation
Least privilege is a sound principle and an exhausting practice. It asks every integration to be scoped to the precise resources it needs, reviewed on a schedule, and revoked the moment its purpose ends. That discipline holds in a small, stable environment. It fails under tool proliferation for a familiar reason: the cost of scoping tightly is paid by the team provisioning access, while the benefit lands on a security team that is not in the room.
So the default wins. Tokens are issued with broad scope because narrow scopes break during the proof of concept, and nobody returns to tighten them afterward. Service accounts inherit administrator rights because the pipeline needed one permission and the fastest path was to grant all of them. Over time, the organization's actual privilege surface drifts far from its documented policy, and the drift is not the product of negligence so much as a predictable response to competing schedules.
The Blast Radius Question
The measurement that matters is not how many keys exist but how many of them, if exposed, would reach regulated or customer data. A leaked token for a read-only logging integration is a nuisance. A leaked token with write access to a production database and the ability to alter IAM policy is an incident.
Most teams have never drawn that line. A useful exercise is to sort every credential into three buckets: those that can modify production, those that can read customer or regulated data, and those that can do neither. The first two buckets deserve named owners, rotation schedules, and monitoring. The third deserves to be deleted if its integration no longer runs.
What a Practical Audit Looks Like
A secrets audit does not need to be a six-month program. It needs a fixed scope, a deadline, and an owner who can compel changes across teams.
- Inventory from the systems, not the memory. Pull credential lists from your cloud provider's identity service, your CI platform, your identity provider, and any SaaS tool with a documented API. Memory will miss roughly the credentials that matter most.
- Attach an owner to every entry. Not a team name, a person. Credentials without an owner are candidates for revocation by default.
- Classify by blast radius. Apply the three-bucket test above and record the result next to the credential.
- Shorten lifetimes where the tooling allows. Short-lived tokens issued by a workload identity system are strictly better than long-lived secrets in an environment variable. Prioritize the migration for anything in the top two buckets.
- Schedule rotation and prove it works. A rotation policy that has never been executed is a hope, not a control. Run one rotation end to end and fix whatever breaks before the calendar demands it.
Rotation Without Breaking Production
The most common objection to aggressive rotation is that something will fail at two in the morning. That objection is usually correct, and it points to the underlying problem: credentials are embedded in places where they cannot be changed without a deployment. Rotation is only as fast as the slowest consumer.
The remedy is architectural rather than procedural. Move secrets out of source configuration and into a managed store that the workload reads at startup. Prefer identities issued to workloads over static secrets wherever the platform supports it. Where static secrets remain unavoidable, establish a rotation cadence short enough to keep the practice routine and long enough that teams can absorb it.
Owning the Door, Not Just the Keys
Organizations that manage machine identity well share a habit rather than a tool. They treat access as something granted through a small number of deliberate entry points, each of which records who asked, for what, and until when. The goal is not to eliminate keys. It is to make sure that every key has a name attached, a reason recorded, and an expiration that someone is prepared to honor.
Sprawl is not solved in a quarter. It is contained by making the inventory a living artifact, reviewed on a schedule, with revocation as the ordinary outcome rather than the exception. Teams that get there find the security benefit is real, but the operational benefit arrives first: fewer mystery failures, faster onboarding, and a clearer answer the next time an auditor asks who can reach the customer database.