Azure DevOps Variable Group Hygiene

    by Abdelrhman Fikri

    1

    Secrets in Azure DevOps usually leak in two quiet ways: a variable group where someone forgot the lock icon, and a pipeline file where a password was written as a literal.

    Free

    Security scanned

    Works with the AI Agents you already use

    What it does

    • Scans variable group JSON exports and pipeline YAML files in a folder
    • Flags secret-named variables and account-key connection strings stored as plain text
    • Flags secret-named pipeline variables that carry a literal value in YAML
    • Warns when a script step prints a secret variable or sets one without issecret=true
    • Warns about unused, empty and unresolved variable groups
    • Warns when a pull-request-triggered pipeline uses variable groups

    Who it's for

    Platform and DevOps engineers

    who own Azure DevOps pipelines and Library variable groups, and anyone cleaning up secrets before an audit or a pipeline migration.

    Azure DevOps Variable Group Hygiene

    Example session with this skill installed

    Command: python3 scripts/check_variable_groups.py examples/dirty

    • Read your context and instructions
    • Compiled the azure devops variable

    The sample has a pull-request-triggered pipeline with a literal password variable, a script that echoes it, and a variable group export with a storage key, an API key and a client secret stored as plain text.

    [BLOCKER] azure-pipelines.yml: line 12: pipeline variable 'sqlAdminPassword' is secret-named and has a literal value in YAML
    [WARN] azure-pipelines.yml: line 19: prints secret-named variable $(sqlAdminPassword) in a script step
    [WARN] azure-pipelines.yml: line 20: setvariable 'deployToken' looks secret but is missing issecret=true
    [WARN] azure-pipelines.yml: pipeline has a pr trigger and uses variable group(s) app-prod-secrets, legacy-shared; confirm secrets are not exposed to fork builds (a pipeline setting this file cannot show)
    [BLOCKER] groups.json: group 'app-prod-secrets' variable 'StorageConnection': storage account key in a connection string stored as a plain-text value
    [BLOCKER] groups.json: group 'app-prod-secrets' variable 'ApiKey': secret-named variable has a plain-text value (mark it secret or move it to Key Vault)
    [BLOCKER] groups.json: group 'app-prod-secrets' variable 'ClientSecret': secret-named variable has a plain-text value (mark it secret or move it to Key Vault)
    [WARN] groups.json: group 'app-prod-secrets' variable 'DbPassword': secret-named variable is not marked secret
    [WARN] groups.json: group 'app-prod-secrets': 3 secret-named variables in a library group; consider linking an Azure Key Vault
    [WARN] groups.json: group 'unused-old-group': not referenced by any scanned pipeline YAML (unused or referenced elsewhere)
    [WARN] groups.json: group 'empty-group': has no variables
    [WARN] groups.json: group 'empty-group': not referenced by any scanned pipeline YAML (unused or referenced elsewhere)
    [WARN] azure-pipelines.yml: references group 'legacy-shared' that is not in the exported group files
    Summary: 4 blocker(s), 9 warning(s), 2 file(s)
    

    Command: python3 scripts/check_variable_groups.py examples/clean

    The fixed version uses a Key Vault linked group, issecret=true and no literals, and returns exit code 0:

    Summary: 0 blocker(s), 0 warning(s), 2 file(s)
    

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Secrets in Azure DevOps usually leak in two quiet ways: a variable group where someone forgot the lock icon, and a pipeline file where a password was written as a literal. This skill gives your agent a deterministic, offline workflow for both. Export your variable groups to JSON, point the scanner at the export and your pipeline YAML, read the BLOCKER and WARN findings, and fix them with the included notes.

    The scanner is a single standard-library script. It makes no network calls, never talks to Azure DevOps and never modifies files. It reads variable group exports (a name, a type and a variables map), including Key Vault linked groups, and pipeline YAML. A secret-named variable with a plain-text value, a storage account key or password inside a connection string, a JWT-like token, or a literal value on a secret-named YAML variable is a blocker. Printing a secret variable in a script, setting a secret-looking variable without the issecret flag, a group nobody references, an empty group, a group the pipeline names but the export lacks, and a pull-request trigger that uses variable groups are warnings.

    Synthetic example files with expected output are included so you can verify the behaviour in seconds.

    • File-based only: it cannot see pipeline settings (for example whether secrets are available to fork builds), Key Vault access, or who can use a group.
    • YAML is read line by line, not parsed; templates, expressions and variables defined in other files are not resolved.
    • Variable group JSON must be exported by you; the skill does not connect to Azure DevOps. The expected shape is a name, a type and a variables map.
    • Secret names are matched by a fixed word list; unusual names may be missed.
    • Reports and explains; it does not rewrite your pipelines or change groups.

    The scanner is a single standard-library Python script. It makes no network calls and never writes files. Give it files or directories; it reads .json and .yml/.yaml. JSON files are treated as variable group exports: a list (or one object, or an object with a value list) whose entries have a name, an optional type (Vsts or AzureKeyVault) and a variables map. A variable is secret when isSecret is true. Secret-named variables (password, secret, token, key and similar names) with a non-empty plain value are blockers; connection-string account keys, shared access keys, passwords and JWT-like tokens are blockers wherever they appear as a plain value. YAML is read line by line, not with a full parser: variables blocks (name/value pairs and mapping form), group references, the pr trigger, setvariable logging commands and echo-style steps that print $(name) for a secret-named variable. Exit codes: 0 no blockers, 1 blockers found, 2 bad arguments. Optional --format json. It cannot see pipeline settings such as secrets for fork builds, Key Vault access policies, or permissions.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Frequently Asked Questions

    No. It only reads files you point it at.

    Findings name the variable and the problem. They do not echo plain-text values.

    Python 3.9 or newer, no packages to install.

    Yes. Secrets in a Key Vault linked group are treated as secret; the group is still checked for use and empty state.

    One or more BLOCKER findings. Warnings alone still exit 0.

    New in DevOps & Cloud

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.

    Free