跳转到正文
报告库
用途分类 / 其他用途

Azure Quotas Skill 安全审计

作者说它能做什么(原文)

Check/manage Azure quotas and usage across providers. For deployment planning, capacity validation, region selection. WHEN: \"check quotas\", \"service limits\", \"current usage\", \"request quota increase\", \"quota exceeded\", \"validate capacity\", \"regional availability\", \"provisioning limits\", \"vCPU limit\", \"how many vCPUs available in my subscription\".

第三方安全检查结论

先别安装或运行

已检查文件
5
发现的风险
4
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 2 项风险
高风险

Bash 脚本把未转义的参数和 Azure 响应拼入 Python 程序

原文依据:4 处
发现了什么

脚本从第四个位置参数取得 REGION,并把 `$REGION` 直接展开到 `python3 -c` 的单引号 f-string 中;它还把完整的 `$USAGES_JSON` 展开进三单引号 Python 字符串。两者都不是作为数据安全传给 Python。含有引号和 Python 语法的特制区域参数,或异常/被操纵的 CLI JSON 字符串,可以结束字符串并改变要执行的 Python 代码。

为什么需要注意

成功利用时,运行检查脚本会以当前用户身份执行额外的本地 Python 代码,可读取该用户可访问的文件和凭据,或修改文件。普通 Azure 区域名和正常响应不会自行触发此问题。

风险成立,但候选描述有一处错误:REGION 来自第二个参数,不是第四个。脚本将 Azure 返回的完整 JSON 和用户提供的 REGION 直接展开进 `python3 -c` 源码。若其中包含能闭合 Python 字符串的内容,可能改变本机执行的 Python 代码。用户可要求作者通过环境变量、stdin 或参数传递纯数据,并限制 region 为 Azure 区域名格式。

scripts/check-quota.sh:16来自代码打开原文件
RESOURCE_PROVIDER="${1:?Usage: $0 <resource-provider> <region> [resource-name] [subscription-id]}"REGION="${2:?Usage: $0 <resource-provider> <region> [resource-name] [subscription-id]}"RESOURCE_NAME="${3:-}"SUBSCRIPTION_ID="${4:-}"
查看另外 3 个位置
scripts/check-quota.sh:67来自代码打开原文件
    echo "$QUOTAS_JSON" | python3 -c "import json, sysquotas = json.load(sys.stdin)usages = json.loads('''$USAGES_JSON''')usage_lookup = {}for u in usages:    usage_lookup[u['name']] = u.get('properties', {}).get('usages', {}).get('value', 0)for q in quotas:    name = q['name']    limit = q.get('properties', {}).get('limit', {}).get('value', 0)    used = usage_lookup.get(name, 0)    avail = limit - used    print(f'{name:<40} $REGION{\"\":<4} {limit:<10} {used:<10} {avail:<10}')"fi
scripts/check-quota.sh:61来自代码打开原文件
    QUOTAS_JSON=$(az quota list --scope "$SCOPE" -o json 2>/dev/null)    USAGES_JSON=$(az quota usage list --scope "$SCOPE" -o json 2>/dev/null)    printf "%-40s %-10s %-10s %-10s %-10s\n" "Resource" "Region" "Limit" "Usage" "Available"    printf "%-40s %-10s %-10s %-10s %-10s\n" "--------" "------" "-----" "-----" "---------"    echo "$QUOTAS_JSON" | python3 -c "import json, sysquotas = json.load(sys.stdin)usages = json.loads('''$USAGES_JSON''')
scripts/check-quota.sh:77来自代码打开原文件
for q in quotas:    name = q['name']    limit = q.get('properties', {}).get('limit', {}).get('value', 0)    used = usage_lookup.get(name, 0)    avail = limit - used    print(f'{name:<40} $REGION{\"\":<4} {limit:<10} {used:<10} {avail:<10}')"fi
中风险

只读配额检查会静默安装可执行的 Azure CLI 扩展

原文依据:4 处
发现了什么

Skill 将检查脚本作为首选方式,而两个脚本在发现扩展缺失时都立即执行 `az extension add --name quota --yes`。这会下载并持久安装代码到用户的 Azure CLI 环境;脚本没有在安装前征求确认,也没有固定扩展版本或校验包。

为什么需要注意

一次本应只读取配额的操作会改变本机 CLI 环境并运行新安装的扩展代码。风险取决于扩展来源、下载链路和当时提供的版本;现有证据不能证明扩展已被篡改。

