Skip to content

Security model

The proxy is designed for a trusted single-user developer workstation. The boundaries below are the load-bearing assumptions β€” read them before deploying anywhere else.

These cannot be changed by config or environment:

  • Loopback bind only. 127.0.0.1:3817, hardcoded. The host is intentionally not configurable.
  • Body size cap of 100 MiB on inbound requests. Defends against runaway local clients.
  • Path forwarding is 1:1. No path rewriting, no allowlist (by design β€” transparent proxy).
  • Client-supplied X-Git-Remote is stripped before the inspection middleware runs. A local process cannot spoof attribution.
  • Authorization & x-api-key are forwarded as-is. The proxy does not authenticate callers; Bifrost validates.
  • Authorization values are never logged. Only has_auth=true/false boolean.
  • Raw query strings are not logged. Only has_query=true/false.
β”Œβ”€β”€β”€β”€ Trusted ─────┐ β”Œβ”€β”€β”€β”€β”€β”€ Untrusted ──────┐
β”‚ the user β”‚ β”‚ the network β”‚
β”‚ the user's IDE β”‚ β”‚ any LAN host β”‚
β”‚ local processes β”‚ β”‚ any other user on a β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ multi-user machine β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The proxy trusts local processes on the same machine: it forwards whatever Authorization / x-api-key headers they supply.

  • Auth on the proxy. None. Anything reaching loopback gets forwarded.
  • Secret storage. None. The proxy holds no secrets, reads no API keys; the client supplies them per-request in headers.
  • Rate limiting. None. The proxy is transparent β€” Bifrost handles quota.
  • Anti-replay / signing. None. Same as above.
  • Audit ingestion. None. Logs are local. Centralized telemetry is out of scope.
LayerWhat it does
pprof guardIf pprof.enable: true, the bind address is validated at startup to be loopback (127.0.0.1, localhost, ::1). LAN binds are rejected.
http.MaxBytesHandler100 MiB body cap, applied to all inbound.
requestLogger scrubAuthorization, x-api-key, Cookie, Set-Cookie redacted (presence-only).
Argv-safe subprocessgit remote -v, lsof, ps all use exec.CommandContext with Cmd.Dir (not git -C cwd) β€” no shell, no interpolation.
Timeout guards2 s on git remote -v and process inspection; 30 s ReadHeaderTimeout.
Plaintext upstream warningIf upstream_url starts with http://, the proxy logs a startup warning so misconfigurations don’t go silent.
  • Linux /proc/<otherUser>/fd/* returns EACCES β€” cross-user inspection is intentionally unsupported. The proxy will simply forward without the X-Git-Remote header.
  • macOS uses lsof. If lsof is missing or restricted, attribution falls back to no header.
  • Windows PEB walk requires SeDebugPrivilege (which LocalSystem has by default for the machine-wide service). 32-bit target processes are unsupported and return ErrUnsupportedBitness.
  • Optional SO_PEERCRED / LOCAL_PEERCRED peer-UID check to refuse cross-user connections on multi-user Linux/macOS hosts.
  • Configurable body size cap (currently compile-time).