Webhook security: IP lists, mTLS and URL rules
Why Meta recommends mTLS over IP allowlists, what to do if you must allow sources, and which URLs CRPRO Hub accepts or rejects as a destination.
When security looks at a webhook endpoint, the first idea is usually to allow only the IPs of the sender. It sounds prudent and tends to fail silently months later. This article explains what Meta documents about sources and mTLS, why a fixed IP list is fragile, and which URL rules CRPRO Hub applies to the destination you register.
What Meta documents about sources and mTLS
Meta documents that webhooks support mutual TLS (mTLS) as an extra security layer, and advises using it instead of maintaining an IP allowlist. The stated reason is that Meta periodically changes the addresses webhooks are sent from. The page also says how to get the current list: a whois query on autonomous system AS32934 or a CSV geofeed download.
Meta's webhook setup page points to a separate mTLS document. So the details of how to enable mTLS (certificates, certificate authority, dashboard steps) are left out of this article. Consult Meta's documentation for that part instead of trusting second-hand instructions.
What can be stated is the principle. In ordinary TLS only the server proves who it is. In mTLS the client also presents a certificate, and your server can refuse connections from anyone who does not present a valid one. It is an identity check of the source at the connection level, before any byte of the body is read.
Why a fixed IP list is fragile
A fixed list goes stale, and the failure is silent. If the source moves to a block you did not allow, the request never reaches your server: no application error, no invalid-signature log, just an absence of events. It is the hardest cause to diagnose, because nothing on your side records that something tried to get in.
# Anti-pattern: a fixed IP list copied on one day
iptables -A INPUT -p tcp --dport 443 -s 203.0.113.0/24 -j ACCEPT # (example)
iptables -A INPUT -p tcp --dport 443 -j DROP
# Consequence: when the source changes, the webhook vanishes and the receiver log stays empty.
# Alternative: accept 443 from anywhere and validate the signature of every request.The list also gives a false sense of security. A source IP is not proof of the content's authenticity: the defense that actually stops a forged body from being accepted is the signature, computed with a secret the attacker lacks. If you must keep a list for internal policy, automate its update from the official source and monitor event arrival, so you notice the day it goes quiet.
A concrete example: how the layers add up
Think of three independent layers, each covering a different failure. HTTPS protects the content on the way. Signature verification ensures the body came from someone who knows the secret and was not altered. Deduplication ensures a legitimate copy that is resent is not processed twice. mTLS, if you adopt it, adds a fourth layer at the connection, and the IP list would be a fifth, weak one.
- HTTPS: confidentiality and integrity in transit.
- HMAC signature: authenticity of the body; without it, anyone who finds the URL can forge events.
- Idempotency: a valid body sent again does not become a duplicate effect.
- mTLS (optional): identity of the source at the connection.
- IP list (avoid as the only defense): breaks when the source changes.
No layer replaces the signature. That is why the articles in this cluster treat signature header verification so carefully: it is the only barrier that keeps working when everything else fails.
URL rules CRPRO Hub applies to your destination
The Hub applies a destination check to your endpoint URL, at creation and on every delivery. Rejected are plain HTTP (HTTPS only, and only on port 443), URLs with an embedded username and password, internal networks (loopback, link-local and private ranges), names such as localhost or ending in .local and .internal, and redirects. A domain that resolves to an internal IP is also rejected.
Because the check repeats on every delivery, the problem can appear after creation: DNS that starts pointing to an internal IP, or stops resolving, makes deliveries fail even though the endpoint already exists. Creation answers 400 with WEBHOOK_URL_NOT_ALLOWED for URLs outside the rules and 400 with WEBHOOK_DNS_FAILED for domains that do not resolve.
Two practical consequences. To develop on your machine, expose the port through a tunnel with a public HTTPS domain, because localhost is rejected. And the registered URL must be the final destination, with no redirect: a 301 counts as a failure.
One more habit protects you from the quiet failures described above: an arrival heartbeat. Count events received per hour and alert when the count drops to zero during hours that are normally busy. A firewall change, an expired certificate, a DNS mistake and an IP block all look the same from inside the application, namely nothing happening, and a heartbeat is the cheapest way to turn that silence into an alert. Pair it with the Hub's test event so you can tell a quiet day from a broken path.
Keep secrets out of logs too. The endpoint secret and the signature header are credentials; do not print them in plain text, and rotate the secret if one leaks. Rotation invalidates the previous secret immediately, so deploy the new value right after rotating.
What to do in practice
In short: do not rely on an IP list; always validate the signature; consider mTLS if your policy requires source identity at the connection and Meta's documentation fits your scenario; and keep the destination within the Hub's URL rules. Monitor event arrival, because a network block only shows up as silence.
For the Hub's full contract of signature headers and formats, see CRPRO Hub webhooks. For authenticating the calls you make to the API, see authentication.
Frequently asked questions
Does Meta recommend allowing the webhook IPs in the firewall?
The documentation recommends mTLS instead of maintaining an IP list, because the addresses change periodically. The current list can be obtained via whois on AS32934 or from the geofeed.
What is mTLS for webhooks?
Mutual TLS: besides the server, the client also presents a certificate, and your server can refuse anyone who does not present a valid one. The enabling steps are in Meta's documentation.
Does an IP list replace signature verification?
No. The IP does not prove the body's authenticity. The HMAC signature is the defense that stops forged events from being accepted.
Can I register an HTTP URL or a different port at the Hub?
No. The Hub accepts only HTTPS on port 443, rejects credentials in the URL, internal networks and redirects, and repeats the DNS check on every delivery.
Fontes
Documentação oficial da Meta, conferida em 31 de outubro de 2026.