The main failure is loss of separation between access control and credential custody. If credentials are stored in the access layer, organisations can weaken policy enforcement, complicate audits, and create unnecessary trust in infrastructure that should never hold the secrets. The safer model is to keep storage in the secret store and let the gateway retrieve credentials only when needed.
Why Credentials Break When Access and Secrets Live in the Wrong Place
The failure is not just that a secret is exposed; it is that the access path and the secret custody path collapse into the same control boundary. When a gateway, broker, or access tier stores credentials, that layer becomes both policy enforcer and secret vault, which expands blast radius, complicates rotation, and makes it harder to prove who can actually read or use the credential. That is especially dangerous in workflows that were supposed to separate retrieval from authorisation.
In secrets-heavy environments, the operational cost shows up quickly. Research from The State of Secrets in AppSec notes that organisations maintain an average of 6 distinct secrets manager instances, a sign that fragmentation already makes central control difficult before custody is misplaced. The right model is not “put the secret near the request”; it is to keep custody in a dedicated secret store and let the access layer request short-lived access only when policy allows it.
In practice, teams usually discover the design flaw only after audit evidence becomes inconsistent or rotation starts breaking downstream systems rather than during architecture review.
How Separation of Custody Works in Practice
A clean access-and-secrets workflow has two distinct jobs. The access layer decides whether a request should proceed, while the secret store decides whether a credential can be issued, rotated, or revoked. The gateway should not be the long-term home for passwords, API keys, certificates, or refresh tokens. It should receive only the minimum material needed for a bounded session, preferably with short lifetime and narrow scope.
That separation matters because the storage location changes the trust model. If access infrastructure stores the credential, compromise of the gateway becomes credential compromise, not merely policy bypass. If the gateway retrieves the credential on demand, the secret remains governed by the vault’s own audit, versioning, and revocation controls. This also reduces the chance that credentials are duplicated into logs, caches, configuration stores, or support tools that were never intended to hold them. For NHI-specific operational depth, the Ultimate Guide to NHIs — Static vs Dynamic Secrets is useful because it contrasts long-lived material with dynamic issuance patterns that better fit machine workflows.
- Store long-lived secrets only in the dedicated secrets system, not in the access broker.
- Let the access tier fetch or exchange for a short-lived credential at request time.
- Audit issuance, use, rotation, and revocation as separate events.
- Prevent the access layer from becoming the only place where the secret exists.
Controls described in the OWASP Non-Human Identity Top 10 map well to this pattern because machine credentials need explicit lifecycle and scope control, not incidental storage inside the request path. This approach breaks down when legacy gateways must persist credentials to support offline processing or brittle upstream integrations, because the storage exception silently becomes the new default.
Where the Pattern Gets Messy in Real Deployments
Tighter separation often increases integration effort, so teams must balance governance clarity against operational convenience. Some environments use the access layer as a cache, a broker, and a fallback store at the same time, which blurs responsibility and makes it unclear whether a failure is an authorisation issue or a custody issue. That ambiguity is itself a control problem because it hides where revocation, logging, or expiry actually needs to happen.
Current guidance suggests treating any persistent credential inside the access tier as an exception that needs explicit expiry, ownership, and removal criteria. Static credentials are the most fragile case, but even dynamically issued tokens become risky if the access layer keeps them longer than the session that justified them. In distributed systems, the practical question is not whether the credential can be used, but whether the place holding it can prove when it should stop being usable.
Teams also underestimate how quickly misplaced custody spreads. Once one service stores a credential “temporarily,” logs, backups, DR replicas, and observability tooling often inherit copies of the same material. For broader control language, NIST’s Security and Privacy Controls remain relevant because they reinforce separation of access control, auditability, and system integrity, even though the real design decision here is architectural rather than purely procedural.
In practice, the hardest failures appear when the access layer is asked to do more than authorise, because custody becomes invisible until a rotation, compromise, or outage proves that the system never truly separated those jobs.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 — Secrets and Credential Management | Misplaced secret custody is a core non-human identity control failure. |
| NHI-03 — Privilege and Access Scope | The access layer must not gain broader authority by holding credentials. | |
| Recommendation — Keep machine credentials in a dedicated secrets store and issue them just in time. Limit gateway access to scoped retrieval, not persistent credential possession. | ||
| CIS Controls v8 | 6 — Access Control Management | The question centers on separating access decisions from credential custody. |
| 8 — Audit Log Management | Misplaced credentials weaken traceability across access and secrets workflows. | |
| Recommendation — Define and enforce access paths so authorization is distinct from secret storage. Log issuance, retrieval, rotation, and revocation events from the secret system. | ||
| NIST CSF 2.0 | PR.AC — Identity Management, Authentication, and Access Control | The issue is a control-boundary problem between access enforcement and secret handling. |
| Recommendation — Separate authentication and access enforcement from long-term credential custody. | ||
Practitioner Guidance
What to prioritise: Classify every credential path by who stores it, who can retrieve it, and how long it remains valid. If the access tier persists the secret beyond the request boundary, treat that as a design defect rather than an optimisation.
What to verify: Confirm that rotation, revocation, and audit events originate from the secret store, not from the access layer. Verify that backups, logs, and caches cannot silently reintroduce the same credential after deletion.
Decision rule: If a credential is needed for brokered access, prefer just-in-time retrieval with short-lived issuance; if the architecture requires persistent storage in the gateway, escalate the exception for formal risk acceptance and redesign.
What practitioners underestimate: The main loss is not only exposure, but accountability drift. When custody is misplaced, teams lose the ability to answer a simple incident question: where did this credential exist, and which control was supposed to own it?
Practitioner takeaway: Keep custody and enforcement separate enough that compromise of the access path does not automatically become compromise of the secret itself.
Related resources from NHI Mgmt Group
- What breaks when customer identity, app access, and third-party services are not controlled in one place?
- What breaks when AI-connected workflows rely on stored secrets?
- What breaks when automation credentials are shared across workflows?
- What breaks when credentials are stored outside a secrets manager?