Skip to main content

TLS Edge Traffic Policy Module

Replace TLS Edge Traffic Policy Module

Request

PUT /edges/tls/{id}/traffic_policy

Example Request

curl \
-X PUT \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"enabled":true,"value":"{\n\t\"on_tcp_connect\": [\n\t\t{\n\t\t\t\"name\": \"AllowTLS1.3\",\n\t\t\t\"expressions\":[\"conn.tls.version.contains('1.3')\"],\n\t\t\t\"actions\":[\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"log\",\n\t\t\t\t\t\"config\":{\n\t\t\t\t\t\t\"metadata\":{\n\t\t\t\t\t\t\t\"message\":\"Invalid TLS Version\",\n\t\t\t\t\t\t\t\"edgeId\": \"edgtls_2na2LhywkFj4QrkrzjN2fL9CgRo\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"deny\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}"}' \
https://api.ngrok.com/edges/tls/edgtls_2na2LhywkFj4QrkrzjN2fL9CgRo/traffic_policy

Parameters

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
valuestringthe traffic policy that should be applied to the traffic on your endpoint.

Response

Returns a 200 response on success

Example Response

{
"enabled": true,
"value": "{\n\t\"on_tcp_connect\": [\n\t\t{\n\t\t\t\"name\": \"AllowTLS1.3\",\n\t\t\t\"expressions\":[\"conn.tls.version.contains('1.3')\"],\n\t\t\t\"actions\":[\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"log\",\n\t\t\t\t\t\"config\":{\n\t\t\t\t\t\t\"metadata\":{\n\t\t\t\t\t\t\t\"message\":\"Invalid TLS Version\",\n\t\t\t\t\t\t\t\"edgeId\": \"edgtls_2na2LhywkFj4QrkrzjN2fL9CgRo\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"deny\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}"
}

Fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
valuestringthe traffic policy that should be applied to the traffic on your endpoint.

Get TLS Edge Traffic Policy Module

Request

GET /edges/tls/{id}/traffic_policy

Example Request

curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tls/edgtls_2na2LhywkFj4QrkrzjN2fL9CgRo/traffic_policy

Response

Returns a 200 response on success

Example Response

{
"enabled": true,
"value": "{\n\t\"on_tcp_connect\": [\n\t\t{\n\t\t\t\"name\": \"AllowTLS1.3\",\n\t\t\t\"expressions\":[\"conn.tls.version.contains('1.3')\"],\n\t\t\t\"actions\":[\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"log\",\n\t\t\t\t\t\"config\":{\n\t\t\t\t\t\t\"metadata\":{\n\t\t\t\t\t\t\t\"message\":\"Invalid TLS Version\",\n\t\t\t\t\t\t\t\"edgeId\": \"edgtls_2na2LhywkFj4QrkrzjN2fL9CgRo\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\":\"deny\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}"
}

Fields

NameTypeDescription
enabledbooleantrue if the module will be applied to traffic, false to disable. default true if unspecified
valuestringthe traffic policy that should be applied to the traffic on your endpoint.

Delete TLS Edge Traffic Policy Module

Request

DELETE /edges/tls/{id}/traffic_policy

Example Request

curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tls/edgtls_2na2LhywkFj4QrkrzjN2fL9CgRo/traffic_policy

Response

Returns a 204 response with no body on success