← All writing

The Lock on the Back Door

How long-lived credentials spread through software systems and what a stronger design does differently

Credential exposure often begins with an ordinary shortcut.

A developer needs an application to connect to a database, so they place the password in a configuration file. Someone shares an API key in Slack while troubleshooting an outage. A service account receives broad permissions because the team needs to ship before the end of the week.

The shortcut solves the immediate problem. Months later, the same credential may exist in a repository, a deployment system, a developer’s laptop, a backup, and an internal document. The employee who created it may have left the company, and nobody wants to change the value until they know what will break.

Security teams call this credential sprawl. The missing inventory is part of the problem, though the credentials spread because applications still depend on reusable secrets that must be copied between people, systems, and environments. Improving the inventory helps teams manage the copies they know about. It does not change the process that keeps creating them.

Why credentials spread

Long-lived credentials are common because they are easy to implement. An application stores a password or key and presents it whenever it needs access. The value continues working until someone rotates or revokes it, so the application does not need to request access each time it starts.

That approach can be reasonable for a small system. The maintenance becomes harder as the company adds applications, environments, employees, and integrations.

A database password may begin in a local environment file. The CI/CD platform later needs the same value so it can deploy the application, and production needs another copy. A developer adds it to a maintenance script. Someone includes it in a runbook because the support team may need it during an outage.

The company thinks of this as one password even though it now has several copies protected by different access controls. Revoking the password requires the team to find and update every dependency before one of them fails.

Service accounts create a similar problem. A team creates an account for an automated process and grants it broad permissions because the exact policy is unclear. The job is expected to run indefinitely, so the account receives no expiration date.

The workflow changes over time while the original access remains. An account may still be active years after the process that justified it was replaced.

Urgency explains why this pattern continues. Creating access is attached to work that needs to happen now. Removing access requires investigation and carries a chance of interrupting a system that still depends on it. Teams receive an immediate benefit from granting access and assume immediate risk when they try to take it away.

Rotation becomes an operational problem

Security policies often require credentials to be rotated every few months because changing a password or key limits how long an exposed value remains useful.

The process works only when the organization knows every place where the credential is used.

A shared database password may be stored by several applications, scripts, scheduled jobs, and third-party tools. Rotating it means updating all of them within a short period. A missed dependency can interrupt production, and the failure may remain hidden until a rarely used process runs several days later.

The security team is trying to reduce the chance of a future compromise while the operations team is responsible for any outage caused by the change. The outage is immediate and visible, which makes rotation schedules easy to postpone.

A credential scheduled for rotation every 90 days moves to 180 days. Later, the team changes it once a year when an audit raises the issue. Other credentials remain untouched because nobody can confirm what still depends on them.

Secret managers, deployment automation, and better inventories make rotation safer. They give teams a controlled place to store values and a more reliable way to distribute updates. The application still depends on a reusable secret reaching every environment correctly.

Reducing the number of applications that need permanent credentials removes some of that distribution work.

Giving workloads an identity

An application can receive access through an identity assigned to the workload that runs it.

In a cloud environment, the identity may come from a role attached to a virtual machine, container, or serverless function. Kubernetes can authenticate workloads through service accounts. Other environments may use certificates, hardware-backed identity, or an attestation system that verifies details about the machine and process.

After the workload proves its identity, an authorization service can issue a token with a limited lifetime and a narrow set of permissions. The application can use the token directly or exchange it for temporary access to a database or another service.

The authorization service still creates a credential. Its short lifetime and limited scope make it easier to control than a password expected to remain valid for years.

An application that reads from one database can receive access to that database for a short period. The credential expires automatically and cannot be reused to reach unrelated systems. If an attacker steals it, the available time and permissions depend on the policy applied when the token was issued.

The application also stops relying on a person to update the same stored password across several environments. New credentials become part of normal operation, so expiration does not require a coordinated manual change.

Short-lived access narrows the problem that monitoring, least-privilege policies, network controls, and incident response have to manage. A compromised workload can still cause damage while its token remains valid, and an overly broad identity policy can recreate many of the risks associated with permanent credentials.

The initial identity therefore needs careful treatment.

A cloud platform may rely on its control plane because it knows which account created a resource and which role was assigned to it. Kubernetes can authenticate workloads according to the cluster configuration. Attestation systems can compare information about the deployment, machine, or process with registration rules.

Human approval may be appropriate for unusual or sensitive access. Routine workloads are usually easier to manage when infrastructure rules enforce the decision consistently.

The security team should be able to determine how an identity was issued, which evidence supported it, what permissions it received, and how the trust can be revoked. Temporary credentials provide little protection when the system issuing them cannot reliably identify the workload making the request.

Make secure access part of the normal workflow

Security guidance tells developers to keep credentials out of source code, chat messages, and local files. Following that advice becomes difficult when the approved process still requires someone to retrieve a long-lived secret and place it somewhere the application can read it.

A developer working against a deadline will usually choose the path that gets the system running. If the secure process involves several tickets, manual approvals, and a complicated deployment, shortcuts remain attractive because the delivery delay is immediate while the security risk is uncertain.

The normal deployment process should let a developer assign an identity to a workload and define the access it needs. The platform can issue credentials when the application starts, record what it granted, and expire the access automatically.

Developers still need training because they make decisions about permissions, data, and the consequences of exposing access. The architecture reduces how often security depends on each person handling a secret correctly.

Identity-based access also gives the organization a clearer offboarding process. Access tied to an employee or workload can be disabled and reviewed through the identity system. A shared password provides less certainty because copies may remain on devices, in scripts, and in documentation after the original user has left.

Where this approach fits

Workload identity and short-lived credentials are most useful when applications run continuously, infrastructure changes often, and the organization already has a reliable identity layer.

Cloud platforms, containerized environments, CI/CD pipelines, and large internal application systems fit these conditions because workloads are created, replaced, and removed frequently. Distributing permanent passwords manually becomes harder as the environment changes.

A small internal tool running on one server may get enough protection from a managed secret store, strict permissions, automated rotation, and a clear owner for each credential. Adding a large identity platform would introduce maintenance that the size and risk of the system may not justify.

The decision depends on how often credentials move, how many systems share them, and what an exposed credential can reach. An organization spending increasing amounts of time finding, copying, rotating, and repairing long-lived credentials is already maintaining a distribution system for secrets.

Credential sprawl often appears as a collection of individual mistakes because a person committed the key, shared the password, or forgot the service account. Those mistakes become routine when reusable secrets are the quickest way to give an application access.

With workload identity, access can be tied to a named workload and an explicit policy. The authorization system records why the access was issued, and short-lived credentials expire without requiring someone to locate every stored copy.