Skip to main content
The azure canary plants ~/.azure/service-principal-credentials.json with a tokenEndpoint field redirected to Snare. When the Azure SDK loads this file and attempts to fetch an OAuth token, the request goes to Snare instead of login.microsoftonline.com.

What gets planted

~/.azure/service-principal-credentials.json

Reliability: Medium

Fires only when the Azure SDK explicitly loads this credential file. The SDK must:
  1. Discover or be pointed at ~/.azure/service-principal-credentials.json
  2. Attempt a token fetch using the credentials in this file
Agents that use DefaultAzureCredential and walk through the standard credential chain will attempt to load service principal credentials from well-known paths, which includes this file.

Trigger conditions

  • Agent uses DefaultAzureCredential and reaches the service principal credential step in the chain
  • Agent explicitly loads ~/.azure/service-principal-credentials.json
  • Agent calls azure.identity.ClientSecretCredential pointing at the tenant ID in this file
  • Any Azure SDK get_token() call that resolves to these credentials

False positives

None unless you have a real Azure service principal workflow that loads from this exact path. Agents that authenticate via environment variables (AZURE_CLIENT_ID, AZURE_CLIENT_SECRET) or managed identity don’t load this file — no false positive risk.

Plant

Teardown

Removes ~/.azure/service-principal-credentials.json if it was created by Snare. Does not touch other ~/.azure/ files.