Tcp Edge Policies Module
Replace TCP Edge Policy Module
Request
PUT /edges/tcp/{id}/policies
Example Request
curl \
-X PUT \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"enabled":true,"inbound":[{"expressions":["conn.Geo.Latitude \u003e= \"45.0\" \u0026\u0026 conn.Geo.Longitude \u003c= \"-93.0\""],"actions":[{"type":"deny"}],"name":"Block Inbound Traffic From Specific Geographical Area."}],"outbound":[{"expressions":["conn.Geo.CountryCode in [\"US\", \"CA\", \"MX\", \"GT\", \"BZ\", \"SV\"] \u0026\u0026 conn.ClientIP == \"192.0.2.0\""],"actions":[{"type":"log","config":{"Metadata":{"Message":"Outbound Traffic to North America with IP 192.0.2.0"}}}],"name":"Log Outbound Traffic From Specific Country Codes"}]}' \
https://api.ngrok.com/edges/tcp/edgtcp_2bIPj6oQwNg5kIeZv6hDuNQoGy0/policies
Parameters
Name | Type | Description |
---|---|---|
enabled | boolean | |
inbound | EndpointPolicy | |
outbound | EndpointPolicy |
EndpointPolicy parameters
Name | Type | Description |
---|---|---|
expressions | List<string> | |
actions | EndpointAction | |
name | string |
EndpointAction parameters
Name | Type | Description |
---|---|---|
type | string | |
config | object |
Response
Returns a 200 response on success
Example Response
{
"enabled": true,
"inbound": [
{
"expressions": [
"conn.Geo.Latitude \u003e= \"45.0\" \u0026\u0026 conn.Geo.Longitude \u003c= \"-93.0\""
],
"actions": [
{
"type": "deny",
"config": null
}
],
"name": "Block Inbound Traffic From Specific Geographical Area."
}
],
"outbound": [
{
"expressions": [
"conn.Geo.CountryCode in [\"US\", \"CA\", \"MX\", \"GT\", \"BZ\", \"SV\"] \u0026\u0026 conn.ClientIP == \"192.0.2.0\""
],
"actions": [
{
"type": "log",
"config": {
"Metadata": {
"Message": "Outbound Traffic to North America with IP 192.0.2.0"
}
}
}
],
"name": "Log Outbound Traffic From Specific Country Codes"
}
]
}
Fields
Name | Type | Description |
---|---|---|
enabled | boolean | |
inbound | EndpointPolicy | |
outbound | EndpointPolicy |
EndpointPolicy fields
Name | Type | Description |
---|---|---|
expressions | List<string> | |
actions | EndpointAction | |
name | string |
EndpointAction fields
Name | Type | Description |
---|---|---|
type | string | |
config | object |
Get TCP Edge Policy Module
Request
GET /edges/tcp/{id}/policies
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tcp/edgtcp_2bIPj6oQwNg5kIeZv6hDuNQoGy0/policies
Response
Returns a 200 response on success
Example Response
{
"enabled": true,
"inbound": [
{
"expressions": [
"conn.Geo.Latitude \u003e= \"45.0\" \u0026\u0026 conn.Geo.Longitude \u003c= \"-93.0\""
],
"actions": [
{
"type": "deny",
"config": null
}
],
"name": "Block Inbound Traffic From Specific Geographical Area."
}
],
"outbound": [
{
"expressions": [
"conn.Geo.CountryCode in [\"US\", \"CA\", \"MX\", \"GT\", \"BZ\", \"SV\"] \u0026\u0026 conn.ClientIP == \"192.0.2.0\""
],
"actions": [
{
"type": "log",
"config": {
"Metadata": {
"Message": "Outbound Traffic to North America with IP 192.0.2.0"
}
}
}
],
"name": "Log Outbound Traffic From Specific Country Codes"
}
]
}
Fields
Name | Type | Description |
---|---|---|
enabled | boolean | |
inbound | EndpointPolicy | |
outbound | EndpointPolicy |
EndpointPolicy fields
Name | Type | Description |
---|---|---|
expressions | List<string> | |
actions | EndpointAction | |
name | string |
EndpointAction fields
Name | Type | Description |
---|---|---|
type | string | |
config | object |
Delete TCP Edge Policy Module
Request
DELETE /edges/tcp/{id}/policies
Example Request
curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tcp/edgtcp_2bIPj6oQwNg5kIeZv6hDuNQoGy0/policies
Response
Returns a 204 response with no body on success