Install the Cloudflare Enforcer
If your organization uses Cloudflare, you can use HUMAN’s Cloudflare Enforcer to protect against malicious behavior. The Cloudflare Enforcer is installed using a Cloudflare Worker, or a snippet of code, and is deployed to your content delivery network (CDN). The Enforcer dictates how traffic should be handled per your organization’s standards.
You can learn how to install the Cloudflare Enforcer with this article.
This process uses the Deploy Tool, HUMAN’s recommended method for installing and updating the Enforcer. If you prefer a manual method, see our manual installation article.
Prerequisites
- A Cloudflare account with permissions to create API tokens
- Docker or Script, depending on your preferred method to run the deploy tool.
- For Docker, see how to install Docker Desktop with their documentation.
- For Script, install the following:
- An Enforcer configuration file,
enforcerConfig.json, which you can download from the Platform Settings > Enforcers, clicking on the appropriate Enforcer, and clicking Download configuration file . This file has the basic information for Enforcer functionality, such as your Application ID and remote authorization token, already filled in. Be sure to save it in a directory you’ll remember, like/deploy.
Create a Cloudflare API token
- Log in to your Cloudflare account.
- Navigate to My Profile > API Tokens > Create Token.
- Under Create custom token, click Get started.
- Enter a name for your token. Then, fill out the remaining fields according to the following:
Permissions
Account Resources
Zone Resources
- Click Continue to summary.
- Click Create token.
- Copy and save the token in a secure location.
This will be the only time you’ll see your token, so be sure to save it before closing the page!
Run the Deploy Tool
First, download and run the Deploy Tool. You can do this by either pulling a Docker image or running a script.
Docker method
Script method
Additional setup for Windows users
If you’re using Windows, you also need to complete additional steps to set up Docker:
- In your Windows search bar, search for and open Turn Windows features on or off.
- Find the Windows Hypervisor Platform feature and click its checkbox to enable it.
- Click OK to save your changes.
- Open Windows PowerShell as an Administrator.
- Copy and paste in
C:\Windows\System32\wsl.exe --update --web-download, then hit Enter.
- Pull the Docker image by running:
- Navigate to the directory where you saved
enforcerConfig.json. - Run the Deploy Tool with the following:
Deploy the Enforcer
After you run the Deploy Tool, you’ll be prompted with steps to deploy the Enforcer.
- When prompted, select Cloudflare Workers and hit Enter.
- Follow the prompts that appear to complete the setup process.
- After you complete the setup, confirm that the displayed details are correct, then enter
yto deploy the Enforcer.