Teams should first inventory unmanaged resources, then decide whether each one should be imported into Terraform or retired. Unmanaged resources create cost and governance blind spots because their configuration can drift without a declared desired state. The practical goal is to make ownership explicit, reduce surprise changes, and prioritise the highest-cost assets for remediation.
Why This Matters for Security Teams
Unmanaged cloud resources are not just a cleanup problem. They are a governance gap that breaks the link between what exists in production and what security teams believe exists. When a resource sits outside Terraform, it can drift, retain excessive permissions, and survive long after the team that created it has moved on. That creates blind spots for change review, cost control, incident response, and audit evidence.
For NHI Management Group, the issue is fundamentally about ownership and declared state. If a cloud asset is not represented in infrastructure-as-code, it is easier to miss secret sprawl, stale credentials, and inherited trust paths that were never designed into the system. NHI-specific incidents show how quickly unmanaged components can become security liabilities, especially when they expose keys, tokens, or privileged service access. See the Top 10 NHI Issues and the 2024 Non-Human Identity Security Report for the broader maturity gap that often accompanies weak asset visibility. NIST also frames asset inventory and secure configuration as core security outcomes in the NIST Cybersecurity Framework 2.0.
In practice, many security teams discover unmanaged resources only after a billing spike, a failed audit, or a post-incident review exposes them.
How It Works in Practice
The practical approach is to inventory first, then classify each unmanaged resource by business value, risk, and ownership. The goal is not to force everything into Terraform immediately. Some resources should be imported into code so future changes are controlled. Others should be retired because they are orphaned, duplicative, or too risky to preserve.
A good workflow usually looks like this:
- Identify resources that exist in cloud consoles but not in Terraform state.
- Confirm whether each resource has a current owner and a valid business purpose.
- Decide whether the resource is stable enough to import into Terraform without introducing drift.
- Retire assets that are obsolete, excessive, or impossible to govern cleanly.
- Record exceptions where import is unsafe or where another control plane owns the resource.
Terraform import is useful when the existing resource is still needed and its current configuration can be reconciled with declared state. That is especially important for resources tied to secrets, certificates, or privileged service accounts, because hidden dependencies can otherwise remain active after ownership has changed. The NHI Lifecycle Management Guide and the Ultimate Guide to NHIs — Lifecycle Processes for Managing NHIs are useful references when teams need to connect inventory work to lifecycle governance. For a control baseline, NIST SP 800-53 Rev 5 Security and Privacy Controls supports configuration management, inventory, and accountability expectations.
Where possible, teams should make Terraform the source of truth for repeatable resources and use a documented exception process for anything that cannot be managed that way. These controls tend to break down when multiple cloud teams provision directly in consoles because no single owner can reconcile state fast enough.
Common Variations and Edge Cases
Tighter Terraform governance often increases operational overhead, requiring organisations to balance standardisation against the cost of retrofitting legacy environments. That tradeoff is real in fast-moving cloud estates, especially where platform teams, application teams, and security teams all provision differently.
Best practice is evolving for shared services, short-lived test environments, and vendor-managed components. There is no universal standard for forcing every asset into one infrastructure-as-code repository. Some resources are better managed by separate modules, some by a platform team, and some by native service controls with explicit documented exceptions. The key is to avoid an invisible asset class that exists outside all review paths.
Risk also rises when unmanaged resources contain secrets or trust relationships that are not obvious from their naming. In those cases, discovery should be paired with credential review, access policy verification, and rotation decisions. The 230M AWS environment compromise and the Azure Key Vault privilege escalation exposure illustrate how quickly overlooked configuration can become a broader identity problem. For identity and control mapping, the NIST SP 800-63 Digital Identity Guidelines remain relevant when unmanaged resources involve workload or service identities.
The safest rule is simple: if a resource matters enough to keep, it matters enough to own explicitly.
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 and CSA MAESTRO address the attack and risk surface, while NIST CSF 2.0, NIST SP 800-63 and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | Unmanaged resources often hide non-human identities and secrets. |
| NIST CSF 2.0 | ID.AM-1 | Asset inventory is the starting point for closing Terraform blind spots. |
| NIST SP 800-63 | Identity assurance matters when unmanaged resources carry workload credentials. | |
| CSA MAESTRO | GOV-2 | Agent and workload governance depends on explicit ownership and lifecycle control. |
| NIST AI RMF | GOVERN | Governance requires documented accountability for systems outside normal IaC control. |
Maintain a complete cloud asset inventory and reconcile it against declared infrastructure state.
Related resources from NHI Mgmt Group
- How should teams approach importing unmanaged cloud resources into Terraform without creating drift or downtime?
- Why do unmanaged cloud resources create operational and governance risk in Terraform environments?
- Who should own the remediation of unmanaged AWS resources discovered outside Terraform?
- How should financial services teams enforce infrastructure governance across Terraform changes in regulated cloud environments?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 28, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org