Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

22.2 KB
Raw Blame
id: infrastructure-teardown
version: 1
title: Infrastructure destroyed or removed
description: >
  An agent tears down infrastructure, a namespace, a whole cloud bucket, or a
  cloud project, resource group, cluster or stack. Plans and individual pod or
  object deletions are excluded. These commands may be legitimate maintenance
  but warrant review; the rule does not assert that deletion succeeded.
severity: high
status: experimental
posture: detect
taxonomy:
  beacon_category: risky-command
  owasp_llm: LLM06

# Command prefixes accept environment assignments, relative executable paths, and
# sudo execution options. Value-taking sudo options consume their argument;
# inspection modes such as sudo -l/-v are not execution prefixes.
match: >
  e.event.action == "command.executed" && (
    e.command.command.matches("(^|[;&|\\n])[ \\t]*(?:(?:then|do|else)[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*(?:sudo[ \\t]+(?:(?:-[ugCDRTp][ \\t]*(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|--(?:user|group|close-from|chdir|chroot|command-timeout|prompt)(?:=|[ \\t]+)(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|-[nEHkPSb]+|--(?:non-interactive|preserve-env(?:=[A-Za-z0-9_,]+)?|set-home|reset-timestamp|stdin|background))[ \\t]+)*(?:--[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*)?(?:[^\\s;&|<>#\\x27\"`=]*/)?(?:terraform|tofu)(?:[ \\t]+-chdir=[^\\s;&|]+)?[ \\t]+(?:destroy|apply(?:[ \\t]+(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)*?[ \\t]+-destroy(?:=true)?)(?:[ \\t]|$|[;&|\\n<>#])") ||
    e.command.command.matches("(^|[;&|\\n])[ \\t]*(?:(?:then|do|else)[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*(?:sudo[ \\t]+(?:(?:-[ugCDRTp][ \\t]*(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|--(?:user|group|close-from|chdir|chroot|command-timeout|prompt)(?:=|[ \\t]+)(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|-[nEHkPSb]+|--(?:non-interactive|preserve-env(?:=[A-Za-z0-9_,]+)?|set-home|reset-timestamp|stdin|background))[ \\t]+)*(?:--[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*)?(?:[^\\s;&|<>#\\x27\"`=]*/)?(?:pulumi|cdk)[ \\t]+destroy(?:[ \\t]|$|[;&|\\n<>#])") ||
    e.command.command.matches("(^|[;&|\\n])[ \\t]*(?:(?:then|do|else)[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*(?:sudo[ \\t]+(?:(?:-[ugCDRTp][ \\t]*(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|--(?:user|group|close-from|chdir|chroot|command-timeout|prompt)(?:=|[ \\t]+)(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|-[nEHkPSb]+|--(?:non-interactive|preserve-env(?:=[A-Za-z0-9_,]+)?|set-home|reset-timestamp|stdin|background))[ \\t]+)*(?:--[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*)?(?:[^\\s;&|<>#\\x27\"`=]*/)?kubectl(?:[ \\t]+(?:-n|--namespace|--context|--kubeconfig)(?:=|[ \\t]+)[^\\s;&|]+)*[ \\t]+delete[ \\t]+(?:namespace|namespaces|ns)(?:/[^\\s;&|<>#\\x27\"]+)?(?:[ \\t]|$|[;&|\\n<>#])") ||
    e.command.command.matches("(^|[;&|\\n])[ \\t]*(?:(?:then|do|else)[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*(?:sudo[ \\t]+(?:(?:-[ugCDRTp][ \\t]*(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|--(?:user|group|close-from|chdir|chroot|command-timeout|prompt)(?:=|[ \\t]+)(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|-[nEHkPSb]+|--(?:non-interactive|preserve-env(?:=[A-Za-z0-9_,]+)?|set-home|reset-timestamp|stdin|background))[ \\t]+)*(?:--[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*)?(?:[^\\s;&|<>#\\x27\"`=]*/)?aws(?:[ \\t]+--(?:profile|region|endpoint-url)[ \\t]+[^\\s;&|]+)*[ \\t]+(?:s3[ \\t]+rb|(?:cloudformation[ \\t]+delete-stack|eks[ \\t]+delete-cluster)|s3api[ \\t]+delete-bucket)(?:[ \\t]|$|[;&|\\n<>#])") ||
    e.command.command.matches("(^|[;&|\\n])[ \\t]*(?:(?:then|do|else)[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*(?:sudo[ \\t]+(?:(?:-[ugCDRTp][ \\t]*(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|--(?:user|group|close-from|chdir|chroot|command-timeout|prompt)(?:=|[ \\t]+)(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|-[nEHkPSb]+|--(?:non-interactive|preserve-env(?:=[A-Za-z0-9_,]+)?|set-home|reset-timestamp|stdin|background))[ \\t]+)*(?:--[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*)?(?:[^\\s;&|<>#\\x27\"`=]*/)?aws(?:[ \\t]+--(?:profile|region|endpoint-url)[ \\t]+[^\\s;&|]+)*[ \\t]+s3[ \\t]+rm\\b[^;&|\\n#]*[ \\t]--recursive(?:[ \\t]|$|[;&|\\n<>#])") ||
    e.command.command.matches("(^|[;&|\\n])[ \\t]*(?:(?:then|do|else)[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*(?:sudo[ \\t]+(?:(?:-[ugCDRTp][ \\t]*(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|--(?:user|group|close-from|chdir|chroot|command-timeout|prompt)(?:=|[ \\t]+)(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|-[nEHkPSb]+|--(?:non-interactive|preserve-env(?:=[A-Za-z0-9_,]+)?|set-home|reset-timestamp|stdin|background))[ \\t]+)*(?:--[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*)?(?:[^\\s;&|<>#\\x27\"`=]*/)?gcloud(?:[ \\t]+--(?:project|account|configuration)(?:=|[ \\t]+)[^\\s;&|]+)*[ \\t]+(?:projects[ \\t]+delete|container[ \\t]+clusters[ \\t]+delete|storage[ \\t]+buckets[ \\t]+delete)(?:[ \\t]|$|[;&|\\n<>#])") ||
    e.command.command.matches("(^|[;&|\\n])[ \\t]*(?:(?:then|do|else)[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*(?:sudo[ \\t]+(?:(?:-[ugCDRTp][ \\t]*(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|--(?:user|group|close-from|chdir|chroot|command-timeout|prompt)(?:=|[ \\t]+)(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|-[nEHkPSb]+|--(?:non-interactive|preserve-env(?:=[A-Za-z0-9_,]+)?|set-home|reset-timestamp|stdin|background))[ \\t]+)*(?:--[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*)?(?:[^\\s;&|<>#\\x27\"`=]*/)?gcloud(?:[ \\t]+--(?:project|account|configuration)(?:=|[ \\t]+)[^\\s;&|]+)*[ \\t]+storage[ \\t]+rm\\b[^;&|\\n#]*[ \\t](?:--recursive|-r)(?:[ \\t]|$|[;&|\\n<>#])") ||
    e.command.command.matches("(^|[;&|\\n])[ \\t]*(?:(?:then|do|else)[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*(?:sudo[ \\t]+(?:(?:-[ugCDRTp][ \\t]*(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|--(?:user|group|close-from|chdir|chroot|command-timeout|prompt)(?:=|[ \\t]+)(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|-[nEHkPSb]+|--(?:non-interactive|preserve-env(?:=[A-Za-z0-9_,]+)?|set-home|reset-timestamp|stdin|background))[ \\t]+)*(?:--[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*)?(?:[^\\s;&|<>#\\x27\"`=]*/)?gsutil[ \\t]+(?:-m[ \\t]+)?(?:rb(?:[ \\t]|$|[;&|\\n<>#])|rm\\b[^;&|\\n#]*[ \\t]-[a-zA-Z]*[rR][a-zA-Z]*(?:[ \\t]|$|[;&|\\n<>#]))") ||
    e.command.command.matches("(^|[;&|\\n])[ \\t]*(?:(?:then|do|else)[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*(?:sudo[ \\t]+(?:(?:-[ugCDRTp][ \\t]*(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|--(?:user|group|close-from|chdir|chroot|command-timeout|prompt)(?:=|[ \\t]+)(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+|-[nEHkPSb]+|--(?:non-interactive|preserve-env(?:=[A-Za-z0-9_,]+)?|set-home|reset-timestamp|stdin|background))[ \\t]+)*(?:--[ \\t]+)?(?:[A-Za-z_][A-Za-z0-9_]*=(?:(?:[^\\s;&|<>#\\x27\"`]+|\\x27[^\\x27\\n]*\\x27|\"[^\"\\n]*\")+)?[ \\t]+)*)?(?:[^\\s;&|<>#\\x27\"`=]*/)?az[ \\t]+(?:group[ \\t]+delete|aks[ \\t]+delete|storage[ \\t]+container[ \\t]+delete)(?:[ \\t]|$|[;&|\\n<>#])")
  )

