Skip to main content

Expressions

A policy is written with Common Expression Language (CEL) expressions to determine on which connections it is applicable. Each policy expression must evaluate to true in order for the policy's actions to take effect against a connection.

Variables

Attributes of the connection are exposed on the conn struct. The following variables are available using this struct:

NameTypeDescription
conn.ClientIPstringThe source IP of the TCP connection to the ngrok endpoint.
conn.Geo.CountryCodestringThe two-letter ISO country code based on the client IP.
conn.Geo.LatitudestringThe approximate latitude based on the client IP.
conn.Geo.LongitudestringThe approximate longitude based on the client IP.
conn.Geo.LatLongRadiusKmstringThe radius in kilometers around the latitude and longitude where the client IP is likely to originate.
conn.TLS.CertCNstringThe subject common name of the leaf TLS certificate
conn.TLS.CipherSuitestringThe cipher suite negotiated on the connection.
conn.TLS.VersionstringThe TLS Version used on the connection.
conn.TLS.SNIstringThe Server Name Indication extension sent.