{
  "version": 1,
  "id": "tcinfra-reference-018",
  "title": "Terraform Drift Detection: Preserve Exit Codes and Review the Saved Plan",
  "maxAgeHours": 24,
  "objective": "A pipeline that ignores exit code two can silently discard a real difference. Treat zero as no change, two as a change requiring review, and one as execution failure.",
  "boundary": "Plan files can contain sensitive values; restrict artifact access and never automatically apply an unreviewed drift plan.",
  "reference": "https://developer.hashicorp.com/terraform/cli/commands/plan",
  "checks": [
    {
      "field": "exitCodeHandled",
      "equals": true,
      "interpretation": "Record the reviewed evidence for exit code handled."
    },
    {
      "field": "planReviewed",
      "equals": true,
      "interpretation": "Record the reviewed evidence for plan reviewed."
    },
    {
      "field": "stateLockingEnabled",
      "equals": true,
      "interpretation": "Record the reviewed evidence for state locking enabled."
    }
  ]
}
