Skip to content

security/tls-certificate: opt-in proxy-resolves-names mode for the TLS handshake behind HTTPS_PROXY (follow-up to #1259) #1317

Closed

Description

@nc9

Follow-up to #1259 (item 2 of the PR #1306 review).

security/tls-certificate now tunnels its handshake through HTTPS_PROXY / HTTP_PROXY, but it resolves the name itself, vets the address with the egress guard and CONNECTs to the vetted address, never the name (so the proxy's DNS and a rebinding answer cannot redirect it). A name this machine cannot resolve is therefore "not checked", and a proxy that only allows hostnames refuses an address CONNECT. #1259's own setup (an egress proxy that owns DNS and enforces an allowlist by name) is not met.

What

An opt-in mode where the proxy resolves names: CONNECT by name, for the audited host and its www/apex counterpart only, never for a host derived from page content (certificate names, links), behind an explicit setting that is off by default.

Acceptance Criteria

  • The mode is off by default and enabled only by an explicit setting (a squirrel.toml key or a CLI flag), documented with the SSRF trade-off: the proxy, not squirrel, decides where the name resolves.
  • With it on, a handshake to the audited host and to its www/apex counterpart uses CONNECT <name>:<port>, with the name as SNI and verification intact, and no local resolution of the name.
  • With it on, a name that is not the audited host or its counterpart is still vetted locally and pinned to the address, never CONNECTed by name.
  • An IP literal, a metadata hostname and any host the egress guard refuses without a lookup are refused in both modes before a byte is sent.
  • A proxy that refuses, hangs or fails the CONNECT still gives a "Not checked" entry with that reason, never a pass or a crash, and proxy credentials never appear in a result or log.
  • Tests cover the audited host, the counterpart, a page-derived host, an IP literal and a refusing proxy, with a CONNECT proxy fixture.
  • The rule page documents the setting and the trade-off, and make validate passes in docs/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clienhancementsize: M

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions