dcg

Azure DevOps CLI

platform.azure_devops

Protects against destructive Azure DevOps CLI extension operations like project delete, repos delete, pipeline delete, and permission reset

  • 23blocking rules
  • 2safe patterns
  • 2Critical
  • 12High
  • 9Medium
~/.config/dcg/config.toml
[packs]
enabled = ["platform.azure_devops"]

Evaluated when a command contains az, devops, repos, pipelines, boards, artifacts.

Blocking rules

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

  1. devops-project-delete

    Critical

    az devops project delete destroys a team project and every repository, pipeline, board and wiki in it.

    Explanation
    devops project delete removes an entire Azure DevOps team project: - ALL Git repositories in the project are deleted - ALL pipelines, releases, variable groups and service connections go - ALL work items, boards, queries and wikis go - Deleted projects sit in a recycle bin for a limited window and are then purged; recovery is a portal/support operation, not a CLI one Inventory the project first: az repos list --project PROJECT -o table az pipelines list --project PROJECT -o table
  2. repos-delete

    Critical

    az repos delete destroys a Git repository and its entire history.

    Explanation
    repos delete removes an Azure Repos Git repository: - Every branch, tag and commit on the server is destroyed - Pull requests, policies and their review history go with it - Pipelines pointing at the repository break - `--yes` skips the confirmation prompt entirely A local clone is the only remaining copy. Verify one exists and is current before running this: az repos show --repository REPO --project PROJECT
  3. boards-work-item-delete

    High

    az boards work-item delete removes a work item; with --destroy it is destroyed permanently.

    Explanation
    boards work-item delete removes a work item: - By default it moves to the project recycle bin and can be restored - `--destroy` bypasses the recycle bin and destroys it PERMANENTLY, including its history, links and attachments - `--yes` skips the confirmation prompt Read it first: az boards work-item show --id ID -o json > work-item-backup.json
  4. devops-invoke-delete

    High

    az devops invoke --http-method DELETE issues an arbitrary Azure DevOps DELETE request.

    Explanation
    devops invoke with DELETE calls the raw Azure DevOps REST API: - Any resource the API exposes can be deleted this way — projects, repositories, pipelines, policies, permissions - No CLI confirmation prompt and no `--yes` gate applies - dcg cannot tell WHICH resource this targets, so it is treated as the most destructive call the named area/resource allows Preview the same call read-only first: az devops invoke --area AREA --resource RESOURCE --http-method GET
  5. devops-security-group-delete

    High

    az devops security group delete removes a security group and every permission granted through it.

    Explanation
    devops security group delete removes an Azure DevOps group: - Every member loses the permissions the group granted - ACL entries naming the group are dropped, not transferred - Pipelines and policies that reference the group start failing List the membership first: az devops security group membership list --id GROUP-DESCRIPTOR
  6. devops-security-permission-reset-all

    High

    az devops security permission reset-all clears EVERY permission on a token for a user or group.

    Explanation
    devops security permission reset-all clears an entire ACL entry: - Every allow AND deny bit for that subject on that token is removed - Explicit DENY rules that were holding back access disappear too, so this can silently WIDEN access, not only narrow it - There is no per-bit undo; the ACL must be rebuilt Capture the current ACL first: az devops security permission show --id NAMESPACE --subject SUBJECT --token TOKEN
  7. devops-service-endpoint-delete

    High

    az devops service-endpoint delete removes a service connection and its stored credentials.

    Explanation
    devops service-endpoint delete removes a service connection: - Every pipeline using the connection fails on its next run - The stored secret (service principal key, PAT, cloud credential) is destroyed and cannot be read back from Azure DevOps - Re-creating it needs the original credential material again Find the users first: az devops service-endpoint show --id ENDPOINT-ID
  8. devops-team-delete

    High

    az devops team delete removes a team along with its board configuration.

    Explanation
    devops team delete removes an Azure DevOps team: - The team's backlog, boards, sprints and dashboards are removed - Area/iteration assignments made to the team are lost - Work items survive; the views onto them do not Record the configuration first: az devops team show --team TEAM --project PROJECT
  9. devops-user-remove

    High

    az devops user remove revokes a user's access to the whole organization.

    Explanation
    devops user remove removes a user from the organization: - The user loses access to every project immediately - Group memberships and per-project permissions are dropped - Their license is released and must be re-assigned on re-add - Work item history keeps the identity, so nothing is anonymised Downgrade instead of removing: az devops user update --user USER --license-type stakeholder
  10. devops-wiki-delete

    High

    az devops wiki delete removes a wiki and all of its pages.

    Explanation
    devops wiki delete removes an Azure DevOps wiki: - Every page and attachment in the wiki goes - A project wiki is backed by a Git repository; a code wiki is backed by a repo you own, so check which kind this is before assuming the content survives elsewhere Identify the wiki first: az devops wiki show --wiki WIKI --project PROJECT
  11. pipelines-delete

    High

    az pipelines delete removes a pipeline definition and its run history.

    Explanation
    pipelines delete removes an Azure Pipelines definition: - The definition and its run history are removed - Retained builds and their artifacts go with it - A YAML pipeline's file survives in the repository; a classic pipeline's definition does not exist anywhere else - `--yes` skips the confirmation prompt Export the definition first: az pipelines show --id ID -o json > pipeline-backup.json
  12. pipelines-variable-group-delete

    High

    az pipelines variable-group delete removes a shared variable group and its secrets.

    Explanation
    pipelines variable-group delete removes a variable group: - Every pipeline that links the group fails on its next run - Secret variables stored in the group are destroyed and cannot be read back from Azure DevOps - A group linked to Key Vault loses only the link, not the vault Export the non-secret values first: az pipelines variable-group show --group-id ID -o json
  13. repos-policy-delete

    High

    az repos policy delete removes a branch policy — the protection on a protected branch.

    Explanation
    repos policy delete removes a branch policy configuration: - Required reviewers, build validation, comment resolution and merge-strategy constraints stop being enforced immediately - Direct pushes to a previously protected branch become possible - Removing protection is usually the FIRST step of a destructive sequence, not the destructive step itself Export the policy before removing it: az repos policy show --id POLICY-ID -o json > policy-backup.json
  14. repos-ref-delete

    High

    az repos ref delete removes a server-side branch or tag.

    Explanation
    repos ref delete removes a Git reference on the server: - Commits reachable only from that ref become unreferenced and are garbage-collected in time - Deleting a release tag breaks reproducible builds - Open pull requests targeting the branch are abandoned Record the object id so the ref can be re-created: az repos ref list --repository REPO --filter heads/BRANCH
  15. boards-classification-node-delete

    Medium

    az boards area/iteration project delete removes a classification node from the project.

    Explanation
    boards area/iteration project delete removes a classification node: - Work items assigned to the node are reassigned to the path given by `--path`, silently moving them out of their sprint or area - Child nodes are removed with the parent - Team configurations referencing the node are invalidated See what is assigned first: az boards query --wiql "SELECT [System.Id] FROM workitems WHERE [System.AreaPath] UNDER 'PATH'"
  16. devops-extension-uninstall

    Medium

    az devops extension uninstall removes a marketplace extension organization-wide.

    Explanation
    devops extension uninstall removes an extension from the organization: - Pipeline tasks, widgets and hubs the extension provided disappear - Pipelines that reference its tasks fail to compile - Extension-owned data may be deleted with it Disable instead to keep the data: az devops extension disable --extension-id ID --publisher-id PUB
  17. devops-invoke-write

    Medium

    az devops invoke with PUT/PATCH/POST issues an arbitrary state-changing Azure DevOps request.

    Explanation
    devops invoke with PUT/PATCH/POST calls the raw Azure DevOps REST API: - A PUT or PATCH overwrites the target resource's state; a POST can create or trigger one - Overwriting a policy, permission ACL or pipeline definition can remove protection as effectively as a delete Read the current state first: az devops invoke --area AREA --resource RESOURCE --http-method GET
  18. devops-logout

    Medium

    az devops logout clears the stored Azure DevOps credential; with no --org it clears every organization.

    Explanation
    devops logout drops the cached PAT: - Without `--org`, ALL organizations are logged out at once - Nothing in Azure DevOps is destroyed, but every later `az devops` / `az repos` / `az pipelines` command in this environment fails until a PAT is supplied again Scope the logout: az devops logout --org https://dev.azure.com/ORG
  19. devops-security-group-membership-remove

    Medium

    az devops security group membership remove revokes a user's or group's membership.

    Explanation
    devops security group membership remove drops a membership: - The member loses every permission inherited from the group - Nested groups lose it transitively - Re-adding restores access, so this is recoverable Confirm the effect first: az devops security permission list --id NAMESPACE --subject SUBJECT
  20. devops-security-permission-reset

    Medium

    az devops security permission reset clears the named permission bits for a user or group.

    Explanation
    devops security permission reset clears specific permission bits: - The named bits revert to inherited, which may allow or deny - Clearing a DENY bit can grant access rather than remove it Capture the current ACL first: az devops security permission show --id NAMESPACE --subject SUBJECT --token TOKEN
  21. devops-wiki-page-delete

    Medium

    az devops wiki page delete removes a wiki page and its subtree.

    Explanation
    devops wiki page delete removes a page: - Child pages under the path are removed with it - A project wiki keeps Git history, so the content is recoverable from the backing repository Read it first: az devops wiki page show --path PATH --wiki WIKI
  22. pipelines-folder-delete

    Medium

    az pipelines folder delete removes a pipeline folder and the pipelines inside it.

    Explanation
    pipelines folder delete removes a pipeline folder: - Pipelines organised under the folder are removed with it - There is no per-pipeline confirmation List the contents first: az pipelines list --folder-path PATH -o table
  23. pipelines-variable-delete

    Medium

    az pipelines variable delete removes a pipeline or variable-group variable.

    Explanation
    pipelines variable delete removes a single variable: - Runs that read it fail or silently take a default - A secret variable's value cannot be read back before deletion, so it is unrecoverable once removed List the variables first: az pipelines variable list --pipeline-id ID

Safe patterns

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

  • az-devops-help
  • az-devops-help-short