Running port connectivity tests against Twingate Resources from the Twingate Client doesn't provide real-life results. This article will help to provide understanding as to how port tests or scans, such as Nmap or telnet, operate with Twingate.
Twingate restricted port
One can review how the Twingate Client handles traffic by the below.
stor with port restrictions to allow only TCP/UDP 8001 and ICMP traffic.2022-01-17 10:33:59.5408 [DEBUG].log [SDWAN] Core::authorize_hydra_viper_flow: route_id=192 conntrack_proto=TCP fqdn=stor tuple=100.127.255.172:33020->100.96.47.92:7
2022-01-17 10:33:59.5408 [DEBUG].log [SDWAN] match: no matching rule
2022-01-17 10:33:59.5408 [DEBUG].log [SDWAN] Node[AN 6925]::authorize_hydra_viper_flow: new flow route_id=192 conntrack_proto=TCP fqdn=stor tuple=100.127.255.172:33020->100.96.47.92:7 does not match any policy, use bypass
2022-01-17 10:33:59.5408 [DEBUG].log [SDWAN] operator (): rule stor:TCP[[8001]]:UDP[[8001]]:ICMP
2022-01-17 10:33:59.5408 [DEBUG].log [SDWAN] is_protocol_port_allowed: protocol TCP, port 7 is not allowed
Twingate unrestricted port
One can review how the Twingate Client to the Twingate Connector handles traffic by the below.
10.168.0.6 with no Twingate port restrictions applied.10.168.0.6 has a firewall rule that blocks port 5656. curl -v telnet://10.168.0.6:5656 .Connected to 10.168.0.6 (10.168.0.6) port 56556.10.168.0.6 will still result in Connected to 10.168.0.6...
When Twingate restricts ports for a resource, traffic matching the user's available Resources will be intercepted by the Twingate Client. The Twingate Client will then determine which traffic to forward based on the defined Resources and the underlying ruleset. As a result of this interception of traffic, Nmap scanning from the Twingate Client will result in seeing ports that are unexpectedly open, when in fact they are not.
When Twignate doesn't restrict ports, the Twingate Client will leverage the Twingate Connector to proxy the connection. The initial TCP/IP connection will take place against the Connector, as such, a false positive is returned.
Testing connectivity to Twingate Resources from the Twingate Client should not be dependent on TCP/IP port tests/scans. Tests should be performed against the applicable application session, such as interactive SSH or RDP client connections being established, or HTTPS connections returning a 200 response.