Skip to content

Policy: cdk destroy, pulumi stack rm and terraform state rm wait for a person (TK-A001) #361

Closed

Description

@LoopGlitch26

TK-A001 holds terraform destroy, pulumi destroy and (since #356) terragrunt destroy for a person. The blind E21 pool from #357 (by @juliasadler) found three infrastructure commands it doesn't hold:

npx cdk destroy --force --all               (allowed)
pulumi stack rm prod --force --yes          (flagged only)
terraform state rm aws_db_instance.prod     (flagged only)

cdk destroy deletes every stack it names; pulumi stack rm --force deletes a stack and its state even with resources still in it; terraform state rm makes Terraform forget a live resource, so the next apply can create a duplicate or a later destroy misses it.

Task: extend TK-A001 in tracekit/policy2/packs/coding.yaml (or add a rule next to it) so these wait for a person: cdk destroy (also through npx, pnpm dlx and the other launchers the rule already reads), pulumi stack rm, and terraform/tofu state rm.

  • Follow how fix(policy): hold terragrunt destroy (TK-A001) #356 added terragrunt: the same option groups, a version bump of the pack, tests in tests/test_signer_policy.py, cases in tests/data/policy/deny/ and benign lookalikes in tests/data/policy/benign/ (cdk diff, cdk synth, pulumi stack ls, terraform state list, terraform state show).
  • Update the TK-A001 rows in docs/policy-v2.md and docs/limits.md.

Done when: the three calls are held, E17 adds no false alarm (make eval), tracekit policy lint is clean and make test passes. Report the #357 pool's score after your change in the PR.

Activity

  1. hossainzarif23 commented on Oct 24, 2026

    @hossainzarif23
    Contributor

    I would like to work on this issue. Please assign me.

  2. juliasadler commented on Oct 24, 2026

    @juliasadler
    Contributor

    I'll take this. I'll extend TK-A001 in tracekit/policy2/packs/coding.yaml to hold cdk destroy (including npx/pnpm dlx and the other launchers the rule already reads), pulumi stack rm and terraform/tofu state rm, following how #356 added terragrunt (same option groups, pack version bump, tests in tests/test_signer_policy.py, deny/benign cases, and updated TK-A001 rows in docs/policy-v2.md and docs/limits.md). Will also report the #357 pool's new score in the PR.

  3. LoopGlitch26 commented on Oct 24, 2026

    @LoopGlitch26
    MemberAuthor

    It's yours @hossainzarif23, thanks! #356 (terragrunt) is the closest model: same option groups, tests, corpus cases and docs rows. Two small things: sign off your commits (git commit -s) for the DCO check, and @ritamgh is touching TK-A001's terraform part for a newline fix, so rebase on main before you open the PR.

  4. juliasadler commented on Oct 24, 2026

    @juliasadler
    Contributor

    Noted it is assigned to @hossainzarif23 — stepping back from this one, no overlap from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions