Squish License Server over SSH

Last edited on

Overview

Squish License Server is responsible for granting licenses to Squish clients (Squish IDE, squishrunner). Whenever you run Squish tests a TCP/IP connection needs to be made to a machine where License Server is running.

By default, any Squish client can request a license as long as the connection to the Squish License Server can be made. A system administrator can define firewall rules to control machines accessing a License Server. To have complete control over who can access the License Server and secure a connection SSH Port Forwarding (aka SSH Tunneling) can be used.

Configuring SSH Port Forwarding

SSH port forwarding is a mechanism for tunneling application ports from the client machine to the server machine or vice versa. In OpenSSH local port forwarding is configured using the -L option:

ssh -N -L 49345:localhost:49345 <squish_license_server_host>
In cmd.exe or a shell

This example opens a connection to the <squish_license_server_host> (put there a hostname or IP address where License Server is running), and forwards any connection to port 49345 on the local machine to port 49345 on <squish_license_server_host>. Port number 49345 is the default port where License Server is listening. The -N option disallows ssh executing remote commands.

The SSH tunnel can be restricted to only bind programs on the same host by providing a bind address:

ssh -N -L localhost:49345:localhost:49345 <squish_license_server_host>
In cmd.exe or a shell

Configuring Squish IDE

Once the SSH Tunnel is established, Squish needs to be configured to use localhost:49345 as Squish License Server settings (Help > License Key ...).

Monitoring Squish License Server

For the Squish License Server, the port forwarding is invisible, therefore License Server Logs will show that the connection was made from a local machine

2022-12-14T14:32:00 [squish_floating_config_tomasz] Client [::1]:50885 connected
2022-12-14T14:32:00 [squish_floating_config_tomasz] Client [::1]:50885 will receive a license
License Server Logs

To obtain information about Squish Clients that were granted the license REST API can be used. GET v1/clients returns a different machineId despite all connections being made from the local host.

[
	{
		"clientAddress": "::1",
		"clientPort": 50885,
		"grantTime": "2022-12-14T13:32:00.463Z",
		"licenseType": "tester",
		"machineId": "{7dbdb9fe-04b5-1313-a870-ab9f7003b1ee}",
		"requestTime": "2022-12-14T13:32:00.463Z"
	},
	{
		"clientAddress": "::1",
		"clientPort": 50951,"grantTime": "2022-12-14T13:36:39.734Z",
		"licenseType": "tester",
		"machineId": "{162fddc6-c93e-1414-afd8-9aea7bc7112a}",
		"requestTime": "2022-12-14T13:36:39.733Z"
	}
]
GET v1/clients response

More information about Squish License Server