Blocklist Builder
Build minimal CIDR blocklist from IP list
Output Format
Input Entries
Generated Blocklist
Generated blocklist will appear here
The Blocklist Builder aggregates lists of malicious or unwanted IP addresses into the minimal set of CIDR blocks for deny rules. Paste in hundreds of attacker IPs from threat feeds or abuse logs, set your aggregation threshold, and get back a compact set of CIDR blocks ready for firewall deployment -- with collateral analysis for every merged block.
Understanding Blocklists and Threat-Based Aggregation
Every organization that exposes services to the internet accumulates a list of IP addresses it wants to block. These come from threat intelligence feeds, brute-force attack logs, abuse reports, vulnerability scanners, and incident response investigations. The problem is volume: a busy web server might log hundreds of unique attacker IPs per day, and within a month you are looking at thousands of individual addresses that need deny rules.
Manually maintaining thousands of individual deny rules is impractical. Firewall rule evaluation is sequential on most platforms, so a blocklist with 2000 entries slows down packet processing for every connection, including legitimate traffic. Cloud security groups have hard rule limits that make it impossible to list every bad address individually. The solution is CIDR aggregation -- combining clusters of malicious addresses into broader network blocks that cover more addresses with fewer rules.
Unlike allowlist building, where you must never include an unauthorized address, blocklist aggregation involves a deliberate trade-off. If six out of eight addresses in a /29 block are confirmed malicious, blocking the entire block catches the other two addresses as collateral. Whether that is acceptable depends on the context. For a block owned by a known bulletproof hosting provider, the collateral risk is negligible. For a block in a residential ISP range, you might block legitimate users. This builder gives you the data to make that decision: it shows the exact collateral count and percentage for every aggregated block so you can choose your threshold intelligently.
How to Build a Minimal CIDR Blocklist
- Paste IP addresses from threat feeds, abuse reports, or access logs -- one per line, comma-separated, or mixed with CIDR notation.
- Set the aggregation threshold to control how aggressively addresses are combined (stricter means fewer false positives, more aggressive means fewer rules).
- The builder groups adjacent addresses into CIDR blocks, flagging any blocks that might catch unintended addresses.
- Review flagged blocks -- the builder highlights when it suggests blocking an entire
/24or larger network. - Copy the optimized blocklist in plain CIDR format for use in your firewall or security platform.
Blocklist Aggregation Examples
| Input (Malicious IPs) | Output CIDR | Notes |
|---|---|---|
203.0.113.10 through 203.0.113.15 | 203.0.113.8/29 | Covers 8 addresses; 6 are confirmed malicious |
198.51.100.0, 198.51.100.1, ..., 198.51.100.255 | 198.51.100.0/24 | Full /24 flagged for review |
192.0.2.5, 192.0.2.17 | 192.0.2.5/32, 192.0.2.17/32 | Too far apart to merge safely |
| 500 scattered IPs from a threat feed | ~80 CIDR blocks | Typical 6:1 compression ratio |
Threshold Modes
Strict: Only merge when ALL addresses in the resulting CIDR are in the input
Moderate: Merge when 75%+ of addresses in a CIDR block are in the input
Aggressive: Merge when 50%+ are in the input (higher collateral risk)
When to Use the Blocklist Builder
- Threat intelligence feeds -- Threat feeds often deliver hundreds of individual IPs daily; aggregate them before importing into your firewall.
- Incident response -- After a brute-force attack, consolidate attacker IPs from auth logs into efficient deny rules.
- Scanner blocking -- Mass scanners often originate from adjacent IP blocks; the builder detects and consolidates these automatically.
- Rate-limit rule optimization -- Reduce the number of rules in rate-limiting configurations by merging abusive source ranges.
- Cloud security group quotas -- AWS security groups limit rules per group; an optimized blocklist uses fewer entries.
How Blocklist Aggregation Differs from Allowlist Aggregation
Blocklist aggregation allows controlled over-blocking because the trade-off is different. With an allowlist, including an extra address creates a security hole. With a blocklist, including an extra address creates minor collateral blocking -- usually acceptable when the surrounding addresses are confirmed malicious.
Collateral Analysis
The builder reports collateral for each aggregated block:
203.0.113.8/29 (8 addresses)
|-- 6 addresses from input (malicious)
|-- 2 addresses NOT in input (collateral)
|-- Collateral rate: 25%
This lets you decide per-block whether the compression is worth the collateral risk. A /24 block where 240 of 256 addresses are malicious is usually safe to block entirely. A /24 where only 3 addresses are malicious should remain as individual /32 entries.
Understanding Block Ownership
When the builder suggests a broad block like a /24, it helps to know who owns it. A /24 belonging to a known bulletproof hosting provider is safe to block wholesale -- there is unlikely to be any legitimate traffic from it. A /24 belonging to a major cloud provider like AWS or Google Cloud is a different story, because legitimate customers share those ranges. Before accepting a broad block, look up the network owner using a WHOIS tool and consider the business impact of false positives.
Practical Advice for Blocklist Management
The most common mistake in blocklist management is "set and forget." You add a block of attacker IPs after an incident, the threat moves on to different infrastructure within a few weeks, and your blocklist grows indefinitely with entries that no longer serve a purpose. Stale blocklists slow down firewalls and make troubleshooting harder because you are never sure whether a connectivity issue is caused by a legitimate block rule or an obsolete one. Implement expiration dates on every blocklist entry -- 30 days for automated threat feeds, 90 days for incident response blocks, and manual review for anything longer.
Pay attention to the source quality of your threat intelligence. Free threat feeds vary enormously in accuracy, and blindly importing them can result in blocking CDN nodes, DNS resolvers, or other shared infrastructure that serves millions of legitimate users. Cross-reference at least two independent feeds before blocking an address, and start with a logging-only mode to see what traffic you would be blocking before you actually deny it. The Blocklist Builder's collateral analysis helps here -- if a suggested block has a high collateral rate, that is a signal to investigate further before deploying.
When you are building blocklists for geographic blocking, be aware that IP geolocation is imperfect. Country-level CIDR blocks from regional internet registries (RIRs) are authoritative, but commercial geolocation databases have error rates of 1-5% at the country level and much higher at the city level. If you need geographic restriction, prefer the RIR allocation data and accept that some edge cases will slip through.
Frequently Asked Questions
What is the difference between the Blocklist Builder and the Allowlist Builder? The Allowlist Builder never includes addresses outside your input -- accuracy is absolute. The Blocklist Builder offers adjustable thresholds that allow controlled over-blocking for better compression. Both produce minimal CIDR output, but they optimize for different security trade-offs.
Can the builder handle mixed IPv4 and IPv6 addresses? Yes. IPv4 and IPv6 addresses are processed separately, producing independent CIDR block lists for each address family. This matches how most firewalls handle dual-stack blocking rules.
How do I know if a suggested block is too broad?
The builder flags any block /24 or larger for review and shows the percentage of input addresses versus total addresses in the block. Blocks with less than 50% input coverage are flagged as high-collateral and kept as smaller individual entries by default.
Should I use strict or aggressive mode? Start with strict mode for your first pass. Switch to moderate or aggressive only if you are hitting rule count limits and need further compression. Aggressive mode is best suited for blocking known-bad network ranges (bulletproof hosters, abandoned IP space) where collateral risk is minimal.
How often should I rebuild my blocklist? For automated threat feeds, rebuild daily or weekly. For incident-response blocklists, rebuild after each incident and review monthly. Stale entries waste rule capacity and can cause unexpected blocking of reassigned IP space.
Can I export the output directly to my firewall platform? The output is a plain list of CIDR blocks. Use it with the iptables Rule Generator, nftables Rule Generator, or CIDR Allow/Deny Snippet Generator (nginx) to produce platform-specific deny rules.
Related Tools
- Allowlist Builder - Build minimal CIDR allowlist from IP list
- Rule Conflict Finder - Find duplicate, shadowed, or overlapping firewall rules
- iptables Rule Generator - Generate iptables rules from CSV
- CIDR Allow/Deny Snippet Generator (nginx) - Generate nginx allow/deny directives from CIDR list
- AWS Security Group Rule Generator - Generate AWS Security Group rules from CSV