Hello EnterpriseArchitect, Thanks for reaching out on Microsoft Q&A and really appreciate your patience while we looked into this.
For comprehensive perimeter protection against Layer 7 attacks (e.g., SQL Injection, Cross-Site Scripting), the recommended best practice is to place your APIM instance behind an Azure Application Gateway with Web Application Firewall (WAF) enabled. This approach creates a layered defense-in-depth, ensuring that malicious traffic is inspected and blocked before it can reach your API endpoints.
While APIM provides built-in security features like authentication (OAuth 2.0, JWT validation), rate limiting, and IP filtering, the WAF adds a critical, dedicated layer for web application security.
Recommended Architecture
The most secure and common pattern is:
- Azure Application Gateway (with WAF enabled): Acts as the public-facing entry point, terminating SSL/TLS traffic and applying WAF rules.
- Azure API Management: Deployed in internal VNet mode, making it inaccessible from the public internet. It receives clean traffic from the Application Gateway and applies API-specific policies.
- Backend APIs: The final destination for traffic, often also deployed in a secure VNet.
Alternatively, if you require global-scale load balancing and WAF protection, you can use Azure Front Door instead of Application Gateway.
Documentation for reference:
- Secure Azure API Management using Application Gateway with WAF: This article provides the detailed "how-to" guide for integrating APIM in an internal VNet with an Application Gateway.
- Architectural best practice to protect APIs with Azure Application Gateway and WAF: This article provides a high-level overview of the recommended architecture.
- Azure Application Gateway WAF Overview: Provides an overview of the WAF capabilities within Application Gateway.
- Azure security baseline for API Management: The official security baseline for APIM recommends deploying it behind a reverse proxy like Application Gateway for enhanced protection.
For a solution that best suits your requirements, may I ask you to confirm the following details?
- Are the APIs publicly exposed to the Internet, or are they for internal use?
- Do you require load balancing and routing features at a global or regional scale?
- Are there specific compliance standards (e.g., PCI DSS, HIPAA) that you need to adhere to?
Looking forward to your response to assist you further. Thank You!