- Home
- Skills
- DevOps & Cloud
- .NET Azure Identity Review (secretless, managed identity)
.NET Azure Identity Review (secretless, managed identity)
It works on the laptop and becomes a rotation incident in production.
Free
Works with the AI Agents you already use
.NET Azure Identity Review (secretless, managed identity)
Example session with this skill installed
Scan this repo for Azure keys, SAS strings, SQL passwords and client secrets, then move it to DefaultAzureCredential with the right RBAC roles. Don't print any secret values.
- Read your context and instructions
- Compiled the net azure identity
Scan (real scanner output on a seeded test fixture)
bad/Program.cs:2: AZID007 SDK client built from a connection string (construct with endpoint/namespace Uri + TokenCredential)
var blobs = new BlobServiceClient(builder.Configuration.GetConnectionString("Storage"));
bad/Program.cs:3: AZID007 SDK client built from a connection string (construct with endpoint/namespace Uri + TokenCredential)
var bus = new ServiceBusClient(sbConnectionString);
bad/Program.cs:4: AZID004 ClientSecretCredential in code (prefer managed identity / workload identity federation)
var cred = new ClientSecretCredential(tenant, clientId, secret);
bad/Program.cs:5: AZID006 SAS token signature literal (sig=) in source/config (issue short-lived user-delegation SAS at runtime)
const string Sas = "https://acct.blob.core.windows.net/c/f.txt?sv=2024-08-04&sr=b&sig=AbC***3D";
bad/appsettings.json:3: AZID001 storage/Cosmos account key in a connection string or literal (use DefaultAzureCredential + RBAC)
"Storage": "DefaultEndpointsProtocol=https;AccountName=acct;AccountKey=Zm9***==;EndpointSuffix=core.windows.net",
bad/appsettings.json:4: AZID002 Service Bus / Event Hubs SAS key in a connection string (use fully-qualified namespace + TokenCredential)
"Bus": "Endpoint=sb://ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Zm9***==",
bad/appsettings.json:5: AZID003 SQL password in a connection string (use Authentication=Active Directory Default + managed identity)
"Sql": "Server=tcp:x.database.windows.net;Database=d;User ID=app;Password=Sup***!x;"
bad/appsettings.json:7: AZID005 client secret value in config (remove; use managed identity, or Key Vault reference if a secret is unavoidable)
"AzureAd": { "ClientSecret": "abc***23" }
8 finding(s).
Secret values are masked by the scanner (Zm9***==), so they never land in the agent transcript.
What the agent does next
| Finding | Change | RBAC role (scope) |
|---|---|---|
| AZID001 / AZID007 Blob | az.AddBlobServiceClient(new Uri(cfg["Storage:BlobEndpoint"])) + az.UseCredential(new DefaultAzureCredential()) | Storage Blob Data Contributor (storage account) |
| AZID002 / AZID007 Service Bus | az.AddServiceBusClientWithNamespace("ns.servicebus.windows.net") | Azure Service Bus Data Sender / Receiver (namespace) |
| AZID003 SQL | Authentication=Active Directory Default;, drop User ID/Password; CREATE USER [app] FROM EXTERNAL PROVIDER | db_datareader / db_datawriter |
| AZID004 / AZID005 | Remove ClientSecretCredential and AzureAd:ClientSecret; managed identity in Azure, OIDC federation in CI | n/a |
| AZID006 | Issue a 15-minute user-delegation SAS at runtime | Storage Blob Delegator + data role |
Verify
- Re-run scanner: expect
0 finding(s)., exit 0 dotnet buildanddotnet test
Rotate now: the storage key, Service Bus SAS key, SQL password and client secret were committed; removing them from the repo does not revoke them.
Connects securely to your tools. The creator never sees your data.
About this skill
AI agents copy Azure quick-starts: storage strings with AccountKey=, Service Bus strings with SharedAccessKey=, Password= in the SQL string, and ClientSecretCredential with the secret in appsettings.json. It works on the laptop and becomes a rotation incident in production.
This skill gives your agent the rules an Azure-experienced .NET reviewer applies, plus a stdlib-only Python scanner that flags 7 issues (AZID001-007) across .cs, json, Bicep and pipeline YAML before the agent changes anything.
What it does
- Scan, then rewrite clients to endpoint + TokenCredential (
AddAzureClients+DefaultAzureCredential), name the least-privilege data-plane role, then verify (re-scan, dotnet build, dotnet test) - Per-service before/after: Blob, Queue, Service Bus, Event Hubs, Cosmos DB, Azure SQL (
Active Directory Default), Key Vault, user-delegation SAS - Output: file:line, rule, before/after, RBAC role + scope, and a "rotate now" flag for committed secrets
Rules flagged
| Code | Finding |
|---|---|
| AZID001 | Storage/Cosmos AccountKey= |
| AZID002 | Service Bus/Event Hubs SharedAccessKey= |
| AZID003 | SQL Password= (skipped when Active Directory auth is used) |
| AZID004 | ClientSecretCredential in code |
| AZID005 | Client secret value in config |
| AZID006 | SAS sig= literal |
| AZID007 | SDK client constructed from a connection string |
Targets .NET 8+ with Azure.* SDKs (written for .NET 10). The scanner is heuristic, line-based and read-only: it writes nothing, makes no network calls, skips placeholders like <your-key> / ${VAR} / __TOKEN__, and masks secret values in its output. It does not prove an identity has the right role. MIT licensed.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.
Scanner is line-based and heuristic. Skips placeholders and environment variables. Does not verify if the target identity has the actual RBAC roles assigned in Azure.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed today
- Free with an Agensi account