Check provider logo

AI services account has local (API key) authentication disabled

aiservices_account_local_auth_disabled

Severityhigh
Serviceaiservices
by Prowler

Azure AI services accounts (including Azure OpenAI and Azure AI Foundry) accept static API keys unless disableLocalAuth is true. With local authentication disabled, every request must use a Microsoft Entra ID token.

Risk

Static API keys never expire and carry no caller identity:

  • Confidentiality: a leaked key grants full data-plane access to models and data
  • Accountability: requests cannot be traced to a user or workload
  • Control: Conditional Access, RBAC scoping, and token lifetimes do not apply to keys
Run this check with Prowler CLI

prowler azure --checks aiservices_account_local_auth_disabled

Recommendation

Set disableLocalAuth to true and authenticate clients with managed identities or service principals through Microsoft Entra ID. Grant least-privilege roles such as Cognitive Services OpenAI User instead of sharing keys.

Remediation

CLI

az resource update --ids <account_resource_id> --set properties.disableLocalAuth=true

Native IaC
Terraform
Other
  1. Move every client to Microsoft Entra ID authentication (managed identity or service principal with the Cognitive Services User role)
  2. Run the Azure CLI command above, or deploy the Bicep or Terraform example
  3. Confirm that requests sent with an API key now return 401

Source Code

Resource Type

microsoft.cognitiveservices/accounts

References