这是与查询相关但有持久副作用的真实行为。Skill 优先要求使用这些脚本,而脚本在扩展缺失时自动执行带 `--yes` 的安装;PowerShell 和 Bash 版本均如此。安装会改变用户的 Azure CLI 环境,且可见代码没有确认、版本固定或完整性校验。用户可预装并固定可信版本,或要求脚本在安装前明确确认。

SKILL.md:101来自说明文档打开原文件
Pre-built scripts handle quota extension installation, usage queries, and capacity calculation. Use these instead of constructing commands manually. A single call returns limits, usage, and available capacity.| Script | Purpose | Usage ||--------|---------|-------|| `scripts/check-quota.ps1` | Returns limit, usage, and available capacity for all quotas (or a single quota when resource name is provided) | Primary script for quota checks || `scripts/check-quota.sh` | Same as above (bash) | Primary script for quota checks |
查看另外 3 个位置
scripts/check-quota.sh:21来自代码打开原文件
# Ensure the quota extension is installedif ! az extension list --query "[?name=='quota'].name" -o tsv 2>/dev/null | grep -q quota; then    echo "Installing quota extension..."    az extension add --name quota --yes 2>/dev/nullfi
scripts/check-quota.ps1:32来自代码打开原文件
# Ensure the quota extension is installed$ext = az extension list --query "[?name=='quota'].name" -o tsv 2>$nullif (-not $ext) {    Write-Host "Installing quota extension..."    az extension add --name quota --yes 2>$null}
SKILL.md:99来自说明文档打开原文件
## ScriptsPre-built scripts handle quota extension installation, usage queries, and capacity calculation. Use these instead of constructing commands manually. A single call returns limits, usage, and available capacity.| Script | Purpose | Usage ||--------|---------|-------|| `scripts/check-quota.ps1` | Returns limit, usage, and available capacity for all quotas (or a single quota when resource name is provided) | Primary script for quota checks || `scripts/check-quota.sh` | Same as above (bash) | Primary script for quota checks |
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。未发现风险
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
中风险

故障排查流程可能在未确认目标的情况下改变账户配额护栏

原文依据:4 处
发现了什么

Skill 可在“quota exceeded”故障排查时调用,同时将“当前配额不足”直接引向 `az quota update` 示例,但没有要求在提交前确认订阅、区域、资源名和新上限。该操作需要管理权限并会改变 Azure 账户配置。

为什么需要注意

如果代理把检测到配额不足视为提交请求的授权,它可能对错误订阅或区域申请过大的限制。配额增加本身不部署资源,但会放宽原有容量护栏,使后续误部署或费用增长的上限更高。

Skill 的授权用途确实包括排查超限和提交增加请求,并给出会更改指定订阅、区域和资源配额上限的活动命令。示例使用占位符,因此不会自行锁定真实目标;但可见流程没有要求在执行前向用户复核目标和数值。拥有 Quota Request Operator 权限时,误填可能改变错误范围的账户护栏。用户可将管理权限与只读检查分离,并要求提交前显示并确认完整 scope、资源名和新上限。

