Skip to content

macOS updates replace PV's pf.conf reference and break .test routing #304

Description

@munezaclovis

Summary

A macOS point update can replace /etc/pf.conf with Apple's stock template and remove PV's managed rdr-anchor / load anchor reference. The separate PV anchor file may remain on disk, but without the main-ruleset reference it is never evaluated. All normal http://*.test and https://*.test URLs then stop reaching the unprivileged Gateway.

This is distinct from #300's launchd throttle. It was the root cause of the later live ai.test outage documented in the incident investigation.

Verified incident

Environment:

  • macOS 26.5.1 → 26.5.2 (25F84)
  • PV 0.2.2
  • Gateway backend listeners: 127.0.0.1:48080 and 127.0.0.1:48443

Evidence:

  • macOS 26.5.2 installed July 24 at 12:47:58 EDT.
  • Apple's package receipt identifies /private/etc/pf.conf as owned by com.apple.files.data-template version 26.5.2 with install time July 24 at 12:54:47 EDT.
  • Before repair, the live pf.conf had Apple's stock-template contents and that exact ctime.
  • /etc/pf.anchors/com.prvious.pv still contained the correct 80 → 48080 and 443 → 48443 rules.
  • ai.test resolved correctly and the Gateway/backend were healthy, but ports 80/443 refused connections.
  • Bypassing the low-port path and connecting directly to 48443 returned HTTP 200.
  • Running pv ports:install restored the two main-ruleset references, reloaded PF, and immediately restored HTTP 200 over IPv4.

Design constraint

PV deliberately uses PF for low-port routing (DESIGN.md). The background daemon may detect privileged drift but must not prompt or mutate privileged system configuration (DESIGN.md).

Apple also documents PF as an unsupported product API and warns that its rules can conflict with system services or other software: TN3165: Packet Filter is not API.

The supported recovery strategy therefore needs an explicit design decision; this issue should not silently introduce background privileged repair.

Expected behavior

A supported macOS update must not leave users with an unexplained all-Projects outage. PV should reliably detect the missing system reference, make the cause and focused foreground repair discoverable, and verify that routing is restored after the repair. Any longer-term replacement for PF must be decided explicitly.

Acceptance criteria

  • Document the supported post-macOS-update recovery strategy in DESIGN.md.
  • Add integration coverage that replaces a current PV-managed pf.conf with the stock Apple form while leaving the PV anchor file present.
  • Detect that state as privileged routing drift rather than Gateway/backend failure.
  • Surface a focused pv ports:install recovery path through relevant PV diagnostics/commands without silently prompting from the daemon.
  • Preserve non-PV pf.conf content and continue refusing unsafe ownership conflicts.
  • Verify the foreground repair restores the main-ruleset reference and active low-port routing.
  • Keep pv update incurs a 10-second launchd throttle after switching app binary #300's launchd binary-switch behavior out of scope.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggatewayGateway, DNS, TLS, pv openpriority-highP1 high priorityvalue-highHigh value

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions