T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- SKILL.md:90
- Finding
- Subscription-Wide Azure Roles Exceed the Minimum Permissions Required<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:90-98`; `scripts/azure-roles.json:17-30` **Vulnerability Type**: Excessive Azure RBAC permissions **Risk Level**: Medium ### Vulnerable Code ```markdown ### Step 1: Create Service Principal az ad sp create-for-rbac --name auditclaw-scanner --role Reader --scopes /subscriptions/<SUBSCRIPTION_ID> ### Step 2: Add Security Reader Role az role assignment create --assignee <APP_ID> --role "Security Reader" --scope /subscriptions/<SUBSCRIPTION_ID> ``` The corresponding role configuration is: ```json { "role": "Reader", "scope": "Subscription", "reason": "Read access to all resource configurations (storage, compute, network, SQL, App Service)", "built_in_id": "acdd72a7-3385-48ef-bd42-f606fba81ae7" }, { "role": "Security Reader", "scope": "Subscription", "reason": "Read access to Microsoft Defender for Cloud status and security recommendations", "built_in_id": "39bc4728-0917-49c7-9d2c-d95423bc2eb4" } ``` ### Technical Analysis The Skill performs a limited set of configuration checks against Storage, Network Security Groups, Key Vault, SQL, Compute, App Service, and Defender pricing information. However, its setup instructions grant the built-in **Reader** and **Security Reader** roles across the entire subscription. These built-in roles provide visibility beyond the exact management-plane read operations used by the twelve declared checks. In particular, the policy states that Security Reader permits access to security recommendations, while the implementation only queries Defender pricing tiers. The behavior is read-only and does not permit direct Azure resource modification, but it violates least privilege by allowing broad subscription reconnaissance if the scanner identity is compromised. ### Attack Path 1. An operator follows the documented setup and grants Reader and Security Reader at subscription scope. 2. The service-principal client secret is exposed through an unrelated ...[truncated 940 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Define a custom Azure role containing only the management-plane read actions required by the implemented checks. 2. Restrict the role to the smallest feasible scope, such as selected resource groups when full-subscription coverage is not required. 3. Determine whether Defender pricing can be read through a narrowly scoped custom permission. If so, remove the built-in Security Reader assignment. 4. If Security Reader remains necessary, document the additional information it exposes and why that access is required. 5. Store the service-principal secret in an approved secret manager, rotate it regularly, and use short-lived or workload-identity credentials where possible. 6. Monitor sign-ins and management API activity associated with the scanner principal. ]]>
