Deny
Overview
The Deny Traffic Policy action enables you to reject incoming requests on your endpoints before they make it to your upstream service.
Configuration Reference
This is the Traffic Policy configuration reference for this action.
Action Type
deny
Configuration Fields
This action does not have any configuration fields for TCP endpoints.
Behavior
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.
Examples
Deny all traffic
The following Traffic Policy configuration will deny all inbound traffic on your endpoint.
Example Traffic Policy Document
- YAML
- JSON
---
inbound:
- actions:
- type: "deny"
{
"inbound": [
{
"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.