- Is it possible to configure 42Crunch firewall for a given service using the REST API?
- We ideally want to deploy the configuration (blocking level / protection token) dynamically when we deploy the service.
Yes, it is possible. The way this works is that you will call an API that will generate the configuration.
A sample Python script can be provided by 42Crunch support upon request, illustrating how to generate a V1 configuration and a protection token.
There are two API calls we use here: one to generate the config and one to create a token associated to that config.
Please note that you cannot generate a token unless a configuration already exists.
The config generation call takes the API Firewall blockingLevel as parameter.
This script prints the token value on screen, so you will need to adapt that for your use case. You can only retrieve the token value at creation time.
42Crunch documentation: read more