Skip to main content

Deny

Overview

The Deny Traffic Policy action enables you to reject incoming requests on your endpoints before they make it to your upstream service.

This action does not have any configuration fields for TLS / TCP endpoints.

When this action is executed, the upstream server is never reached and a response is immediately returned and no further actions or rules in the policy configuration will be executed.

Deny all traffic

The following Traffic Policy configuration will deny all inbound traffic on your endpoint.

Example Traffic Policy Document

---
on_tcp_connect:
- actions:
- type: deny

Example Request

$ telnet 5.tcp.ngrok.io 22984

Trying...
Connected to 5.tcp.ngrok.io.
Connection closed by foreign host.

In this example, we attempt to connect to 5.tcp.ngrok.io:22984 using the telnet command and ngrok immediately closes the connection.

Action Result Variables

The following variables are made available for use in subsequent expressions and CEL interpolations after the action has run. Variable values will only apply to the last action execution, results are not concatenated.

This action does not set any variables after it has been executed.