This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Managing Throttling
This section guides you through the following areas:
IP Whitelisting
IP whitelisting is a way of configuring a filter to extract a particular set of known IP addresses and grant the access to the given assets for requests comes from those IPs only. With introducing Advanced Throttling in WSO2 API Manager you can achieve IP whitelisting via the throttling features provided by Traffic Manager. For this we are creating an Advanced Throttling policy and attach it to the API.
Creating the Advanced Throttling policy
Login to the admin portal of WSO2 API Manager (https://<ip_address>:9443/admin).
Open Throttling Policies tab and navigate to Advanced Throttling.
Click ADD NEW POLICY to add a new Throttling tier.
Fill the details as below and click Add Conditional Group.
Open the Conditional Group added and fill the details.
Following is a example configuration.
Click Save.
You have successfully created the policy. Now we should engage this policy to an API.
Engage the policy with an API
Login to API Publisher https://<IP_address>:9443/publisher.
Edit API and go to Manage tab.
Enable Apply to API under Advance Throttling Policies and select the newly created Throttling policy.
Save and Publish the API.
Now the API will be accessible only by the IP specified in the throttling policy.
Blacklisting requests
By blacklisting requests, you can protect servers from common attacks and abuse by users. For example, if a malicious user misuses the system, all requests received from that particular user can be completely blocked. Tenant administrative users can block requests based on the following parameters:
Block calls to specific APIs
Block all calls from a given application
Block requests coming from a specific IP address
Block a specific user from accessing APIs
To blacklist a request,
Log in to the Admin Portal using the URL
https://localhost:9443/adminand your admin credentials.Click Black List under the Throttle Policies section and click Add Item.
Select the item to black list, enter a value and click Blacklist.
Note that you have to use "/" always infront of the ${context} value when blacklisting the APIs with API context. E.g. /test/1.0.0. The sample provided in the product does not include "/" due to a known issue.
You can temporary on/off the blacklisting condition by enabling/disabling the Condition status that is auto enabled when a blacklisting condition is created.
Blacklisting PhoneVerification API
As described above you can blacklist requests for APIs, by Applications, to IP Addresses and for Users. Let's see how we can blacklist the requests come to the PhoneVerification API that we published in Quick Start Guide.
Log in to the Admin Portal using the URL https://localhost:9443/admin
and your admin credentials.Click Black List under the Throttle Policies section and click Add Item.
Select API Context and provide the Context of PhoneVerification API with version as the Value.
Click Blacklist.
Now login to API Store using the URL https://localhost:9443/s
toreand invoke the API.
You will see the following response.