Network exposure and security

in Japanese(日本語)

A summary for explaining to IT/security what this tool opens and where, when running on a corporate LAN that does not reach the internet. It is not a setup guide. How the files and destinations that test code (scenarios) can reach are restricted is covered in Checking the sandbox and opening the holes you need.

What listens where

What Where it listens Authentication
Your Mac (CLI, MCP server, monitor, Live Control) Opens no externally reachable port. Only NDJSON over standard input/output and unix domain sockets that only the same user can connect to (files, not TCP ports) —
The scenario sandbox's proxy 127.0.0.1 only. Started only when sandbox.allowedDomains is set, on a port that changes each time Not needed (loopback; it relays only to the allowedDomains destinations)
iOS Simulator bridge (XCUITest / in-app) 127.0.0.1 inside the device only. The Simulator shares its host's network stack, so your machine can reach it Not needed (loopback)
Android bridge (physical device and Emulator alike) Loopback inside the device only. Reached from your machine through a dynamic local port that adb forward opens Not needed (loopback)
Android Emulator gRPC 127.0.0.1 A Bearer token the Emulator itself issues once per boot
Physical iPhone, USB path (default, recommended) An iproxy (libimobiledevice) USB tunnel. Stays entirely on loopback Not needed (loopback)
Physical iPhone, LAN path All of the device's network interfaces. Reachable from the same LAN Token required (see below)
Published ports from compose.yaml (a run of a project that has scripts/compose.yaml) Normally 127.0.0.1. 0.0.0.0 for a run with a physical-device lane and for services up --physical Not needed
fleetest's proxy (Apple Container, when allowedDomains is set) The gateway IP of the container network Not needed (it relays only to the allowedDomains destinations)
Remote Login (SSH) on the runner machine. Turned on there only when you use remote runs Port 22 of the runner machine Key-based authentication
Screen Sharing on the runner machine (recommended; turned on there only when you use remote runs) Port 5900 of the runner machine. Do not open it on the router macOS authentication

Token authentication for the LAN path

Outbound traffic

What is fetched Destination When
Bootstrap scripts raw.githubusercontent.com Setup and update
fleetest itself github.com clone, pull, update check
20+ Swift dependencies github.com (apple/*, grpc/*, swiftlang/*, swift-server/*, jpsim/Yams) swift build
8 VSCode extension dependencies registry.npmjs.org Building the extension
node@26 (to build the VSCode extension), libimobiledevice Homebrew's distribution hosts Setup
Android system images and command-line tools dl.google.com Creating an Emulator, installing Android SDK tools
Container images (when you use compose.yaml) A container image registry (docker.io) Start of a run, fleetest services pull

By volume the Swift dependencies dominate — not the fleetest repository itself. The Android bridge APK ships inside the repository, so no Android build tooling is needed.

Firewall settings

The sandbox is what narrows a scenario's outbound traffic

The macOS firewall (System Settings → Network → Firewall) stops incoming connections per app; it cannot narrow traffic a scenario sends out. What allows a scenario's outbound traffic per destination is sandbox.allowedDomains (see "Destinations" in Sandbox defaults). If you write nothing, a scenario cannot reach the outside at all, so you do not need an extra firewall.

Keep the macOS firewall on

Company firewalls

While tests run, fleetest itself does not go outside (except for scenarios connecting to allowedDomains). It goes outside only for installation and updates; the destinations are in "Outbound traffic" above, and how to run in a closed network is in "Closed networks (no internet access)" below.

Closed networks (no internet access)

Five destinations need to be reachable (raw.githubusercontent.com, github.com, registry.npmjs.org, Homebrew's distribution hosts, and dl.google.com if you use Android), plus a container image registry (docker.io) if you use compose.yaml. Since there is no telemetry and nothing goes out while tests run, this is usually straightforward to justify in an exemption request. No extra configuration is needed on the tool side.

Option B: an internal mirror (when A is not possible)

Use git's insteadOf to redirect all GitHub traffic. Neither Package.swift nor Package.resolved is edited, so upstream version bumps need no follow-up work.

git config --global url."https://<internal-mirror>/".insteadOf "https://github.com/"

That single setting routes both fleetest itself and all 20+ Swift dependencies through the mirror.

SwiftPM also follows this setting, so dependencies are fetched from the mirror rather than from github.com.

Three things remain:

To redirect only the initial clone, FLEETEST_REPO_URL=<mirror URL> also works.

Pinning a version

There is no supported way for a user to pin a version — distribution is the latest release tag. On a closed network you do not need one: when you add a new release tag to the mirror is itself the internal release gate, so you control which revision is taken without changing anything the user does.

Runner machines (running tests on another Mac)

The only path is SSH with key-based authentication. The trust model and what ends up on a runner machine are covered in "Using it safely" in Remote runs.

Runner machines reach the same destinations as your Mac. Each fleetest remote setup and version alignment makes the runner machine fetch fleetest from GitHub and build it. On a closed network, apply Option A / B above to the runner machines too.

Decisions to make operationally

  1. Install brew install libimobiledevice on every Mac that uses a physical iPhone. This switches it to the USB tunnel and removes the LAN exposure entirely (communication is also faster).
  2. If a Wi-Fi-connected physical device must be used anyway, put the test devices and runner machines on a segregated VLAN.
  3. On a closed network, first check whether the Option A destinations can be allowed (Option A under "Closed networks" above). If not, set up an internal mirror (Option B). Decide one of them before you start — otherwise neither setup nor updates work.
  4. Never write production credentials into scenarios or profiles.

Check it on your own Mac

These steps check that what is described above actually holds on your own Mac. All of them only read; none changes a setting.

1. See which ports are listening

The ports fleetest uses are the bridge ports, 8123-8154. Check that none is open in a form reachable from outside (on all interfaces).

Prompt for the AI

Check the TCP listeners on this Mac. Split the result of lsof -nP -iTCP:8123-8154 -sTCP:LISTEN into those whose address is 127.0.0.1 (loopback) and those with * or 0.0.0.0 (all interfaces). Also run fleetest doctor and tell me about any warning.
If you do it manually (click to show details)
lsof -nP -iTCP:8123-8154 -sTCP:LISTEN    # the bridge ports
lsof -nP -iTCP -sTCP:LISTEN | grep -i fleetest    # fleetest's own listeners
fleetest doctor

Expected result:

2. See that outbound traffic is narrowed to allowedDomains

Read this Mac's sandbox.allowedDomains and check that the list is the only set of destinations a scenario can reach.

Prompt for the AI

Tell me what ~/.config/fleetest/config.json has in sandbox.allowedDomains. If the file or the sandbox key does not exist, say so. Do not edit anything.
If you do it manually (click to show details)
cat ~/.config/fleetest/config.json

Expected result:

3. Check that the closed-network setup works

On a closed network, check that either Option A (allow the destinations) or Option B (an internal mirror) goes through.

Prompt for the AI

I want to check that the closed-network setup works. Check git's insteadOf settings, a git ls-remote of fleetest on github.com, and HTTPS reachability (status codes) of raw.githubusercontent.com, github.com, registry.npmjs.org and dl.google.com, and tell me the results. Do not change any settings.
If you do it manually (click to show details)
git config --global --get-regexp '^url\..*\.insteadof$'
git ls-remote https://github.com/wave1008/fleetest.git HEAD
for h in raw.githubusercontent.com github.com registry.npmjs.org dl.google.com; do
  curl -sS -m 10 -o /dev/null -w "$h %{http_code}\n" https://$h/
done

Expected result: