Documentation / Protect your product

Protect an API or webhook endpoint

Who connects: other machines — no browser, no human sign-in. Backend APIs consumed by your own apps, webhooks sent by other services, and integration endpoints such as a CRM's web services. The traffic is scripted and usually comes from a known, small set of systems.

The risk

There is no login page to put a gate in front of: the caller authenticates with a key or a token in the request itself. So the exposure is the endpoint being discovered and hammered, tokens brute-forced, and malformed or malicious payloads sent to the parser. The aim is to accept the legitimate callers at a sensible rate, inspect what they send, and make the endpoint uninteresting to everyone else.

The recipe

In the service card in Routing:

  1. No gate. A machine caller can't complete Neti's sign-in, so leave the Gate off for the API paths. (If part of the same domain is a human admin, gate only those paths — see Public CMS with admin.)
  2. Rate-limit. Assign a filtering profile with a request limit suited to the integration's real volume, so a runaway or abusive caller is throttled with a 429 (request limit).
  3. Allowlist the known callers. If the integrations connect from fixed addresses, add them as trusted networks so a burst from them is never mistaken for an attack (they are still inspected).
  4. Inspect the payloads. With a subscription, turn on Application protection (Pro). API payloads often look like attacks to a generic rule set, so start in Detect and add exclusions for the fields that legitimately carry rich content before switching to Block.
  5. Streaming? If the endpoint keeps a long-lived connection open, turn on WebSocket for the service in Routing.

Worked example: a CRM's web services

A CRM is the typical case: it exposes web services that integrations call directly, without a browser. Keep the gate off for those paths; assign a filtering profile with a request limit matching how often the integrations poll; add the integration servers' addresses as trusted networks. Turn on Application protection in Detect, pick the CRS model that matches the application, and add exclusions for the web-service fields that otherwise trip generic rules, then move to Block. The human interface of the same application is a different profile — gate it as in Restricted-access panels.

Check it

  • Your integrations keep working at their normal rate; a caller that exceeds the limit gets a 429.
  • Live analysis shows the API traffic passing and the rate limit biting only when a caller goes over.
  • With the CRS model in Detect, the AppSec page should not be listing your integrations' normal payloads before you switch to Block.

Maintenance and false positives

  • A legitimate payload flagged? Add a CRS exclusion for that field or path, not a blanket disable.
  • A busy integration hitting the 429? Raise the request limit in its filtering profile, or add its address as a trusted network.
  • A webhook sender whose address changes? Prefer a generous rate limit over an allowlist you'd have to keep editing.
Community

Community

Discussion board. Sign in to open topics and reply.

Loading…

The same account works for Community and Console.

Complete your profile

Your profile

One more step to join the community.

My posts

Your discussions and replies.