SKILL.md:31来自说明文档打开原文件
Invoke this skill when:- **Planning a new deployment** - Validate capacity before deployment- **Selecting an Azure region** - Compare quota availability across regions- **Troubleshooting quota exceeded errors** - Check current usage vs limits- **Requesting quota increases** - Submit increase requests via CLI or Portal- **Comparing regional capacity** - Find regions with available quota- **Validating provisioning limits** - Ensure deployment won't exceed quotas
查看另外 3 个位置
SKILL.md:184来自说明文档打开原文件
### Workflow 3: Request Quota Increase**Scenario:** Current quota is insufficient for deployment```bash# Request increase for VM quotaaz quota update \  --resource-name standardDSv3Family \  --scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus \  --limit-object value=500 \  --resource-type dedicated# Check request statusaz quota request status list \  --scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus```
SKILL.md:51来自说明文档打开原文件
| **MCP Server** | `azure-quota` MCP server — **NEVER use this. It is unreliable. Always use `az quota` CLI instead.** || **Required Permission** | Reader (view) or Quota Request Operator (manage) |
SKILL.md:44来自说明文档打开原文件
|--------------|-------------|| **Primary Tool** | Azure CLI (`az quota`) - **USE THIS FIRST, ALWAYS** || **Extension Required** | `az extension add --name quota` (MUST install first) || **Key Commands** | `az quota list`, `az quota show`, `az quota usage list`, `az quota usage show` || **Complete CLI Reference** | [commands.md](./references/commands.md) || **Azure Portal** | [My quotas](https://portal.azure.com/#blade/Microsoft_Azure_Capacity/QuotaMenuBlade/myQuotas) - Use only as fallback || **REST API** | Microsoft.Quota provider - **Unreliable, do NOT use first** || **MCP Server** | `azure-quota` MCP server — **NEVER use this. It is unreliable. Always use `az quota` CLI instead.** || **Required Permission** | Reader (view) or Quota Request Operator (manage) |
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。发现 1 项风险
中风险

Skill 把配额余量误称为实际区域资源可用性

原文依据:4 处
发现了什么

文档明确宣称配额“代表每个区域的可用容量”和“Quotas = Resource Availability”,并建议据此寻找“最佳区域”。脚本实际只计算配额上限减当前用量;这个数值表示账户获准的余量,并不验证特定 SKU 此刻能否在该区域分配。

为什么需要注意

用户可能根据较高配额余量选择区域并承诺部署计划,但实际分配仍可能失败,造成上线延期或错误的区域、容量和成本决策。

文档把配额直接等同于区域资源可用性,并建议据此选择“最佳”区域;实际脚本只计算订阅配额上限减当前用量。该差值是账户配额余量,不能证明某个 SKU 当时存在物理容量。依赖该结论可能导致错误的部署或区域决策。用户可要求作者把结果标为“quota headroom”,并在区域选择前增加具体 SKU 的实时可分配性验证。

SKILL.md:19来自说明文档打开原文件
Azure quotas (also called service limits) are the maximum number of resources you can deploy in a subscription. Quotas:- Prevent accidental over-provisioning- Ensure fair resource distribution across Azure- Represent **available capacity** in each region- Can be increased (adjustable quotas) or are fixed (non-adjustable)**Key Concept:** **Quotas = Resource Availability**If you don't have quota, you cannot deploy resources. Always check quotas when planning deployments or selecting regions.
查看另外 3 个位置
SKILL.md:149来自说明文档打开原文件
### Workflow 2: Compare Quotas Across Regions**Scenario:** Find the best region for deployment based on available capacity
scripts/check-quota.sh:46来自代码打开原文件
    USAGE=$(az quota usage show \        --resource-name "$RESOURCE_NAME" \        --scope "$SCOPE" \        --query "properties.usages.value" -o tsv)    AVAILABLE=$((LIMIT - USAGE))    printf "%-30s %-10s %-10s %-10s %-10s\n" "Resource" "Region" "Limit" "Usage" "Available"    printf "%-30s %-10s %-10s %-10s %-10s\n" "--------" "------" "-----" "-----" "---------"    printf "%-30s %-10s %-10s %-10s %-10s\n" "$RESOURCE_NAME" "$REGION" "$LIMIT" "$USAGE" "$AVAILABLE"else
scripts/check-quota.sh:41来自代码打开原文件
    LIMIT=$(az quota show \        --resource-name "$RESOURCE_NAME" \        --scope "$SCOPE" \        --query "properties.limit.value" -o tsv)    USAGE=$(az quota usage show \        --resource-name "$RESOURCE_NAME" \        --scope "$SCOPE" \        --query "properties.usages.value" -o tsv)    AVAILABLE=$((LIMIT - USAGE))    printf "%-30s %-10s %-10s %-10s %-10s\n" "Resource" "Region" "Limit" "Usage" "Available"    printf "%-30s %-10s %-10s %-10s %-10s\n" "--------" "------" "-----" "-----" "---------"    printf "%-30s %-10s %-10s %-10s %-10s\n" "$RESOURCE_NAME" "$REGION" "$LIMIT" "$USAGE" "$AVAILABLE"else

Skill 逻辑拆解

8 个说明模块

两个检查脚本会查询指定提供商和区域的配额上限与用量;未提供订阅 ID 时,它们使用 Azure CLI 当前选中的订阅,并把包含订阅 ID 的完整作用域打印到输出。

查看原文
scripts/check-quota.sh:27来自代码打开原文件
# Resolve subscriptionif [ -z "$SUBSCRIPTION_ID" ]; then    SUBSCRIPTION_ID=$(az account show --query id -o tsv)fiSCOPE="/subscriptions/$SUBSCRIPTION_ID/providers/$RESOURCE_PROVIDER/locations/$REGION"echo "Checking quotas in scope $SCOPE"
scripts/check-quota.ps1:39来自代码打开原文件
# Resolve subscriptionif (-not $SubscriptionId) {    $SubscriptionId = az account show --query id -o tsv}$scope = "/subscriptions/$SubscriptionId/providers/$ResourceProvider/locations/$Region"Write-Host "Checking quotas in scope $scope"

该 Skill 不仅提供只读检查,还给出会提交 Azure 配额变更请求的命令,并说明管理操作需要 Quota Request Operator 权限。

查看原文
SKILL.md:51来自说明文档打开原文件
| **MCP Server** | `azure-quota` MCP server — **NEVER use this. It is unreliable. Always use `az quota` CLI instead.** || **Required Permission** | Reader (view) or Quota Request Operator (manage) |
SKILL.md:184来自说明文档打开原文件
### Workflow 3: Request Quota Increase**Scenario:** Current quota is insufficient for deployment```bash# Request increase for VM quotaaz quota update \  --resource-name standardDSv3Family \  --scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus \  --limit-object value=500 \  --resource-type dedicated# Check request statusaz quota request status list \  --scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus```

全量检查会列出某个订阅、提供商和区域的所有配额,并将配额名称、上限、当前用量和剩余量输出成表格。这些信息属于云账户容量与使用情况,若代理把输出复制到共享聊天或日志,可能暴露账户运营信息。

查看原文
scripts/check-quota.sh:61来自代码打开原文件
    QUOTAS_JSON=$(az quota list --scope "$SCOPE" -o json 2>/dev/null)    USAGES_JSON=$(az quota usage list --scope "$SCOPE" -o json 2>/dev/null)    printf "%-40s %-10s %-10s %-10s %-10s\n" "Resource" "Region" "Limit" "Usage" "Available"    printf "%-40s %-10s %-10s %-10s %-10s\n" "--------" "------" "-----" "-----" "---------"
scripts/check-quota.ps1:72来自代码打开原文件
    $quotas = az quota list --scope $scope -o json 2>$null | ConvertFrom-Json    $usages = az quota usage list --scope $scope -o json 2>$null | ConvertFrom-Json    $usageLookup = @{}    foreach ($u in $usages) {        $usageLookup[$u.name] = $u.properties.usages.value    }    $results = foreach ($q in $quotas) {        $name = $q.name        $limitValue = $q.properties.limit.value        $usageValue = if ($usageLookup.ContainsKey($name)) { $usageLookup[$name] } else { 0 }        $available = $limitValue - $usageValue        [PSCustomObject]@{            Resource  = $name            Region    = $Region            Limit     = $limitValue            Usage     = $usageValue            Available = $available        }
从这里开始 · 工作说明SKILL.md
azure-quotas
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。 另有 2 个章节,可在原文件中查看。

文件引用关系图

5 处引用
哪些文件发起引用引用了什么
连线表示真实的文件引用,不是运行顺序。点击节点可高亮相关连线,并查看具体文件和原文位置。虚线表示还有文件需要定位。
文件与检查记录5 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文
  • scripts/check-quota.ps1已纳入全文
  • scripts/check-quota.sh已纳入全文
  • references/advanced-commands.md已纳入全文
  • references/commands.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
  • references/advanced-commands.md配套文件
  • references/commands.md配套文件
  • scripts/check-quota.ps1脚本
  • scripts/check-quota.sh脚本

代码和说明中提到的操作

连接外部网站
SKILL.md:48来自说明文档打开原文件
| **Complete CLI Reference** | [commands.md](./references/commands.md) || **Azure Portal** | [My quotas](https://portal.azure.com/#blade/Microsoft_Azure_Capacity/QuotaMenuBlade/myQuotas) - Use only as fallback || **REST API** | Microsoft.Quota provider - **Unreliable, do NOT use first** |
SKILL.md:55来自说明文档打开原文件
>> REST API and Portal can show misleading "No Limit" values — this does **not** mean unlimited capacity. It means the quota API doesn't support that resource type. Always start with `az quota` commands; fall back to [Azure service limits docs](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits) if CLI returns `BadRequest`.>
SKILL.md:239来自说明文档打开原文件
| `ExtensionNotFound` | Quota extension not installed | `az extension add --name quota` || `BadRequest` | Resource provider not supported by quota API | Check [service limits docs](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits) || `MissingRegistration` | Microsoft.Quota provider not registered | `az provider register --namespace Microsoft.Quota` |
运行命令
scripts/check-quota.sh:1来自代码打开原文件
#!/usr/bin/env bash# check-quota.sh
SKILL.md:85来自说明文档打开原文件
1. **List all quotas** for the resource provider:   ```bash   az quota list --scope /subscriptions/<id>/providers/<ProviderNamespace>/locations/<region>
SKILL.md:92来自说明文档打开原文件
3. **Use the `name` field** (not ARM resource type) in subsequent commands:   ```bash   az quota show --resource-name ManagedEnvironmentCount --scope ...
读取了多少行
852
文件校验值(用于核对版本)
44de2c4fc7b350a7abaa7a500a167eaede8fce7937dbeb17c57bc265c399f249