Configuration reference
This is the Traffic Policy configuration reference for this action.Supported phases
on_http_request
Type
verify-webhook
Configuration fields
Behavior
The verify-webhook action ensures the authenticity of incoming webhook requests by validating their signatures against a known secret. When it receives a request, the action performs the signature verification. If verification succeeds, the request proceeds through the action chain. If it fails, ngrok terminates the request with a403 Forbidden response, unless enforce is set to false, in which case the request proceeds without termination.
Verification process
- Signature validation: The action validates the incoming webhook signature to confirm the request originates from the configured provider and that no one has tampered with the payload.
- Request handling: If the webhook verification succeeds, ngrok forwards the request to the next action.
If the verification fails, ngrok terminates the request chain with a
403response. - Configurable enforcement: By default, verification failures result in termination.
However, setting
enforce: falseallows unverified requests to proceed, while logging the verification result. This option is useful for debugging, testing, and crafting your own custom responses with action result variables.
Endpoint verification
Some webhook providers require an initial endpoint verification challenge to validate that your application is legitimate before sending webhook events. The verify-webhook action automatically handles endpoint verification challenges for supported providers.- Supported providers:
- Worldline
- Xero
- Zoom
Replay prevention with timestamp tolerance
To prevent replay attacks, ngrok verifies that the webhook’s timestamp falls within an acceptable range.Secret handling and encryption
ngrok encrypts all secrets used for webhook verification at config validation. When ngrok processes a request, it decrypts the secret.Non-terminating action
This is a Non-terminating action. It does not return a response, and will allow Traffic Policy processing to continue to the next Action in the chain. All Cloud Endpoint Traffic Policies must end with a terminating action. This requirement does not apply to Agent Endpoints.Supported providers
Currently, these integration guides refer to modules.If you don’t see your preferred webhook provider, you can request support for it.
Examples
Basic example
This example configuration sets up an endpoint (gitlab-webhook-example.ngrok.app) that receives webhook requests from GitLab.
The Verify Webhook action checks the authenticity of the request using a shared secret.
If the action verifies the request, ngrok sends back a custom response with a status 200 OK and a plain text confirmation message.
Example Traffic Policy document
Start endpoint with Traffic Policy
200 OK response with the message GitLab webhook verified.