Set up a Cloudflare tunnel for Salto Space
A Cloudflare tunnel gives SHIP (Salto Host Interface Protocol) a stable public host name without opening inbound ports on your firewall.
A small program in your network, the Cloudflare connector (cloudflared), opens an encrypted, outbound-only connection to Cloudflare, and Cloudflare forwards requests for the host name to SHIP.
This guide covers route 1 of Connect Salto Space to the Space API. The tunnel belongs to your Cloudflare account, and you manage it there.
Cloudflare changes its dashboard from time to time, so the names in this guide can differ from what you see. If they do, follow Create a tunnel in the Cloudflare documentation. To watch the setup, see Salto Space remote access with Cloudflare Tunnels.
Before you begin
Make sure you have the following:
- SHIP enabled in Salto Space with the HTTP(S) transport and authentication. See Enable SHIP in Salto Space.
- A Cloudflare account with a domain added to it.
- Cloudflare Zero Trust activated in that account, which step 3 uses. The Zero Trust Free plan covers this setup at no cost, but Cloudflare asks you to register a payment method, such as a credit card, when you activate it.
- Administrator access to a server in your network that can reach the SHIP port, such as the Salto Space server itself. Cloudflare provides the connector for Windows, Linux, and macOS.
- A firewall that allows outbound connections from that server to Cloudflare on port
7844, over TCP and UDP. See Cloudflare Tunnel with firewall for the destinations to allow.
Step 1: Create the tunnel and install the connector
- In the Cloudflare dashboard, go to Networking > Tunnels.
- Select Create Tunnel and enter a name for the tunnel.
- Choose the operating system of your server and copy the installation command that Cloudflare shows. The command contains the connector token, which links the connector to your Cloudflare account, so keep it private.
- On the server, open a terminal as an administrator and run the command. On Windows, download and run the installer from the same page first, then run the command in a command prompt that you opened as an administrator.
- Wait until Cloudflare shows that the tunnel is connected, then select Continue.
Keep the server and the connector running, because the tunnel works only while the connector runs.
Step 2: Publish SHIP through the tunnel
- Go to Networking > Tunnels and select your tunnel.
- On the Routes tab, select Add route, then select Published application.
- Enter a subdomain and select your Domain.
Together they form the public host name of SHIP, for example
ship.example.com. - In Service URL, enter the protocol, address, and port of SHIP as the connector reaches it:
http://localhost:8100if the connector runs on the Salto Space server and SHIP uses port8100.http://SPACE_SERVER:8100if the connector runs on another server, whereSPACE_SERVERis the internal address of the Salto Space server.
- Select Add route.
If SHIP uses HTTPS, enter https:// in the Service URL.
If the connector doesn't trust the SHIP certificate, for example because it's self-signed, open Additional application settings > TLS in the route and turn on Disable TLS certificate verification.
Cloudflare still encrypts the connection between the Space API and Cloudflare with its own certificate.
See Origin configuration parameters in the Cloudflare documentation.
After this step, anyone on the internet can reach SHIP at the public host name. Restrict access in step 3 before you share the host name.
Step 3: Allow only the Space API
The Space API connects from one address, the Space API address. Use Cloudflare Access, which is part of Cloudflare Zero Trust, to block every other address. Access policies deny everything that no policy allows, so one policy for the Space API address is enough:
- In the Cloudflare dashboard, go to Zero Trust > Access controls > Applications. If Zero Trust isn't active yet, Cloudflare asks you to activate a plan first. Choose Zero Trust Free and register a payment method. Cloudflare doesn't charge for this plan.
- Select Create new application, then Self-hosted and private, and continue.
- Under Destinations, select Add public hostname and enter the subdomain and domain of the public host name from step 2.
- Under Access policies, select Create new policy and set the following values:
- Policy Name: a name of your choice, for example
Space API. - Action: Bypass, which lets the request through without a login page. The Space API can't complete an interactive login.
- Include: the IP ranges selector with the value
20.73.151.133.
- Policy Name: a name of your choice, for example
- Select Save policy, then Create.
Cloudflare Access doesn't log the requests that a Bypass policy lets through. See Access policies in the Cloudflare documentation for the policy options. Keep SHIP authentication enabled as well, because the access policy and the SHIP credentials protect SHIP together.
Step 4: Share the host name with Salto
Send the public host name and the SHIP credentials to Salto. See Share the connection details for what to send and how to send it securely.