Skip to content

How to act on a drift finding

Detection is read-only. Nothing on this page changes your infrastructure: Cloudkeel-DD never creates, updates or deletes a cloud resource, never runs terraform apply, and has no auto-remediation path. Everything below either records a decision or opens a pull request for a human to review.

You believeDo thisWhat it does
Reality is right, the code is staleAcceptRecords the claim; you update your IaC
The code is right, reality is wrongRevert planGenerates a field-level plan for you to run
Neither — this is noiseSuppressSilences it, with a required reason
You want a PR out of itRemediation PROpens a real GitHub PR or GitLab MR

Accept and revert are decisions. Only the remediation PR produces an artifact.

Both move it to awaiting re-scan (pending_verification), not to resolved. A later scan decides:

  • The drift is gone → the finding resolves.
  • The drift is still there → it reopens, and reopening re-arms its notification. “The fix you claimed didn’t hold” is the highest-signal thing this product says, so it is never silent.

You do not have to use either. Most drift is fixed by someone doing their normal job, and when a re-scan finds it gone the finding resolves on its own, credited as reconciled externally. The accept/revert detour exists for when you want the claim on the record.

Generated from the computed diff, in the opposite direction to a remediation PR: it describes pushing reality back to the declared state.

Each step is one of three actions:

ActionMeaning
setThe field changed; here is the declared value to restore
removePresent live, absent from the declared state
restorePresent in the declared state, missing live

It is structured data and suggestion text. Nothing applies it — review the steps, run them yourself, then re-scan to confirm.

Two different things share this button, and they produce very different artifacts. Know which one you are getting.

The PR adds a JSON file recording the desired state:

remediation/<resource_type>/<namespace>/<name>.json

with the last-known-good desired payload as its contents, and a body carrying the drift category, severity, diff summary and the full field-level diff.

This is a record, not a fix. It is not HCL, and merging it does not reconcile anything — it puts the desired state and the diff in front of reviewers in your normal review workflow. The actual change to your Terraform is still yours to write.

The PR adds a Terraform import block:

codify/<resource_type>/<name>.tf
import {
to = aws_security_group.my_group
id = "sg-0123456789abcdef0"
}

That is valid HCL, and it is an import block only — never a resource body. Generate the body locally with Terraform 1.5+:

Terminal window
terraform plan -generate-config-out=generated.tf

Review the generated body before merging; defaults and computed attributes usually need cleanup.

Codify needs the resource type to have a known identity mapping. If it does not, the request is rejected with a clear message rather than guessing an import id. See Codify an unmanaged resource for the full walkthrough.

Whether a PR can open immediately depends on the finding’s severity:

SeverityInitial statusWhat is needed
criticalpendingA human must approve before a PR can open
everything elseapprovedNothing — it is ready to open

Auto-approval is not auto-opening. Opening the PR is always a separate, explicit action, at every severity. Nothing reaches your Git host because a scan ran.

A remediation moves through pendingapprovedcompleted, or to rejected if you decline it, or failed if the Git host refuses the request — in which case the error from the host is recorded on the action.

Approving something that is not pending, or trying to open a PR for something not yet approved, is rejected rather than silently ignored.

A Personal Access Token must be configured on the Cloudkeel-DD deployment:

ProviderSetting
GitHubGITHUB_PAT
GitLabGITLAB_PAT

Without one, PR creation fails with “No GitHub token configured”. This is a deployment-level setting, not per-tenant — see Secrets.

You also supply a target repository on the request; it has no default, and omitting it is rejected. The target branch defaults to main.

  1. Open a finding and choose Create remediation PR.
  2. If it is critical, approve it first.
  3. Follow the returned URL to the PR or MR on your Git host.
  4. Confirm the file path matches the table above — remediation/…json for drift, codify/…tf for an unmanaged resource.
SymptomCauseFix
“No GitHub token configured”GITHUB_PAT / GITLAB_PAT not set on the deploymentSet it and restart; see Secrets
“Remediation must be approved before opening a pull request”The finding is critical and nobody approved itApprove it first
“target_repo is required”No repository given on the requestSupply the target repo
“No captured live payload to codify this resource from”The unmanaged finding has no stored live snapshotRe-scan so a snapshot is captured, then retry
Codify rejected for this typeNo identity mapping for that resource typeImport it manually; Cloudkeel-DD will not guess an import id
PR opened but merging changed nothingExpected for drift PRs — they add a JSON record, not HCLWrite the Terraform change yourself
Status is failedThe Git host refused the requestRead the recorded error; usually token scope or a wrong repo path