Blacklist / whitelist an IP from the API

Modified on Tue, 05 Dec 2023 at 04:46 PM

It is possible to blacklist / whitelister an IP address from the API or the dashboard.

From the dashboard

On the Fasterize configuration screen, in « My applications », click on the « WAF » application.

On the « WAF » application, you can add a new access rule to whitelist or blacklist a list of IP addresses.

To add an access rule, click on « New acces rule »

You need to define a label, then specify the targets with a line break between each target. 

You can choose to activate or deactivate the access rule. 

Click on the « Add » button, then on « Save setting » to confirm your changes.

From the API

You will find the API token on your dashboard and the identifier of your configuration in the dashboard URL of your configuration. For example, has for configuration ID 1. 

# Fill in the blacklist ip adresses

curl -i -H 'Content-Type: application/json' -H 'Authorization: $myApiToken' -X PATCH$config_id/ -d '{"security": { "deny": ["adresseIP1", "adresseIP2"] }}'

# Fill in the whitelist ip adresses

curl -i -H 'Content-Type: application/json' -H 'Authorization: $myApiToken' -X PATCH$config_id/ -d '{"security": { "allow": ["adresseIP1", "adresseIP2"] }}'

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article