| index fe619afbd..27eca6745 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-devbox-identity.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-devbox-identity.tsv |
| @@ -11,10 +11,10 @@ |
| @legacy d6ccdaaa66c2b308b077a67d08300103d618a914fd57f6717fb00180a5c95669 internal/devbox/registrar.go Registrar.serveShareSocket legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, decodes name/path/allow from the SO_PEERCRED-authenticated request, validates name/list, and calls checkSocket for direct-child path, inode owner/type and connected peer UID. Under its mutex it reads its local link/registry claim, persists a socket link in links.json and constructs the whole registry.Route passed to UpsertUnlessRootfs, with rollback on failure. No deployment bucket/record read; socket-path refusals return the configured directory as machine data. whole:Route@1231 b3389aa29c77785657375b60208aac3ac4a086baf9b2c24be4d7d6d98e12791c |
| @legacy 199bf1e752ba186ccfc21f14976e7c05ffb3ff6dc39eb5b993a8dea04f8497cc internal/devbox/socketcheck_linux.go checkSocket legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, validates the cleaned absolute socket path is directly inside its configured directory, opens with O_PATH|O_NOFOLLOW|O_CLOEXEC, and uses socketFstat to require a socket owned by the kernel-authenticated caller UID. Then a bounded connect and SO_PEERCRED lookup require the listening process to have that same UID. New reads are socket inode metadata and peer credentials, with no request payload sent and no file content read. file:Open@338 1eaaca6537d425a9bf1c6e507dc46d6814538676d022eac1fb79b331e5efa61b |
| @legacy 59bb57b3c10ca15f1581b4f608d5ce65a4e0cd007ad2fb311a6a5045ad816361 internal/devbox/socketcheck_linux.go var#1 legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: production assigns socketFstat=unix.Fstat and socketPeerUID=PeerUID as test seams for checkSocket. The carlos-devbox service user, not root, later uses these functions for the opened socket inode metadata and connected peer UID. The new file:Fstat site is a function value here; initialization itself performs no I/O. file:Fstat@23 aeebbb8ef221155002eec748d1269875edeceb1e199d85086bc6d1e829be6e91 |
| -@legacy 1762fc326ab0e7d653a304de013b4d574baf3fc8dc251e0545f395a7ae9836d8 internal/edge/devboxfront.go devboxTrailerBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, reads the incoming HTTP request body through its wrapped ReadCloser. At EOF it strips all visitor identity trailer names before a handler can use late-populated trailers. The scanner counts Read identifiers as file reads; these are network request-body reads, not filesystem opens or root-owned data. file:Read@28,file:Read@69 66eacb35174eb545872491665ef53c06c92a740c973a012825d67a3126abdfbc |
| -@legacy eeb99e713d808bad55b9fba9417ff87b22841ce90d6bfc3265691f6693dba97a internal/tsidentity/whois.go identity.Who legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, queries tailscaled LocalAPI whois over the configured Unix socket (default /var/run/tailscale/tailscaled.sock) for the visitor remote address. New ReadAll reads at most 1 MiB plus one overflow byte from the HTTP response; redirects/errors and oversized or malformed JSON fail, and tagged devices or missing logins are anonymous. No ordinary file or deployment-record read; timeout/cancellation are bounded by the adapter and front door. file:ReadAll@748 faa815685cac4ee4cae548179dbd45e1e852bc5b1a9a13ab899d59ef0670747b |
| +@legacy 8d141edc4545a978b8220d5103b667cc1d9bbf086ac502c5ce73981a742ff745 internal/edge/devboxfront.go devboxTrailerBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, reads the incoming HTTP request body through its wrapped ReadCloser. At EOF it strips all visitor identity trailer names before a handler can use late-populated trailers. The scanner counts Read identifiers as file reads; these are network request-body reads, not filesystem opens or root-owned data. Final fix wave: the shared stripping helper now normalizes underscores to hyphens for comparisons, covering late EOF trailers as well as request and outgoing headers/trailers; this Read body and its reads are unchanged. file:Read@28,file:Read@69 66eacb35174eb545872491665ef53c06c92a740c973a012825d67a3126abdfbc |
| +@legacy 8824c9d68ebeb9b9384d15e614f4ff38f64a868d15930943851cc5a2d2e71d0e internal/tsidentity/whois.go identity.Who legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, queries tailscaled LocalAPI whois over the configured Unix socket (default /var/run/tailscale/tailscaled.sock) for the visitor remote address. New ReadAll reads at most 1 MiB plus one overflow byte from the HTTP response; redirects/errors and oversized or malformed JSON fail, and tagged devices or missing logins are anonymous. No ordinary file or deployment-record read; timeout/cancellation are bounded by the adapter and front door. R11 final fix wave: the enclosing cachedIdentity now caches provider timeouts and expired lookup contexts as anonymous failures for five seconds, discards late answers, and leaves explicit caller cancellation uncached; this adapter body and its reads are unchanged. file:ReadAll@748 faa815685cac4ee4cae548179dbd45e1e852bc5b1a9a13ab899d59ef0670747b |
| @legacy 39aaf4f9c6d9d4ab294be001cd688a16c1ae97c25edac77c85f41e5887c039c1 internal/devbox/registrar.go Registrar.serveShareFolder legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-mode;basis=new: the registrar (carlos-devbox user) reads the name from the query and the upload body (Content-Length required, capped at 200 MiB), scans it with scanSite (now also refusing a root _headers or _redirects over the edge's limit, final review fix) and reads its own registry row via claim. Caller identity is SO_PEERCRED only. Not root;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, replaces req.URL.Query with strict url.ParseQuery(req.URL.RawQuery), refuses malformed query encoding, and validates repeated allow values before reading the capped upload body. Stores the normalized allow list in its local links.json and returns owner-filtered entry data. The scanner loses file:Query; existing archive, spool and local registry reads remain, with no new filesystem or deployment-record read. file:Read@1922,whole:Route@4070 dce50fcab6a2b64a712d58a6f236cdf19ec6264ce7bccba96116ab94c1a81d58 |
| -@legacy e568dc4d9cbd7da9b7e0b990083abf5aa68eb8ecfa9c56e20badcdf4b3a68d39 internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. registry:Account@9457,registry:Alias@24401,registry:Alias@24488,registry:Alias@25068,registry:App@9473,registry:Health@13198,registry:Health@13324,registry:Host@10784,registry:Host@10841,registry:Host@10877,registry:Host@11620,registry:Host@13807,registry:Host@13902,registry:Host@14190,registry:Host@14216,registry:Host@14268,registry:Host@18863,registry:Host@20770,registry:Host@21078,registry:Host@21105,registry:Host@21920,registry:Host@22492,registry:Host@24822,registry:Host@24871,registry:Host@4701,registry:Host@4755,registry:Host@4805,registry:Host@5826,registry:Kind@17199,registry:Kind@17221,registry:Prefix@22467,registry:Socket@11684,registry:Socket@17078,registry:Socket@21086,registry:Status@4626,registry:Target@22479,registry:Tunnel@9317,registry:Tunnel@9488,registry:Version@17180,registry:Version@17282,whole:RegionalDomain@25710,whole:Route@10932,whole:Route@11040,whole:Route@11740,whole:Route@14341,whole:Route@14405,whole:Route@14456,whole:Route@21138,whole:Route@21145,whole:Route@21241,whole:Route@22355,whole:Route@23523,whole:Route@25702,whole:Route@294,whole:Route@3381,whole:Route@3439,whole:Route@5855,whole:Route@6744,whole:Route@6852,whole:Route@9379,whole:RouteAlias@24372,whole:RoutePath@21898 571d8e89d7c8e754b566c40946b0ee0965bf3925a71b07cde63f440bb33fda06 |
| +@legacy 9b6559d1963d2f0274798e45174b480cf565f9351761c3e74b42d87e4c624825 internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read. registry:Account@9457,registry:Alias@24401,registry:Alias@24488,registry:Alias@25068,registry:App@9473,registry:Health@13198,registry:Health@13324,registry:Host@10784,registry:Host@10841,registry:Host@10877,registry:Host@11620,registry:Host@13807,registry:Host@13902,registry:Host@14190,registry:Host@14216,registry:Host@14268,registry:Host@18863,registry:Host@20770,registry:Host@21078,registry:Host@21105,registry:Host@21920,registry:Host@22492,registry:Host@24822,registry:Host@24871,registry:Host@4701,registry:Host@4755,registry:Host@4805,registry:Host@5826,registry:Kind@17199,registry:Kind@17221,registry:Prefix@22467,registry:Socket@11684,registry:Socket@17078,registry:Socket@21086,registry:Status@4626,registry:Target@22479,registry:Tunnel@9317,registry:Tunnel@9488,registry:Version@17180,registry:Version@17282,whole:RegionalDomain@25710,whole:Route@10932,whole:Route@11040,whole:Route@11740,whole:Route@14341,whole:Route@14405,whole:Route@14456,whole:Route@21138,whole:Route@21145,whole:Route@21241,whole:Route@22355,whole:Route@23523,whole:Route@25702,whole:Route@294,whole:Route@3381,whole:Route@3439,whole:Route@5855,whole:Route@6744,whole:Route@6852,whole:Route@9379,whole:RouteAlias@24372,whole:RoutePath@21898 571d8e89d7c8e754b566c40946b0ee0965bf3925a71b07cde63f440bb33fda06 |
| devbox_cli.go runDevboxServe legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-mode;basis=new: carlos devbox serve, run by the carlos-devbox unit as the unprivileged carlos-devbox user, reads its config from the environment (CARLOS_DEVBOX_LISTEN, CARLOS_DEVBOX_DOMAIN, CARLOS_DATA_DIR, CARLOS_WILDCARD_DOMAINS, CARLOS_DEVBOX_SOCKET) and opens registry.db and links.json under its own StateDirectory. Not root;rev3=census-ruling-devbox-macos;basis=devbox on macOS (#488): serve now parses flags; --env-file PATH loads the service user's own env file (loadDevboxEnvFile) before reading the same environment as before; with CARLOS_DEVBOX_LAUNCHD_SOCKET set it takes launchd's listening socket (launchd.Listeners, macOS only; elsewhere it refuses) and holds it to CARLOS_DEVBOX_LISTEN (edge.CheckDevboxListener) before making anything; the socket path comes from devboxSocketPath (CARLOS_DEVBOX_SOCKET, or the OS default). Runs as the unprivileged service user (carlos-devbox on Linux, _carlos-devbox on macOS), never root; no new read beyond the env file named on its own command line;rev3=census-ruling-devbox-identity;basis=#486 A: carlos devbox serve runs as the carlos-devbox service user, not root. Adds configureDevboxIdentity before serving: reads CARLOS_DEVBOX_SOCKETS_DIR, CARLOS_DEVBOX_TAILSCALED_SOCKET and CARLOS_DEVBOX_SHARED_NODES, checks/creates the service-owned sockets directory, and wires the cached LocalAPI adapter plus allow/socket-owner lookups. Existing registry.db, links.json and optional env-file reads remain in the service account; no additional direct scanned read site in this unit. data-literal@1086,data-literal@776,file:Open@2328 adb0176fb0901ac32d80f16259b19d0f98c1978c3c28410bab3c6c0bafeaf0ab |
| infra/devbox/carlos-devbox.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-mode;basis=new: systemd unit for devbox mode on a developer workstation, installed once by hand per infra/devbox/README.md. Runs carlos devbox serve as User=carlos-devbox with only CAP_NET_BIND_SERVICE, NoNewPrivileges, ProtectSystem=strict and the hardening of carlos-edge.service; not installed by user_data or any CARLOS box path;rev3=census-ruling-devbox-identity;basis=#486 A: adds RuntimeDirectoryPreserve=yes so stopping the service preserves caller sockets under /run/carlos-devbox. ExecStart still runs carlos devbox serve with User=Group=carlos-devbox, never as root; only CAP_NET_BIND_SERVICE remains. No new executable or environment-file read; the existing systemd EnvironmentFile and hardening are unchanged. file:external@0 72440fc94179ddaa03203a6b897893b58a608c8ee878972908f97576e860aae8 |
| internal/devbox/registrar.go Registrar.list legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-mode;basis=new: the registrar (carlos-devbox user) EvalSymlinks <spool>/<name>/current only to report whether a folder link resolves. Not root;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, reads its in-memory links and passes the kernel-authenticated caller UID into entry so allow names are returned only to their owner. Adds bounded connect-and-close probes of stored socket paths without sending data; a replaced symlink can be followed by this availability probe. Existing folder-current EvalSymlinks and loopback probes remain; forwarding separately checks peer UID. file:EvalSymlinks@758 775ff5462af8d4afd4614a476d9f31f73ac6fa487d05a3b9b2656e7597dfa19a |
| @@ -25,12 +25,12 @@ devbox_cli.go prepareDevboxSocketsDir legacy accepted-legacy accepted-legacy;rev |
| internal/devbox/registrar.go Registrar.serveShareSocket legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, decodes name/path/allow from the SO_PEERCRED-authenticated request, validates name/list, and calls checkSocket for direct-child path, inode owner/type and connected peer UID. Under its mutex it reads its local link/registry claim, persists a socket link in links.json and constructs the whole registry.Route passed to UpsertUnlessRootfs, with rollback on failure. No deployment bucket/record read; socket-path refusals return the configured directory as machine data. whole:Route@1231 b3389aa29c77785657375b60208aac3ac4a086baf9b2c24be4d7d6d98e12791c |
| internal/devbox/socketcheck_linux.go checkSocket legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, validates the cleaned absolute socket path is directly inside its configured directory, opens with O_PATH|O_NOFOLLOW|O_CLOEXEC, and uses socketFstat to require a socket owned by the kernel-authenticated caller UID. Then a bounded connect and SO_PEERCRED lookup require the listening process to have that same UID. New reads are socket inode metadata and peer credentials, with no request payload sent and no file content read. file:Open@338 1eaaca6537d425a9bf1c6e507dc46d6814538676d022eac1fb79b331e5efa61b |
| internal/devbox/socketcheck_linux.go var#1 legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: production assigns socketFstat=unix.Fstat and socketPeerUID=PeerUID as test seams for checkSocket. The carlos-devbox service user, not root, later uses these functions for the opened socket inode metadata and connected peer UID. The new file:Fstat site is a function value here; initialization itself performs no I/O. file:Fstat@23 aeebbb8ef221155002eec748d1269875edeceb1e199d85086bc6d1e829be6e91 |
| -internal/edge/devboxfront.go devboxTrailerBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, reads the incoming HTTP request body through its wrapped ReadCloser. At EOF it strips all visitor identity trailer names before a handler can use late-populated trailers. The scanner counts Read identifiers as file reads; these are network request-body reads, not filesystem opens or root-owned data. file:Read@28,file:Read@69 66eacb35174eb545872491665ef53c06c92a740c973a012825d67a3126abdfbc |
| -internal/tsidentity/whois.go identity.Who legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, queries tailscaled LocalAPI whois over the configured Unix socket (default /var/run/tailscale/tailscaled.sock) for the visitor remote address. New ReadAll reads at most 1 MiB plus one overflow byte from the HTTP response; redirects/errors and oversized or malformed JSON fail, and tagged devices or missing logins are anonymous. No ordinary file or deployment-record read; timeout/cancellation are bounded by the adapter and front door. file:ReadAll@748 faa815685cac4ee4cae548179dbd45e1e852bc5b1a9a13ab899d59ef0670747b |
| +internal/edge/devboxfront.go devboxTrailerBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, reads the incoming HTTP request body through its wrapped ReadCloser. At EOF it strips all visitor identity trailer names before a handler can use late-populated trailers. The scanner counts Read identifiers as file reads; these are network request-body reads, not filesystem opens or root-owned data. Final fix wave: the shared stripping helper now normalizes underscores to hyphens for comparisons, covering late EOF trailers as well as request and outgoing headers/trailers; this Read body and its reads are unchanged. file:Read@28,file:Read@69 66eacb35174eb545872491665ef53c06c92a740c973a012825d67a3126abdfbc |
| +internal/tsidentity/whois.go identity.Who legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, queries tailscaled LocalAPI whois over the configured Unix socket (default /var/run/tailscale/tailscaled.sock) for the visitor remote address. New ReadAll reads at most 1 MiB plus one overflow byte from the HTTP response; redirects/errors and oversized or malformed JSON fail, and tagged devices or missing logins are anonymous. No ordinary file or deployment-record read; timeout/cancellation are bounded by the adapter and front door. R11 final fix wave: the enclosing cachedIdentity now caches provider timeouts and expired lookup contexts as anonymous failures for five seconds, discards late answers, and leaves explicit caller cancellation uncached; this adapter body and its reads are unchanged. file:ReadAll@748 faa815685cac4ee4cae548179dbd45e1e852bc5b1a9a13ab899d59ef0670747b |
| internal/devbox/registrar.go Registrar.serveShareFolder legacy accepted-legacy accepted-legacy;rev3=census-ruling-devbox-mode;basis=new: the registrar (carlos-devbox user) reads the name from the query and the upload body (Content-Length required, capped at 200 MiB), scans it with scanSite (now also refusing a root _headers or _redirects over the edge's limit, final review fix) and reads its own registry row via claim. Caller identity is SO_PEERCRED only. Not root;rev3=census-ruling-devbox-identity;basis=#486 A: the carlos-devbox service user, not root, replaces req.URL.Query with strict url.ParseQuery(req.URL.RawQuery), refuses malformed query encoding, and validates repeated allow values before reading the capped upload body. Stores the normalized allow list in its local links.json and returns owner-filtered entry data. The scanner loses file:Query; existing archive, spool and local registry reads remain, with no new filesystem or deployment-record read. file:Read@1922,whole:Route@4070 dce50fcab6a2b64a712d58a6f236cdf19ec6264ce7bccba96116ab94c1a81d58 |
| -internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. registry:Account@9457,registry:Alias@24401,registry:Alias@24488,registry:Alias@25068,registry:App@9473,registry:Health@13198,registry:Health@13324,registry:Host@10784,registry:Host@10841,registry:Host@10877,registry:Host@11620,registry:Host@13807,registry:Host@13902,registry:Host@14190,registry:Host@14216,registry:Host@14268,registry:Host@18863,registry:Host@20770,registry:Host@21078,registry:Host@21105,registry:Host@21920,registry:Host@22492,registry:Host@24822,registry:Host@24871,registry:Host@4701,registry:Host@4755,registry:Host@4805,registry:Host@5826,registry:Kind@17199,registry:Kind@17221,registry:Prefix@22467,registry:Socket@11684,registry:Socket@17078,registry:Socket@21086,registry:Status@4626,registry:Target@22479,registry:Tunnel@9317,registry:Tunnel@9488,registry:Version@17180,registry:Version@17282,whole:RegionalDomain@25710,whole:Route@10932,whole:Route@11040,whole:Route@11740,whole:Route@14341,whole:Route@14405,whole:Route@14456,whole:Route@21138,whole:Route@21145,whole:Route@21241,whole:Route@22355,whole:Route@23523,whole:Route@25702,whole:Route@294,whole:Route@3381,whole:Route@3439,whole:Route@5855,whole:Route@6744,whole:Route@6852,whole:Route@9379,whole:RouteAlias@24372,whole:RoutePath@21898 571d8e89d7c8e754b566c40946b0ee0965bf3925a71b07cde63f440bb33fda06 |
| +internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read. registry:Account@9457,registry:Alias@24401,registry:Alias@24488,registry:Alias@25068,registry:App@9473,registry:Health@13198,registry:Health@13324,registry:Host@10784,registry:Host@10841,registry:Host@10877,registry:Host@11620,registry:Host@13807,registry:Host@13902,registry:Host@14190,registry:Host@14216,registry:Host@14268,registry:Host@18863,registry:Host@20770,registry:Host@21078,registry:Host@21105,registry:Host@21920,registry:Host@22492,registry:Host@24822,registry:Host@24871,registry:Host@4701,registry:Host@4755,registry:Host@4805,registry:Host@5826,registry:Kind@17199,registry:Kind@17221,registry:Prefix@22467,registry:Socket@11684,registry:Socket@17078,registry:Socket@21086,registry:Status@4626,registry:Target@22479,registry:Tunnel@9317,registry:Tunnel@9488,registry:Version@17180,registry:Version@17282,whole:RegionalDomain@25710,whole:Route@10932,whole:Route@11040,whole:Route@11740,whole:Route@14341,whole:Route@14405,whole:Route@14456,whole:Route@21138,whole:Route@21145,whole:Route@21241,whole:Route@22355,whole:Route@23523,whole:Route@25702,whole:Route@294,whole:Route@3381,whole:Route@3439,whole:Route@5855,whole:Route@6744,whole:Route@6852,whole:Route@9379,whole:RouteAlias@24372,whole:RoutePath@21898 571d8e89d7c8e754b566c40946b0ee0965bf3925a71b07cde63f440bb33fda06 |
| @coverage . 2a0d672e4d101f46913c016237303a5b5f15226a3c018bb8e0b388179df9ac9c |
| @coverage infra/devbox a4d597f456ba1a8e0bbc0671e249eed6afd457ac206d84c724809b54051b8e10 |
| @coverage internal/devbox 42f6830904ebc3c1ffad34df93de727aaf64de4f548d33444e9a81b6596a8cc6 |
| -@coverage internal/edge 37736cc96ea2968c050ea02a97b36dfb3c54d0151217785c29c2ac70804dffbc |
| +@coverage internal/edge 40295427c7c0364fbc750ba1fd03210f29614452f6f22a4af9f00b6e3d2c84d8 |
| @coverage internal/tsidentity 580665b5051ea5ce8cd092d848d813ca1c24af424e2342b7b47f4ade4a21873e |