Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Python script to update `firewalld` rules to restrict HTTPs traffic to CloudFlare IPs only

License

Notifications You must be signed in to change notification settings

robertripoll/cloudflare-firewall-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare Firewall Rules

This project is a tool for synchronizing firewall rules with the latest Cloudflare IP addresses.

It adds rules to firewalld allowing traffic coming from Cloudflare IP addresses on port 443.

Requirements

This project requires Python 3.10 or higher.

Installation

To install the project, follow these steps:

  1. Clone the repository:

git clone https://github.com/robertripoll/cloudflare-firewall-rules.git

  1. Install the dependencies:

pip install -r requirements.txt

Usage

To use the script, run the following command:

sudo python main.py

The command has to be run with sudo because firewall-cmd requires root privileges.

This will synchronize the firewall rules with the latest Cloudflare IP addresses.

License

This project is licensed under the MIT License.

About

Python script to update `firewalld` rules to restrict HTTPs traffic to CloudFlare IPs only

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages