
An IP allowlist for an API restricts which network addresses may send requests to it, accepting traffic only from a defined set of IPs or CIDR ranges. It works best when your integration has stable, predictable egress, such as a fixed NAT gateway or a data center connection. If you are starting today, your first move is to identify your true public egress IP after any NAT or proxy layer, then make sure your credentials are still protected independently of the network rule.
TL;DR:
- IP allowlists are effective only when your egress IPs are stable and predictable, such as through reserved NAT gateways or data center connections.
- Verify your actual public egress IP from production paths before configuring the allowlist, as NATs and proxies often rewrite source addresses.
- Use narrow CIDR ranges and document each entry with ownership information, review schedules, and expiration dates to minimize operational risks.
- Always test allowlist changes from the actual production runtime environment and keep emergency access routes in place before full enforcement.
- Pair IP allowlisting with robust identity verification methods like OAuth, JWT, or mTLS, because network controls alone do not confirm the requester’s identity.
DemivoltBuild More Reliable Business InfrastructureDemivolt provides compliant digital banking and payment infrastructure for businesses managing cross-border operations and international payments.Explore Demivolt
Table of Contents
- How IP allowlisting works at the network layer
- When an IP allowlist fits and where it breaks down
- Rolling out an allowlist without breaking production
- Verifying and monitoring your allowlist in production
- Why identity checks still matter alongside network rules
- A runbook checklist for ongoing governance
- What I’ve learned running allowlists in production
- A managed alternative with stable, audited API access
- Sources
- FAQ
How IP allowlisting works at the network layer
An IP allowlist evaluates the source IP address (or CIDR block) that reaches the API gateway or server, comparing it against a stored list of approved entries before allowing the request through. This check happens at the network or gateway layer, before any application logic runs.
The complication is that the IP your laptop or server thinks it has is rarely the IP the API actually sees. NAT gateways, forward proxies, and load balancers all rewrite the source address, and headers like X-Forwarded-For can list several IPs as a request hops through infrastructure. Gateways differ in whether they trust the first entry, the last entry, or something in between, as the Apigee AccessControl policy documentation notes when describing header handling options.

It is worth being clear about what this control actually proves: an allowlist confirms that a request arrived from an approved network location, nothing more. It says nothing about who or what sent it, which is why it is a network-layer control rather than an identity check.
When an IP allowlist fits and where it breaks down
IP allowlisting fits cleanly when your traffic originates from a small, stable set of addresses: a reserved NAT gateway, a static VPN endpoint, a data center connection, or a partner’s fixed backend server. In these cases, the address rarely changes and the operational cost of maintaining the list stays low.
It fits poorly in a few common situations:
- Mobile or browser-based clients, whose IPs shift constantly and cannot be reasonably enumerated.
- Serverless functions, where the underlying compute (and its egress IP) can change between invocations unless you explicitly configure static egress.
- Distributed developer teams, where home and coworking IPs change often enough to generate constant list churn.
Even in a good-fit scenario, allowlisting carries operational risk. Locking out your own administrators by enabling enforcement before adding your current IP is a well-documented failure mode, one that GitHub’s own documentation warns against directly. Spoofed or misread forwarding headers can also fool a poorly configured gateway into trusting the wrong address, and overly broad CIDR ranges quietly widen your attack surface while looking restrictive on paper. Perhaps the biggest risk is psychological: an allowlist can create a false sense of security if teams treat it as a substitute for authentication rather than one layer among several.
Rolling out an allowlist without breaking production
Implementing an allowlist safely is a sequencing problem as much as a configuration one. Follow this order:
- Inventory your egress paths. List every service, server, and function that will call the API, and identify the actual public egress IP for each, after NAT and proxy layers have done their work. As OpenAI’s IP allowlist guide points out, this often means running a test request from the exact runtime path, not your local workstation, since the two addresses frequently differ.
- Decide CIDR granularity. Use the narrowest range that covers your legitimate traffic. A single static IP is preferable to a /24 block whenever your infrastructure supports it.
- Document every entry. Record which system owns each address, why it was added, and when it should be reviewed.
- Configure entries through the provider’s API or CLI. Most platforms support this programmatically. Apigee, for instance, exposes calls to reserve, activate, and list static NAT IPs, as described in Google Cloud’s NAT provisioning docs. Store the resulting configuration in a key-value store or config management system rather than a shared spreadsheet.
- Add admin and emergency IPs before enabling enforcement, and run new entries in monitor mode first if the platform supports it.
- Roll out in stages: staging, then a canary slice of production traffic, then full enforcement, with the change scheduled and communicated to every team that depends on the API.
- Bulk-configure entries via API or CLI rather than a dashboard when you have more than a handful of addresses.
- Keep a rollback command ready before you flip enforcement on.
Pro Tip: Test from the exact production runtime path, not your laptop; the two egress IPs are rarely the same.
Verifying and monitoring your allowlist in production
Before trusting an allowlist rule, confirm what the gateway actually sees. Provider check tools and simple curl requests from each production path will show whether the observed source IP matches what you configured, and OpenAI’s documentation notes that changes to an allowlist entry may take up to 15 minutes to propagate, so verification should happen after that window, not immediately after saving. Validate X-Forwarded-For handling too: some gateways evaluate the first IP in the chain, others the last, and getting this wrong silently breaks enforcement.
- Confirm the evaluated source IP with a check tool or a curl request from the real runtime path.
- Watch for deny events and unusual traffic patterns through gateway logs and alerts.
- Keep a preapproved rollback and emergency access runbook so a locked-out admin route is a five-minute fix, not an incident.
A network control reduces exposure but does not replace identity checks, according to NIST SP 800-228, which frames IP restrictions as one layer among several rather than a standalone defense.
Why identity checks still matter alongside network rules
NIST SP 800-228 recommends pairing any IP restriction with runtime protections: authentication, authorization, schema validation, rate limiting, and proper token handling on every request. An allowlist narrows where traffic can come from; it does not verify who is making the call.
In practice, this means layering an allowlist with:
- Per-request authentication and authorization, using OAuth/OIDC, scoped API keys, or JWTs rather than trusting the network alone.
- Service-to-service identity, through mTLS or a framework like SPIFFE, plus short-lived tokens instead of long-lived static credentials.
- Gateway-level runtime protections, including schema validation, rate limiting, and field-level checks.
The OWASP REST Security Cheat Sheet is direct about this: require HTTPS and per-request authentication, and do not rely solely on API keys or IP controls to protect high-value resources. An allowlist earns its keep as a filter, not as the only gate.
A runbook checklist for ongoing governance
Add these items to your operational runbook so the allowlist stays healthy after launch:
- Inventory egress paths and re-verify them whenever infrastructure changes.
- Add admin and emergency IPs first, and keep monitor mode on for new entries before enforcement.
- Test from every production path, not just the one you remember.
- Set expiry dates on temporary entries and review the full list on a fixed schedule.
- Require change approval for any allowlist edit, and log who made it and why.
Pro Tip: Treat every allowlist entry like a credential: it needs an owner, an expiry, and an audit trail.
What I’ve learned running allowlists in production
I favor IP allowlists when egress is genuinely static, a reserved NAT gateway or fixed data center link. The surprise that catches teams most often is a cloud provider quietly rotating egress IPs during a maintenance window, silently breaking a rule nobody touched. Pairing the allowlist with token-based authentication meant that incident cost us a support ticket instead of a security gap.
— dd
A managed alternative with stable, audited API access
Building and maintaining your own egress infrastructure, reserved NATs, proxy layers, IP documentation, takes ongoing engineering time that many finance and operations teams would rather not spend. Some platforms offer businesses banking and payments APIs with predictable infrastructure behind them. They shift the operational burden of maintaining your own allowlist setup to the provider.

