thomast1906/api-security-review
Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.
npx skills add https://github.com/thomast1906/github-copilot-agent-skills --skill api-security-review
Performs comprehensive security reviews of Azure API Management configurations, policies, and network architecture with focus on OWASP API Security Top 10 and Azure Security Benchmark.
Activate this skill when users need:
| ID | Threat | APIM Mitigation |
|----|--------|-----------------|
| API1 | Broken Object Level Authorization | Policy: validate-jwt + check user claims for resource ownership |
| API2 | Broken Authentication | Policy: OAuth 2.0 (validate-jwt), no plaintext credentials |
| API3| Broken Object Property Level Authorization | Policy: Validate input/output schemas, mask sensitive fields |
| API4 | Unrestricted Resource Consumption | Policy: rate-limit-by-key (per user/subscription), quota enforcement |
| API5 | Broken Function Level Authorization | Policy: Validate JWT scopes/roles per operation |
| API6 | Unrestricted Access to Sensitive Business Flows | Policy: Advanced rate limiting, CAPTCHA integration |
| API7 | Server Side Request Forgery (SSRF) | Network: VNet Internal mode, Private Link to backends |
| API8 | Security Misconfiguration | Infrastructure: TLS 1.3, disable weak ciphers, NSG rules |
| API9 | Improper Inventory Management | Governance: Azure API Center, version tracking, deprecation |
| API10 | Unsafe Consumption of APIs | Policy: Validate backend responses, timeout policies |
See references/SECURITY_CONTROLS.md for complete 60+ control checklist across 9 categories
Tool: mcp_azure_mcp_get_azure_bestpractices
Intent: "Azure API Management security best practices"
Tool: mcp_azure_mcp_documentation search
Query: "APIM security best practices OWASP"
Tool: azure_resources-query_azure_resource_graph
Intent: "Get API Management instances with network configuration and SKU details"
Check: APIM instances deployed in VNet Internal mode (no public IP)
// Azure Resource Graph Query
resources
| where type == 'microsoft.apimanagement/service'
| extend vnetType = properties.virtualNetworkType
| where vnetType != 'Internal'
| project name, resourceGroup, location, vnetType, sku=properties.sku.name
Expected: vnetType == 'Internal' for all production APIM instances
Risk if External: Gateway endpoint exposed to public internet, larger attack surface
Check: Azure Front Door connects to APIM via Private Link (not public origin)
Validation Steps:
Private Link (not Custom or Public)Approved (not Pending)Risk if Public: Traffic goes over public internet, no zero-trust architecture
Check: APIs use OAuth 2.0 (validate-jwt policy) or subscription keys (not both for sensitive APIs)
Policy Review:
<!-- GOOD: OAuth for sensitive APIs -->
<validate-jwt header-name="Authorization">
<openid-config url="https://login.microsoftonline.com/{tenant}/..." />
<required-claims>
<claim name="scp" match="any">
<value>api.read</value>
</claim>
</required-claims>
</validate-jwt>
<!-- BAD: No authentication -->
<policies>
<inbound>
<base />
<!-- No validate-jwt or check-header -->
</inbound>
</policies>
Risk if Missing: Unauthenticated access to sensitive data, API abuse
Check: All APIs have rate limiting (rate-limit-by-key or quota-by-key)
Policy Review:
<!-- GOOD: Per-user rate limiting -->
<rate-limit-by-key calls="1000" renewal-period="3600"
counter-key="@((string)context.Variables['userId'])" />
<!-- BAD: No rate limiting -->
<policies>
<inbound>
<base />
<!-- No rate-limit-by-key -->
</inbound>
</policies>
Risk if Missing: API4 Unrestricted Resource Consumption, DDoS vulnerability
Check: TLS 1.2+ only, no SSL 3.0/TLS 1.0/TLS 1.1
Azure Portal Validation:
Risk if Enabled: Vulnerable to BEAST, POODLE, CRIME attacks
Check: All secrets/certificates stored in Azure Key Vault (not in policies or code)
Policy Review:
<!-- GOOD: Secret from Key Vault -->
<set-header name="X-API-Key">
<value>{{api-backend-key}}</value> <!-- Named value linked to Key Vault -->
</set-header>
<!-- BAD: Hardcoded secret -->
<set-header name="X-API-Key">
<value>sk-abc123xyz789</value>
</set-header>
Risk if Hardcoded: Secret exposure in logs, code repositories, APIM exports
Check: CORS policies have specific origins (not * wildcard for production)
<!-- GOOD: Specific origins -->
<cors allow-credentials="true">
<allowed-origins>
<origin>https://app.example.com</origin>
</allowed-origins>
</cors>
<!-- Warning: ACCEPTABLE FOR DEV: Wildcard -->
<cors allow-credentials="false">
<allowed-origins>
<origin>*</origin>
</allowed-origins>
</cors>
<!-- BAD: Wildcard with credentials -->
<cors allow-credentials="true">
<allowed-origins>
<origin>*</origin> <!-- Security risk! -->
</allowed-origins>
</cors>
Risk: CSRF attacks, credential theft if misconfigured
Check: Error responses don't leak sensitive information (stack traces, internal IPs)
Policy Review:
<!-- GOOD: Generic error -->
<on-error>
<set-body>@{
return new JObject(
new JProperty("error", "Internal server error"),
new JProperty("correlationId", context.Variables["correlationId"])
).ToString();
}</set-body>
</on-error>
<!-- BAD: Detailed error -->
<on-error>
<set-body>@{
return context.LastError.Message; // Might contain stack trace, DB connection strings
}</set-body>
</on-error>
Risk: Information disclosure (API3, API8)
When performing security review, structure findings as:
Example:
apim-api-marketplace-prod-uks deployed in VNet External mode with gateway endpoint 10.2.1.4 exposed via public IP az apim update --name apim-api-marketplace-prod-uks --resource-group rg-apim-prod-uks \
--virtual-network-type Internal
nslookup apim-api-marketplace-prod-uks.azure-api.net should return internal IP only| Control ID | Category | Requirement | APIM Implementation |
|------------|----------|-------------|---------------------|
| NS-1 | Network Segmentation | Isolate workloads | VNet Internal mode |
| NS-2 | Private Connectivity | Private Link/Endpoints | Front Door → APIM Private Link |
| NS-4 | DDoS Protection | Enable DDoS Standard or ingress with DDoS | Front Door Premium (DDoS included) |
| IA-2 | Secure Authentication | OAuth/MFA | validate-jwt with Entra ID |
| IA-5 | MFA Enforcement | Require MFA | Entra ID Conditional Access |
| DP-1 | Data at Rest Encryption | Encrypt sensitive data | Azure Managed Disks encryption |
| DP-3 | Data in Transit Encryption | TLS 1.2+ | APIM TLS 1.3, disable weak protocols |
| DP-4 | Encryption Key Management | Azure Key Vault | All secrets in Key Vault |
| LT-1 | Centralized Logging | Log all security events | App Insights, Azure Monitor |
| LT-4 | Audit Logging | Tamper-proof audit trail | Azure Activity Log, diagnostic logs |
| IM-1 | Managed Identities | Avoid service accounts | APIM Managed Identity |
| IM-3 | Least Privilege | RBAC | Custom roles per environment |
| GS-1 | Policy Enforcement | Azure Policy | Require VNet Internal, TLS 1.2+ |
Skill Version: 1.0
Last Updated: 29 January 2026
Primary Knowledge: SECURITY_CONTROLS_CHECKLIST.md, references/SECURITY_CONTROLS.md
Take thomast1906/api-security-review from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.