Update Cloudflare IP list
Overview
Cloudflare IP lists contain one or more IP addresses or IP ranges. These lists serve multiple purposes, including:
-
Filter incoming and outgoing traffic based on predefined rules associated with IP addresses. This allows for the prioritization, restriction, or blocking of traffic originating from specific IPs.
-
Control access to network resources, such as websites, applications, or APIs. By configuring rules based on IP addresses, they can restrict or grant access to specific areas of their infrastructure, enhancing security and compliance.
-
Identification and mitigation of threats by blocking traffic from known malicious IPs, suspicious sources, or those associated with nefarious activities. This proactive approach helps safeguard against various cyber threats, including DDoS attacks, brute force attacks, and malicious bot traffic.
This workflow template uses Cloudflare API to update an IP list daily to keep it up-to-date.
How the template works
-
Retrieve IPs: The template initiates by fetching a list of IP addresses from designated sources, such as network logs, databases, or threat intelligence feeds. These IP addresses may represent known malicious actors, legitimate users, or other entities interacting with the network.
-
Prepare IPs: Upon retrieving the IP addresses, the template processes and prepares the data for integration with Cloudflare's custom IP lists. This involves formatting the IP addresses according to Cloudflare's specifications and organizing them in a structured manner for efficient handling.
-
Update Cloudflare: The prepared list of IP addresses is then sent to Cloudflare via its API. The API is utilized to update the custom IP list, applying any necessary actions such as adding, removing, or modifying entries.
How to use the template
Step 1: Create Cloudflare Bearer token credentials
-
Generate a Cloudflare API token
-
Log in to the SimWorkflow.
-
Navigate to Credentials.
-
Click Create credentials button.
-
Select Bearer token tab.
-
Enter Cloudflare in the Name field.
-
Enter the Cloudflare API token in the Bearer token field.
-
Click Create credentials button.
Step 2: Use this workflow template
- Click Use this template button on the top right of this page.
- Click Update Cloudflare task and select Configuration tab.
- Select Cloudflare (Bearer Token) for the Credentials field.
- Click Save button.
- Toggle the Enable checkbox to enable the workflow definition.
Step 3: Define variables
-
Navigate to Workflow definitions.
-
Click Variables menu item from the three dots (more options) menu of the Update Cloudflare custom list workflow definition.
Step 3.1: Cloudflare Account ID
-
Enter cloudflareAccountId in the Variable key field.
-
Enter the Cloudflare account ID in the Variable value field.
-
Click Save variable button.
Step 3.2: Cloudflare custom list ID
-
Enter cloudflareListId in the Variable key field.
-
Enter the Cloudflare list ID in the Variable value field.
-
Click Save variable button.
Step 4: Define the schedule with cron expression
-
Navigate to Workflow definitions.
-
Click Schedule trigger menu item from the three dots (more options) menu of the Update Cloudflare custom list workflow definition.
-
Turn on Schedule trigger on field.
-
Select a user for User to start the workflow as field.
-
Enter @daily in the Schedule cron expression field.
-
Click Save schedule trigger button.