- Dedicated IBAN accounts with role-based user management for access control.
- SEPA and SWIFT payment processing built on regulated infrastructure.
- Virtual and physical payment cards issued and managed through the account structure.
For teams weighing a managed connectivity partner for stable egress more broadly, Quikturn’s enterprise networking solutions are worth a look. If your business needs a regulated banking layer instead, explore Demivolt’s business accounts or read about payment API capabilities to see whether a managed setup fits your integration better than a self-hosted one.
Sources
- IP allowlist | OpenAI API
- Guidelines for API Protection for Cloud-Native Systems (NIST SP 800-228, upd1)
- Restricting network traffic to your enterprise with an IP allow list | GitHub Docs
- REST Security - OWASP Cheat Sheet Series
FAQ
What is the difference between an IP allowlist and a firewall rule?
An IP allowlist for an API is typically enforced at the application or gateway layer and controls which addresses may reach a specific API or resource, while a firewall rule usually operates at the network perimeter across broader traffic. Both compare source IPs against approved lists, but an API allowlist is scoped to a single service’s access policy.
Can IPv6 addresses be used in an API allowlist?
Yes, most modern API platforms support IPv6 CIDR notation alongside IPv4, though you should confirm this in your specific provider’s documentation since support and default behavior vary. Mixed-stack environments need entries for both address families if clients might connect over either.
How do I avoid locking myself out when enabling an allowlist?
Add your current administrative IPs and any emergency access routes to the list before enabling enforcement, then verify each entry works by testing from the real path first, a sequence GitHub’s documentation recommends explicitly. Running new entries in monitor mode before full enforcement catches mistakes before they cause an outage.
Does Demivolt offer an API with IP allowlisting for business payments?
Demivolt provides Banking-as-a-Service and payments infrastructure built on regulated, compliant systems designed for stable, audited access. Specific technical configuration options are best confirmed directly through Demivolt’s BaaS product page.
Should I rely on an IP allowlist instead of API keys or OAuth?
No, an IP allowlist should complement authentication rather than replace it, since it confirms network origin but not caller identity. OWASP’s REST Security Cheat Sheet recommends per-request authentication and authorization as the primary control, with IP restrictions as an additional layer.