Skip to content
tezvyn:

Secret Sprawl: When Credentials Multiply Unchecked

Source: oasis.securityMediumHow cards are made

Secret Sprawl: When Credentials Multiply Unchecked

Secret sprawl is when credentials like API keys multiply without control, getting lost in code, config files, and CI/CD pipelines. It's common in automated cloud systems where non-human identities proliferate.

Why it exists

Modern cloud-native systems rely on automation, microservices, and AI agents that need to authenticate with each other. This creates an explosion of credentials for these non-human identities (NHIs). Without a centralized system to manage their lifecycle, these secrets inevitably get lost, forgotten, and exposed, creating a massive security risk.

The mental model

Think of secret sprawl like leaving keys to your company's buildings scattered everywhere. A developer might leave a key under a doormat (hardcoded in a config file), a temporary CI/CD job gets a master key and is never decommissioned, and there's no central list of who has which keys. Each lost or forgotten key is a permanent, unguarded entry point for an attacker.

How it works

Secret sprawl happens organically through daily operations. A developer hardcodes an API key for a quick test and forgets to remove it before committing. A CI/CD pipeline generates a temporary token to deploy an application but fails to revoke it on completion. A new service account is created for a machine learning model with broad permissions that are never reviewed or rotated. These secrets accumulate in code repositories, configuration files, developer machines, and even collaboration tools like Slack, with no central inventory, ownership, or lifecycle management.

When to use it

This is not a tool to use, but a problem to solve. Secret sprawl becomes a critical liability in any environment with significant automation, microservices, or cloud infrastructure. The more non-human identities you have—from CI/CD jobs to AI agents—the higher the risk. Organizations with strict compliance requirements like SOC 2, HIPAA, or the EU Cyber Resilience Act must actively prevent it, as it represents a major governance failure.

When not to use it

You prevent sprawl by implementing centralized secrets management and robust governance for non-human identities. Use a dedicated secrets vault to store and retrieve credentials dynamically at runtime. Enforce just-in-time (JIT) access, where permissions are granted for a limited time only. Automate the entire secret lifecycle, from creation and rotation to revocation. The cardinal rule is to never hardcode secrets; always inject them from a secure, managed source.

One canonical example

A DevOps team's CI/CD pipeline uses a service account token with broad permissions to deploy a microservice. A developer, debugging a failed build, copies this long-lived, powerful token and pastes it into a Jira ticket for visibility. The ticket is eventually closed, but the token remains exposed in the ticket's history, forgotten and never rotated. Months later, an attacker finds the token during a data leak and uses it to gain persistent access to critical production systems.

Interview question

Which situation most clearly illustrates the concept of secret sprawl?

  • a.A developer hardcodes an API key into a configuration file for a temporary test and forgets to remove it before committing.Correct
  • b.A security team discovers that an old, decommissioned server still has active network access.
  • c.An automated deployment pipeline fails because it cannot retrieve the necessary database credentials from a vault.
  • d.An organization uses a single, shared administrator account for all its cloud infrastructure management.
Why?

Secret sprawl is characterized by credentials multiplying and being left unmanaged, as exemplified by a hardcoded API key that is forgotten. Option D describes poor access management with a single credential, not the uncontrolled proliferation of many.

Just read this? Test yourself on what you have been reading.

Read the original → oasis.security

You just looked this up. Could you explain it out loud?

That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on security — each one lists the topics its interview covers.

See open roles