dcg

CircleCI

cicd.circleci

Protects against destructive CircleCI operations like deleting contexts, removing secrets, deleting orbs/namespaces, or removing pipelines.

  • 6blocking rules
  • 10safe patterns
  • 2Critical
  • 3High
  • 1Medium
~/.config/dcg/config.toml
[packs]
enabled = ["cicd.circleci"]

Evaluated when a command contains circleci.

Blocking rules

Each rule ID is cicd.circleci:<name>. Use it in allowlists and [policy.rules].

  1. circleci-context-delete

    Critical

    circleci context delete removes contexts and their secrets.

    Explanation
    Deleting a CircleCI context removes all secrets stored within it. Any pipeline jobs that reference this context will fail immediately. Secret values cannot be recovered after deletion and must be manually re-entered. Safer alternatives: - circleci context list: Review contexts before deletion - circleci context show: Inspect context secrets (names only) - Document secret names before removing context
  2. circleci-namespace-delete

    Critical

    circleci namespace delete removes an orb namespace.

    Explanation
    Deleting a namespace removes all orbs within that namespace from the registry. This is a cascading deletion that affects every orb published under this namespace. All pipelines using any orb from this namespace will fail. Safer alternatives: - circleci namespace list: Review namespaces first - circleci orb list: Inventory orbs in namespace - Delete individual orbs instead if needed
  3. circleci-api-delete-envvar

    High

    curl DELETE against CircleCI envvar endpoints removes environment variables.

    Explanation
    Making DELETE requests to CircleCI environment variable endpoints removes variables from projects. Pipelines depending on these variables will fail on next run. Variable values cannot be recovered after deletion. Safer alternatives: - GET request first: Review variable exists - Update variable value instead of deleting - Use circleci CLI for safer operations
  4. circleci-context-remove-secret

    High

    circleci context remove-secret deletes secrets from a context.

    Explanation
    Removing a secret from a context makes it unavailable to all jobs using that context. Pipelines depending on this secret will fail. The secret value cannot be retrieved after removal. Safer alternatives: - circleci context show: Review secrets in context first - Update the secret value instead of removing - Document secret value externally before removal
  5. circleci-orb-delete

    High

    circleci orb delete removes an orb from the registry.

    Explanation
    Deleting an orb removes it from the CircleCI orb registry. Any pipeline using this orb will fail on the next run. If other teams or projects depend on this orb, their CI/CD will break without warning. Safer alternatives: - circleci orb info: Review orb details and usage - Deprecate the orb instead of deleting - Check for dependent projects before deletion
  6. circleci-pipeline-delete

    Medium

    circleci pipeline delete removes pipeline history.

    Explanation
    Deleting pipeline history removes records of past builds, including logs, artifacts, and test results. This affects audit trails and debugging capabilities. The history cannot be recovered once deleted. Safer alternatives: - circleci pipeline list: Review pipelines before deletion - Export logs and artifacts before deletion - Consider archiving rather than deleting

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • circleci-context-list
  • circleci-orb-list
  • circleci-orb-info
  • circleci-pipeline-list
  • circleci-project-list
  • circleci-namespace-list
  • circleci-config-validate
  • circleci-local-execute
  • circleci-policy-status
  • circleci-diagnostic