Search code examples
wso2wso2-api-manager

is it possible to restrict access to specific rest API resource exept for some IP addresses in WSO2 API manager(3.2.0)?


for example I have a rest API called pizzadellivery and a resource called get prices and also set an endpoint and also set no Security, Rate Limiting & Scopes.is it possible to restrict access(call an api) to specific rest API resource except for some IP addresses in WSO2 API manager(3.2.0)? thanx


Solution

  • Yes, this is doabe by adding an Advanced rate limiting policy and associating it with the resource you want to protect.

    This is a 2 step exercise:

    1. Create an Advance Rate Limiting policy using the Admin Portal. When creating it, you can define the IP rages you need to restrict access. Follow link below [1] for more information.
    2. Once the new advanced rate limiting policy is created, you need to go to Publisher portal and apply the new rate limiting policy to the resource you need to restrict using the Resource page. For more detailed steps, check the below link [2]

    [1] https://apim.docs.wso2.com/en/latest/design/rate-limiting/introducing-throttling-use-cases/ [2] https://apim.docs.wso2.com/en/latest/design/rate-limiting/setting-throttling-limits/#resource-level-operation-level-rate-limiting