emit:
  reason: "Infrastructure destroyed or removed"

tests:
  - name: match_1_terraform_destroy_auto_approve
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "terraform destroy -auto-approve" }
        session: { id: s1 }
  - name: match_2_tofu_chdir_infra_destroy
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "tofu -chdir=infra destroy" }
        session: { id: s1 }
  - name: match_3_pulumi_destroy_yes
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "pulumi destroy --yes" }
        session: { id: s1 }
  - name: match_4_cdk_destroy_force
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "cdk destroy --force" }
        session: { id: s1 }
  - name: match_5_kubectl_context_prod_delete_namespace_app
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl --context prod delete namespace app" }
        session: { id: s1 }
  - name: match_6_kubectl_delete_ns_app
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl delete ns app" }
        session: { id: s1 }
  - name: match_7_aws_s3_rb_s3_company_force
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "aws s3 rb s3://company --force" }
        session: { id: s1 }
  - name: match_8_aws_s3_rm_s3_company_recursive
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "aws s3 rm s3://company --recursive" }
        session: { id: s1 }
  - name: match_9_aws_s3api_delete_bucket_bucket_company
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "aws s3api delete-bucket --bucket company" }
        session: { id: s1 }
  - name: match_10_aws_region_us_east_1_cloudformation_delete_stack_stack_name_app
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "aws --region us-east-1 cloudformation delete-stack --stack-name app" }
        session: { id: s1 }
  - name: match_11_aws_eks_delete_cluster_name_prod
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "aws eks delete-cluster --name prod" }
        session: { id: s1 }
  - name: match_12_gcloud_projects_delete_prod
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "gcloud projects delete prod" }
        session: { id: s1 }
  - name: match_13_gcloud_container_clusters_delete_prod
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "gcloud container clusters delete prod" }
        session: { id: s1 }
  - name: match_14_gcloud_storage_buckets_delete_gs_company
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "gcloud storage buckets delete gs://company" }
        session: { id: s1 }
  - name: match_15_gcloud_storage_rm_recursive_gs_company
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "gcloud storage rm --recursive gs://company" }
        session: { id: s1 }
  - name: match_16_gsutil_m_rm_r_gs_company
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "gsutil -m rm -r gs://company" }
        session: { id: s1 }
  - name: match_17_gsutil_rb_gs_company
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "gsutil rb gs://company" }
        session: { id: s1 }
  - name: match_18_az_group_delete_name_prod_yes
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "az group delete --name prod --yes" }
        session: { id: s1 }
  - name: match_19_az_aks_delete_name_prod_resource_group_prod
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "az aks delete --name prod --resource-group prod" }
        session: { id: s1 }
  - name: match_20_az_storage_container_delete_name_data
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "az storage container delete --name data" }
        session: { id: s1 }
  - name: no_match_1_terraform_plan
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform plan" }
        session: { id: s1 }
  - name: no_match_2_terraform_plan_destroy
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform plan -destroy" }
        session: { id: s1 }
  - name: no_match_3_tofu_plan_destroy
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "tofu plan -destroy" }
        session: { id: s1 }
  - name: no_match_4_terraform_state_list
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform state list" }
        session: { id: s1 }
  - name: no_match_5_kubectl_delete_pod_old_pod
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl delete pod old-pod" }
        session: { id: s1 }
  - name: no_match_6_kubectl_get_namespace
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl get namespace" }
        session: { id: s1 }
  - name: no_match_7_aws_s3_rm_s3_company_one_txt
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "aws s3 rm s3://company/one.txt" }
        session: { id: s1 }
  - name: no_match_8_gcloud_storage_rm_gs_company_one_txt
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "gcloud storage rm gs://company/one.txt" }
        session: { id: s1 }
  - name: no_match_9_aws_cloudformation_list_stacks
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "aws cloudformation list-stacks" }
        session: { id: s1 }
  - name: no_match_10_az_group_list
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "az group list" }
        session: { id: s1 }
  - name: no_match_11_terraform_plan_echo_destroy
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform plan; echo destroy" }
        session: { id: s1 }
  - name: no_match_12_terraform_plan_echo_destroy
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform plan\necho destroy" }
        session: { id: s1 }
  - name: no_match_13_aws_s3_ls_echo_recursive
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "aws s3 ls; echo --recursive" }
        session: { id: s1 }
  - name: no_match_14_terraform_plan_destroy
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform plan # destroy" }
        session: { id: s1 }
  - name: no_match_15_terraform_destroyer
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform destroyer" }
        session: { id: s1 }
  - name: no_match_16_kubectl_delete_configmap_app
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl delete configmap app" }
        session: { id: s1 }
  - name: no_match_17_kubectl_get_pods_echo_delete_namespace_prod
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl get pods; echo delete namespace prod" }
        session: { id: s1 }
  - name: newline
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "true\nterraform destroy -auto-approve" }
        session: { id: s1 }
  - name: then
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "if true; then terraform destroy -auto-approve" }
        session: { id: s1 }
  - name: do
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "for x in a; do terraform destroy -auto-approve" }
        session: { id: s1 }
  - name: else
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "if false; then true; else terraform destroy -auto-approve" }
        session: { id: s1 }
  - name: redirect_or_comment_1
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "terraform destroy -auto-approve 2>/dev/null" }
        session: { id: s1 }
  - name: redirect_or_comment_2
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "terraform destroy -auto-approve >/dev/null 2>&1" }
        session: { id: s1 }
  - name: redirect_or_comment_3
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "terraform destroy -auto-approve&>/dev/null" }
        session: { id: s1 }
  - name: redirect_or_comment_4
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "terraform destroy -auto-approve # maintenance" }
        session: { id: s1 }
  - name: mention_1
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "echo \"terraform destroy -auto-approve\"" }
        session: { id: s1 }
  - name: mention_2
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "grep -F \"terraform destroy -auto-approve\"" }
        session: { id: s1 }
  - name: mention_3
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "git commit -m \"terraform destroy -auto-approve\"" }
        session: { id: s1 }
  - name: wrong_event_action
    verdict: no_match
    events:
      - event: { action: tool.invoked }
        command: { command: "terraform destroy -auto-approve" }
        session: { id: s1 }
  - name: terraform_apply_destroy
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "terraform apply -destroy -auto-approve" }
        session: { id: s1 }
  - name: tofu_apply_destroy
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "tofu apply -destroy" }
        session: { id: s1 }
  - name: terraform_apply_flags
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "terraform -chdir=infra apply -auto-approve -destroy" }
        session: { id: s1 }
  - name: terraform_destroy_true
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "terraform apply -destroy=true" }
        session: { id: s1 }
  - name: namespace_slash
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl delete namespace/prod" }
        session: { id: s1 }
  - name: ns_slash
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl delete ns/prod" }
        session: { id: s1 }
  - name: kubectl_env
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "KUBECONFIG=/tmp/prod kubectl delete ns/prod" }
        session: { id: s1 }
  - name: sudo_kubectl
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "sudo -u deploy kubectl delete namespace/prod" }
        session: { id: s1 }
  - name: relative_terraform
    verdict: match
    events:
      - event: { action: command.executed }
        command: { command: "TF_WORKSPACE=prod ./bin/terraform apply -destroy" }
        session: { id: s1 }
  - name: plan_destroy
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform plan -destroy" }
        session: { id: s1 }
  - name: tofu_plan_destroy
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "tofu plan -destroy" }
        session: { id: s1 }
  - name: apply_not_destroy
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform apply -auto-approve" }
        session: { id: s1 }
  - name: apply_destroy_false
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform apply -destroy=false" }
        session: { id: s1 }
  - name: apply_quoted_flag
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform apply -var \"note=use -destroy later\"" }
        session: { id: s1 }
  - name: separate_destroy_flag
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "terraform apply; echo -destroy" }
        session: { id: s1 }
  - name: pod_slash
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl delete pod/app" }
        session: { id: s1 }
  - name: kubectl_env_get
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "KUBECONFIG=/tmp/prod kubectl get ns/prod" }
        session: { id: s1 }
  - name: namespace_prefix
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "kubectl delete ns-example" }
        session: { id: s1 }
  - name: sudo_terraform_echo
    verdict: no_match
    events:
      - event: { action: command.executed }
        command: { command: "sudo -u deploy echo \"terraform apply -destroy\"" }
        session: { id: s1 }