View all Worklets
MacOSmacOS

Block the Unauthenticated Docker Remote API Port 2375 to Mitigate Tenable Plugin 124029 on macOS

Blocks remote access to an unauthenticated Docker Engine API on TCP port 2375 on macOS while localhost tools keep working

Worklet Details

What the Docker Remote API port 2375 block Worklet does

This Automox Worklet™ blocks inbound TCP port 2375 on macOS endpoints where an unauthenticated Docker Engine API answers on a network-facing address. It mitigates Tenable plugin 124029 (Docker Remote API Detection) with one rule in PF, the packet filter built into macOS, and enables PF if it's off.

Port 2375 is the Docker Engine API's plain-HTTP port. On a Mac, it reaches the network when Docker Desktop, Colima, Rancher Desktop, or a container publishes it on an address other than loopback. Before it blocks the port, the Worklet confirms that exposure. It looks for a TCP listener on port 2375 outside the loopback range, then checks that the listener answers an unauthenticated GET /version request as a Docker Engine API.

The rule sits in the PF anchor com.apple/automox-tenable-124029, which the stock /etc/pf.conf evaluates through its anchor "com.apple/*" anchor point. It drops inbound TCP 2375 on every interface except loopback (lo0). PF holds the rule in memory only, so a reboot clears it. The policy's next scheduled run loads it again if the API is still exposed.

Why block the Docker Engine API from the network

A Docker Engine API that answers plain HTTP on port 2375 has no authentication and no encryption. Anyone with network access to it can send the same requests as the docker command: create, start, and stop containers, pull images, and read container logs. Docker's documentation on remote daemon access warns that an unsecured connection can let remote non-root users gain root access on the host. Tenable plugin 124029, rated Critical, flags hosts where that API answers unauthenticated requests over the network.

Use this Worklet to close port 2375 to the network on Macs that carry the finding. You can then track down the setting that published the port. The Worklet doesn't stop Docker or edit its configuration, so your containers keep running.

You can target a broad macOS group with one policy. The Worklet loads the rule only where it confirms a Docker Engine API response. Macs with nothing listening on port 2375, or with only a loopback listener, report compliant as not applicable. For vulnerability programs with deadlines on Critical findings, the Activity Log records the time each endpoint received the block.

How the port 2375 PF block works

  1. Evaluation phase: Lists TCP listeners on port 2375 with lsof and ignores any bound to a loopback address (127.* or [::1]). If none remain, it logs COMPLIANT as not applicable and exits 0.

    For each remaining listener, it sends GET /version to port 2375 with curl, a five-second timeout, and no proxy. Listeners on all interfaces (* or [::]) get the request on the loopback addresses 127.0.0.1 and [::1] in turn, stopping at the first Docker reply. A response containing "ApiVersion" confirms an unauthenticated Docker Engine API, and evaluation logs a FINDING line with the address and process name.

    If no listener answers that way, evaluation logs a WARN and a request to investigate the listener manually. It exits 0 with no change scheduled.

    On a confirmed endpoint, evaluation checks PF with pfctl -s info and pfctl -s rules. If pfctl -s info fails, or the main ruleset has no anchor "com.apple/*" anchor point, it logs a WARN and exits 0 with no change scheduled. Otherwise, it reports COMPLIANT (exit 0) when PF is enabled and pfctl -a com.apple/automox-tenable-124029 -s rules lists the block rule. In any other state, it reports NON-COMPLIANT and exits 1, which schedules remediation.

  2. Remediation phase: Exits 1 when not running as root, since pfctl needs root. It then repeats the evaluation's checks, so you can run it directly with FixNow or Run Policy. It exits 0 with no change on endpoints with no confirmed Docker Engine API or an already active block. A missing anchor point or a failed pfctl -s info call exits 1 with no change.

    Otherwise, it loads the rule block drop in quick on ! lo0 proto tcp from any to any port = 2375 with pfctl -a com.apple/automox-tenable-124029 -f -. The on ! lo0 clause exempts loopback, so the rule drops inbound TCP 2375 on every other interface.

    If PF is disabled, the Worklet enables it with pfctl -E. It saves the reference token from that command to pf-token in /Library/Application Support/Automox/WorkletCache/341d0315-46fc-580f-9e41-fafb3f76bb04/. When PF is already enabled, it takes no reference.

    A post-check repeats the evaluation's PF test. It logs VERIFIED and exits 0, or logs the block state it found and exits 1.

    Setting dryrun=yes logs the planned changes, such as the rule load and any pfctl -E call, without making them. Setting rollback=yes flushes the anchor with pfctl -a com.apple/automox-tenable-124029 -F rules. If a saved token exists, rollback releases it with pfctl -X and deletes the pf-token file. Without one, it logs that the PF enable state is left unchanged.

    Rollback runs before the Docker checks, so it also works on endpoints without Docker. It releases only the Worklet's own PF reference. VPN clients, Internet Sharing, content filters, and other components keep their own references, and PF stays enabled for them.

    A final check reads the anchor back. Rollback exits 0 when the rule is gone and exits 1 when it's still present.

Docker API port block requirements

  • macOS 12 or later on workstations or servers

  • Root privileges for the Automox agent. Remediation exits 1 without them.

  • The built-in pfctl, lsof, and curl commands

  • The stock anchor "com.apple/*" anchor point in the main PF ruleset loaded from /etc/pf.conf. On a confirmed endpoint without it, evaluation logs a WARN that names the missing anchor point. The Worklet makes no change there.

  • Write access to /Library/Application Support/Automox/WorkletCache when PF starts out disabled, for the saved reference token

  • A recurring policy schedule. The PF rule doesn't persist across a reboot. The next scheduled run loads it again when evaluation finds the API exposed and the rule missing.

  • Optional remediation variables dryrun and rollback, which default to no

  • A manual run for rollback, because scheduled runs call remediation only on non-compliant endpoints. First, remove the endpoint's group from the blocking policy. Otherwise its next scheduled run loads the rule again. Then create a rollback policy from the Worklet for that group, set rollback=yes at the top of its remediation code, and run it with Run Policy.

Expected port 2375 access after remediation

After remediation, PF is enabled and sudo pfctl -a com.apple/automox-tenable-124029 -s rules lists the block rule. Remote connections to TCP port 2375 get no reply and time out, because the rule drops packets instead of rejecting them. Later evaluations report COMPLIANT as long as PF stays enabled with the rule in the anchor.

Docker keeps running with its configuration unchanged. Local tools on tcp://localhost:2375 keep working, and the rule doesn't touch TLS connections on port 2376. Each line the Worklet logs carries a UTC timestamp and an [EVAL] or [REMEDIATION] prefix. The full output reaches the Activity Log whether the script exits 0 or 1.

View in app

Consider Worklets your easy button

What's a Worklet?

An Automox Worklet™ is a Bash or PowerShell automation that takes action on Windows, macOS, and Linux endpoints at scale. It handles everything from configuration and software management to named-CVE mitigations deployed within hours of disclosure, including vulnerabilities that have no patch yet, are configuration-based, or that a vendor won't fix.

Every Automox-published Worklet is human-reviewed, and customers control where, when, and how it runs.

Mitigation at AI speed

Disclosure to mitigation in minutes or hours

Frontier-model AI is finding vulnerabilities faster than most teams can track, and most of what it finds isn't immediately patchable. Finding isn't fixing. Worklets turn discovery into action.

  • Search by CVE or browse the Mitigations category
  • Review the Worklet before you deploy it
  • FixNow for urgent exposure
  • Verify execution through Activity Log and Policy Results
Mitigating Vulnerabilities with Automox