TLS Edge Policies Module
Replace TLS Edge Policy Module
Request
PUT /edges/tls/{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.TLS.CertCN != \"expected-cert-cn\"","conn.TLS.CipherSuite != \"expected-cipher-suite\"","conn.TLS.Version != \"expected-version\"","conn.TLS.SNI != \"expected-sni\""],"actions":[{"type":"log","config":{"Metadata":{"Message":"Invalid TLS Info"}}},{"type":"deny"}],"name":"Conns Has Incorrect TLS Info"}],"outbound":[{"expressions":["conn.ClientIP == '192.0.2.0'","conn.ClientIP == '198.51.100.0'"],"actions":[{"type":"log","config":{"Metadata":{"Message":"Outbound Connection to Speicified IP"}}}],"name":"Log Outbound Connection To Specific IPs"}]}' \
https://api.ngrok.com/edges/tls/edgtls_2bIPjDe1wvBGw4BpUmazFQtYSHx/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.TLS.CertCN != \"expected-cert-cn\"",
"conn.TLS.CipherSuite != \"expected-cipher-suite\"",
"conn.TLS.Version != \"expected-version\"",
"conn.TLS.SNI != \"expected-sni\""
],
"actions": [
{
"type": "log",
"config": {
"Metadata": {
"Message": "Invalid TLS Info"
}
}
},
{
"type": "deny",
"config": null
}
],
"name": "Conns Has Incorrect TLS Info"
}
],
"outbound": [
{
"expressions": [
"conn.ClientIP == '192.0.2.0'",
"conn.ClientIP == '198.51.100.0'"
],
"actions": [
{
"type": "log",
"config": {
"Metadata": {
"Message": "Outbound Connection to Speicified IP"
}
}
}
],
"name": "Log Outbound Connection To Specific IPs"
}
]
}
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 TLS Edge Policy Module
Request
GET /edges/tls/{id}/policies
Example Request
curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tls/edgtls_2bIPjDe1wvBGw4BpUmazFQtYSHx/policies
Response
Returns a 200 response on success
Example Response
{
"enabled": true,
"inbound": [
{
"expressions": [
"conn.TLS.CertCN != \"expected-cert-cn\"",
"conn.TLS.CipherSuite != \"expected-cipher-suite\"",
"conn.TLS.Version != \"expected-version\"",
"conn.TLS.SNI != \"expected-sni\""
],
"actions": [
{
"type": "log",
"config": {
"Metadata": {
"Message": "Invalid TLS Info"
}
}
},
{
"type": "deny",
"config": null
}
],
"name": "Conns Has Incorrect TLS Info"
}
],
"outbound": [
{
"expressions": [
"conn.ClientIP == '192.0.2.0'",
"conn.ClientIP == '198.51.100.0'"
],
"actions": [
{
"type": "log",
"config": {
"Metadata": {
"Message": "Outbound Connection to Speicified IP"
}
}
}
],
"name": "Log Outbound Connection To Specific IPs"
}
]
}
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 TLS Edge Policy Module
Request
DELETE /edges/tls/{id}/policies
Example Request
curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/edges/tls/edgtls_2bIPjDe1wvBGw4BpUmazFQtYSHx/policies
Response
Returns a 204 response with no body on success