Pin the resolved address for git clones and fetches #320

Open
opened 2026-09-21 20:19:30 +00:00 by sharang · 0 comments
Owner

Follow-up to #294.

Today: GitOps::check_remote resolves the remote right before every clone and fetch and requires every address to be public, and libgit2 redirects are off. libgit2 then resolves the name again to connect, and there is no hook to hand it the checked address. A name that answers public to the check and private to libgit2 (deliberate DNS rebinding at near-zero TTL) is not covered. Chosen deliberately on 2026-09-21 to ship the MVP-0 baseline, with this issue tracking the rest.

Options:

  • A. A custom libgit2 smart-HTTP transport on top of compliance_core::guarded_net, so git gets the same pinned resolver and hop checks as every other client. Jev's long-term pick, 0.53.
  • B. Clone and fetch through the git CLI with -c http.curloptResolve=host:port:ip and -c http.followRedirects=false, with tokens passed via the environment or askpass, never argv.
  • C. Network-level egress filtering for the agent, so no private range is reachable at all.

Acceptance: a stub or a local DNS server whose answer flips between public and private cannot make a clone or fetch reach the private address; there is a test for it.

Follow-up to #294. **Today:** `GitOps::check_remote` resolves the remote right before every clone and fetch and requires every address to be public, and libgit2 redirects are off. libgit2 then resolves the name *again* to connect, and there is no hook to hand it the checked address. A name that answers public to the check and private to libgit2 (deliberate DNS rebinding at near-zero TTL) is not covered. Chosen deliberately on 2026-09-21 to ship the MVP-0 baseline, with this issue tracking the rest. **Options:** - **A.** A custom libgit2 smart-HTTP transport on top of `compliance_core::guarded_net`, so git gets the same pinned resolver and hop checks as every other client. Jev's long-term pick, 0.53. - **B.** Clone and fetch through the git CLI with `-c http.curloptResolve=host:port:ip` and `-c http.followRedirects=false`, with tokens passed via the environment or askpass, never argv. - **C.** Network-level egress filtering for the agent, so no private range is reachable at all. **Acceptance:** a stub or a local DNS server whose answer flips between public and private cannot make a clone or fetch reach the private address; there is a test for it.
sharang added this to the R1 · Dynamic & OT depth milestone 2026-09-21 20:19:30 +00:00
sharang added the security label 2026-09-21 20:19:30 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#320