IP Allowlists: Control the Scope of CIDR Ranges
Verify an IP exception’s scope, test CIDR boundaries and IPv6, then document its owner, review date and conditions for removal.

An exception request arrives: “Allow this IP so the integration works.” The risk often lies in the scope being added. A single address becomes a CIDR block, followed by a blanket exception that disables more controls than intended.
An IP allowlist should describe who can reach which service, through which control and for how long. The following procedure turns an imprecise request into a verifiable rule, with tests that catch incorrect masks and unnecessarily broad permissions.
Define exactly what the exception bypasses
Before selecting a prefix, identify the control involved. Allowing a connection through a firewall, bypassing a WAF rule and excluding an event from the SIEM are three different decisions. A failure on one application route does not justify suppressing every alert associated with the address.
Record the destination service, protocol, port and, where the product supports it, the affected path or operation. Add the integration owner and evidence of the requirement: a blocked event, outbound configuration or technical documentation from the provider.
Also verify that the IP corresponds to the source actually observed by the control. Behind a proxy, an address obtained from an untrusted header can undermine the entire allowlist. The requester’s identity and the network origin need separate verification.
Calculate the scope before accepting it
CIDR notation combines an address with a prefix length. For IPv4, /32 represents one address and /24 represents 256. RFC 4632 describes this prefix model and aggregation. A shorter prefix covers more addresses.
This fictional example uses a block reserved for documentation:
| Request | Effective scope |
|---|---|
192.0.2.64/32 |
One address |
192.0.2.64/28 |
192.0.2.64 through 192.0.2.79 |
192.0.2.0/24 |
192.0.2.0 through 192.0.2.255 |
These ranges are not interchangeable. Establish why each covered address needs access. A range announced by a provider can host other customers. Its association with the same organization does not mean that every workload within it should reach your service.
Apply the same discipline to IPv6. A /128 represents one address, while a network prefix can cover a vast set. Do not carry assumptions about IPv4 mask sizes over to an IPv6 address.
Reject ambiguous input instead of silently correcting it
Use a network address library to validate input and calculate boundaries. A text comparison such as “starts with 192.0.2” is not a CIDR check. It handles neither masks nor IPv6 formats correctly.
Python’s ipaddress module provides address and network objects. With strict=True, it rejects a network definition whose host bits are still set. This helps expose a poorly specified request before it becomes a rule.
from ipaddress import ip_address, ip_network
# Fictional range reserved for documentation.
network = ip_network("192.0.2.64/28", strict=True)
for candidate in ("192.0.2.63", "192.0.2.64", "192.0.2.79", "192.0.2.80"):
print(candidate, ip_address(candidate) in network)
The expected results are False, True, True, False. This verifies mathematical membership in the block, including its boundaries. It does not describe which addresses can be assigned to hosts in every architecture or the exact behavior of your firewall.
If someone supplies 192.0.2.70/28, do not silently replace it with 192.0.2.64/28. Show the resulting network and resolve the ambiguity in the request. The intended exception might have been for one address only.
Test the rule in the product that enforces it
The local calculation is an initial check. Then test the actual configuration in a suitable environment: an allowed source, a source just outside the range and a path that should receive no exception. Check rule ordering and the action actually applied.
Include IPv6 if the service accepts it. A policy covering only IPv4 can leave a different access path. Also define how to handle IPv4 addresses represented in IPv6 form when your components produce them. The parser and rule engine need to share that convention.
Capture a rule identifier in the logs. A successful test must show why the request was permitted. Otherwise, a broader existing rule can conceal a defect in the new configuration and give a misleading impression that it was validated.
Retain the other security controls
An expected network origin does not authenticate an account or guarantee how a request behaves. Keep the keys, signatures, certificates and application controls required for the integration. Limit the exception to the condition that was actually blocking legitimate traffic.
When an allowed address appears in threat intelligence, open a review. The reputation and context of a datacenter IP help explain the observation without automatically extending a block to every use of that provider.
Likewise, a good current reputation does not justify permanent access. The request must rest on a known access requirement. An external score is evidence for the decision; it cannot take responsibility for owning the rule.
Plan removal when the rule is created
Add a review date, owner and removal condition. For a provider with changing published ranges, define who monitors changes, how their origin is verified and how differences are tested before being applied.
Retain the previous version to support a controlled rollback. When an integration ends, remove its exception and confirm that no expected traffic still depends on it. The principles for reviewing IOC-based rules also apply to this maintenance discipline.
The final record should contain the request, exact network, boundary tests, retained controls and owner. If a public address warrants further investigation, consult its reputation report and timestamp the observation. The authorization will then remain explainable after a change of team or provider.
Frequently asked questions
- What is the difference between a /32 IP and a /24 network?
- In IPv4, /32 identifies one address. A /24 covers 256 addresses. Replacing a /32 exception with a /24 therefore expands its scope to the entire block.
- Does an allowlist replace authentication?
- No. An address can be shared, reassigned or used by a compromised device. Network access controls must remain combined with identity controls appropriate to the service.
- Should I allow a provider’s entire ASN?
- Only when the requirement justifies that scope and its consequences. For a specific integration, first identify the documented outbound ranges for that service and check how they change.
Related articles
Blocklists for Operational Threat Prevention: Test and Roll BackUse /app/blocklists to select, test, deploy, measure, and safely reverse IP or domain prevention controls.
Cloud IP Reputation: What AWS, Azure, and GCP Defenders Should Track in 2026Cloud IP addresses are shared, recycled, and abused at scale. Learn how to interpret reputation signals, reduce false positives, and align network security with platform-native controls across the three major hyperscalers.
ASN Reputation for Threat Intelligence: How Autonomous System Intelligence Improves Prioritization and Hunt ProgramsAn IP address is a snapshot; an autonomous system (ASN) is a neighborhood. Learn how to use ASN context safely for triage, fraud, and security operations—without mistaking a giant cloud for a monolithic "bad host".
Protect Your Infrastructure
Check any IP or domain against our threat intelligence database with indexed records.
Try the IP / Domain Checker