Sitemap
Daniel Ellis Research

Daniel Ellis Research

Research Software Architect specialising in High-Performance Computing and Data Visualisation — PhD in Atmospheric Chemistry and Masters in Theoretical Physics.

Member-only story

Implementing a IP blocklist Worker

4 min readSep 22, 2026

--

If your application is remotely hosted and your provider does not allow you administrative or firewall privileges it is possible to block specific IPs using a CloudFlare worker.

Note

This article is a proof of concept. If you want to create a proper domain-wide firewall, I suggest reading the article below which builds on the tools used here.

Setting up the IP address API / Store

Storing the IP addresses.

We start by creating a key-value list that the worker can easily access. On our dashboard go to “Storage and Databases” then select “Workers KV”.

We then select new, and name it IP_BLOCKLIST . This is our key value store.

Once created copy the namespace code from the url:

https://dash.cloudflare.com/.../workers/kv/namespaces/<copy this alphanumeric string>

Creating an access token

--

--

Daniel Ellis Research
Daniel Ellis Research

Written by Daniel Ellis Research

Research Software Architect specialising in High-Performance Computing and Data Visualisation — PhD in Atmospheric Chemistry and Masters in Theoretical Physics.