Join our Newsletter — 33% off our NHI Course
Home Glossary Cyber Security Dry Run Import
Cyber Security

Dry Run Import

← Back to Glossary
By NHI Mgmt Group Updated September 7, 2026 Domain: Cyber Security

A dry run import is a validation step that checks whether a resource can be imported into Terraform state without modifying the live environment. It helps confirm the state is valid and drift free before execution. Security and infrastructure teams use it to reduce the chance of corrupting operational state during migration.

Expanded Definition

A dry run import is a pre-commit validation step in infrastructure workflows, most often associated with Terraform state management, where the import is checked before any live change is applied. The purpose is to confirm that the target resource, its identifiers, and the expected state representation can be reconciled safely. It is not the same as applying configuration, and it should not be treated as a substitute for testing the full migration path.

The practical boundary is important: a successful dry run import indicates that the tool can model the resource and state relationship, but it does not prove the surrounding infrastructure is correctly configured or that every drift condition has been eliminated. In guidance terms, the term is operational rather than abstract. Teams use it to reduce the chance of writing an inconsistent or corrupt state entry during a migration or reconciliation process.

For readers working with identity-heavy automation, the same validation logic often becomes relevant to machine-managed resources and secrets-adjacent tooling, because state errors can cascade into access, ownership, and lifecycle confusion. For a broader authority on machine identity governance, the OWASP Non-Human Identity Top 10 is useful context, even though this term itself is infrastructure-state specific.

Examples and Use Cases

Dry run import appears in workflows where teams must reconcile existing resources with declarative infrastructure without risking an immediate production change. It is commonly used during migration, discovery, and state repair work.

  • Importing an existing cloud resource into Terraform state to confirm the provider can resolve the object cleanly before any apply step.
  • Checking whether a manually created network or storage resource is already represented correctly in state before a team hands ownership to infrastructure code.
  • Validating a resource import after a platform rebuild, where the team wants assurance that the recorded state matches what still exists in the environment.
  • Testing a reconciliation process for shared infrastructure so that multiple operators do not accidentally overwrite each other’s state assumptions.
  • Reviewing state alignment before a large refactor, where the dry run acts as a guardrail against importing the wrong resource or wrong identifier.

The main tradeoff is speed versus assurance. A dry run import adds an extra step, but that overhead is usually small compared with the disruption caused by corrupt state, failed automation, or an unintended replacement of a live resource.

Security Implications

When dry run import is skipped or misunderstood, the immediate risk is state corruption. That can lead to false assumptions about ownership, drift, or resource existence, and those errors often surface later as failed deployments rather than at the point of import. In infrastructure automation, delayed failure is especially costly because the environment may appear healthy until the next plan or apply operation.

A second consequence is privilege and change-control confusion. If a resource is imported incorrectly, operators may act on the wrong object, disable the wrong dependency, or overwrite a valid state record with one that points elsewhere. In practice, this can create accidental service interruption, orphaned resources, or loss of traceability over who is responsible for a live asset.

For security teams, the observable symptom is often drift that looks normal until automation begins to make inconsistent decisions. The practitioner signal to watch for is a mismatch between what the tool believes exists and what the environment actually contains, especially after manual remediation or emergency changes.

Domain and Governance Relevance

Dry run import matters in infrastructure governance because it is a control point between discovery and authoritative state. It supports change discipline by giving teams a chance to validate the import target before the state file becomes the source of truth. That is especially important where multiple teams, pipelines, or environments interact with the same resources.

In NHI-adjacent environments, the relevance becomes sharper because machine identities, service accounts, tokens, and certificate-backed resources are often managed through automation and stateful tooling. If the import path is wrong, the resulting state may misrepresent ownership or lifecycle status for a non-human identity, which can complicate rotation, revocation, and offboarding decisions. The governance issue is not the dry run itself, but the confidence it creates around an authoritative record.

Used well, dry run import helps preserve trust in infrastructure as code by separating validation from execution. That distinction is central to maintaining change accountability when resources are operationally sensitive.

Risk and Threat Considerations

Dry run import carries material operational risk because it protects the integrity of state, not the live resource itself. If teams treat the validation as proof of correctness, they can still import the wrong object, encode stale assumptions, or conceal drift that later causes a destructive apply.

Failure mechanism: The risk materialises when identifier matching, provider discovery, or human review is incomplete, so the state record is updated with an incorrect resource mapping or an outdated representation. In adversarial settings, a compromised automation path or manipulated input can also steer operators toward an unintended target.

Impact: The result can be broken deployment logic, accidental replacement of live infrastructure, orphaned security controls, or loss of control over the resource that the state file is supposed to govern.

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.

FrameworkControl / ReferenceRelevance
CIS Controls v84 — Secure Configuration of Enterprise Assets and SoftwareDry run import validates state before configuration is applied.
Recommendation — Use secure configuration checks to verify imported state before letting automation change production resources.
NIST CSF 2.0PR.IP-1 — Configuration ManagementThe term is fundamentally about controlled state reconciliation.
ID.AM-1 — Physical devices and systems within the organization are inventoriedImport validation depends on knowing which resource is being reconciled.
DE.CM-8 — Vulnerabilities are identified and prioritizedDry run import is often used to detect drift and mismatch before execution.
Recommendation — Document and validate imports so your configuration state stays accurate before deployment proceeds. Keep an accurate inventory so imported resources can be matched to the correct live asset. Use drift detection to surface mismatches before they become deployment failures.
OWASP Non-Human Identity Top 10NHI-01 — Inventory and OwnershipState validation is relevant when machine-managed resources need clear ownership.
Recommendation — Maintain ownership records for machine-managed resources before importing them into authoritative state.

Practitioner Guidance

What to watch for: Treat a successful dry run import as a validation signal, not a completion signal. The key judgement is whether the imported object is the right object and whether the state record will remain trustworthy after the next automation cycle.

Governance implication: Assign ownership for state reconciliation, because dry run outcomes are only useful when someone is accountable for reviewing drift, identifiers, and environment scope before execution.

Practitioner takeaway: Use dry run import to reduce state risk, but verify the target identity and the post-import state assumptions before any live change follows.

Deepen Your Knowledge

Sign up to our weekly newsletter — get 33% off our NHI Foundation Level Course

    NHIMG Editorial Note
    Reviewed and updated by the NHIMG editorial team on September 7, 2026.
    NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org