When implementing API Management solutions, it is a common practice to use IP Whitelisting when interacting with certain trading partners. The idea being that only traffic presented from a specific IP Address (or range) can call your API Proxy. This usually isn’t used exclusively, but can be combined with other techniques to reduce your attack surface.
Trying to manage IP Whitelisting using Firewalls and Reverse Proxies can sometimes be a complex and messy endeavor but is pretty straightforward in Azure API Management.
In my demo, I added the Restrict caller IPs policy at the product level in the inbound section.
Once the policy has been added, you can add a specific IP Address or a range if the trading partner has multiple servers that you want to communicate with. The IP Addresses below are obviously fictitious.
Once enabled, if you try to call the API from an IP Address that has not been whitelisted you will get the following error:
You can find more information about this and other Azure API Management policies here.
One thought on “Azure API Management–IP Whitelisting”