pangolin/server/lib/traefik
Owen 8419370e5b
Keep tenants from publishing Pangolin's internal services via local sites
Traefik dials a local site's targets from inside Pangolin's own network, so
an org admin could create a local site with a target such as pangolin:3001
and publish the internal API (including the unauthenticated
/traefik-config, which lists every org's header values and gateway trust
tokens) on their own hostname. disable_local_sites was only read by the
dashboard; the server-side check in createSite was commented out.

- createSite refuses local sites when flags.disable_local_sites is set or
  "local" is not in traefik.site_types, and basic WireGuard sites when
  flags.disable_basic_wireguard_sites is set.
- New localSiteTargetError rejects loopback, unspecified, link-local
  (incl. 169.254.169.254), broadcast, localhost, the internal hostname,
  gerbil, traefik and badger. createTarget, updateTarget and blueprint
  targets refuse them on local sites, and both Traefik config generators
  skip existing ones.
- Optional traefik.config_token: when set, GET /traefik-config requires
  "Authorization: Bearer <token>" (constant-time compare). Unset keeps the
  old behaviour and logs a warning once. The installer now generates the
  token and writes it to config.yml and Traefik's HTTP provider headers.
- Migration notes for 1.28.0 cover the config change and a query for
  existing targets that will stop routing.

PAN-1885 / GHSA-jrw8, rx89 part of PAN-1799
2026-11-25 19:34:53 -05:00
..
aiGatewayMiddlewares.ts Pass 1 of pulling traefik config into functions 2026-08-17 12:00:12 -04:00
browserGateway.ts Only trust p-host when Traefik stamps the trust token 2026-11-23 10:44:54 -05:00
certResolver.ts Support matching on the base wildcard resources 2026-11-02 15:30:16 -05:00
getTraefikConfig.ts Keep tenants from publishing Pangolin's internal services via local sites 2026-11-25 19:34:53 -05:00
headersMiddleware.ts Merge upstream/dev into feature-response-headers 2026-09-01 13:40:49 +02:00
index.ts Format all files 2025-12-09 10:56:14 -05:00
loadBalancer.test.ts fix merge 2026-10-15 12:01:31 -04:00
loadBalancer.ts fix merge 2026-10-15 12:01:31 -04:00
middleware.test.ts ✨ handle redirect request in badger's verifySession 2026-09-18 20:29:52 +02:00
middleware.ts ✨ handle redirect request in badger's verifySession 2026-09-18 20:29:52 +02:00
mtls.ts Add mtls to blueprint, policy, and oss getTraefikConfig 2026-10-20 10:02:44 -04:00
pathEncoding.test.ts Add resource column to hc and remove — 2026-04-16 17:42:30 -07:00
redirect.ts Support matching on the base wildcard resources 2026-11-02 15:30:16 -05:00
rule.test.ts Fix wildcard resource domain pulling 2026-11-03 10:40:36 -05:00
rule.ts Fix wildcard resource domain pulling 2026-11-03 10:40:36 -05:00
siteResourceAlias.ts Sanitize values before including in treafik config 2026-10-27 15:10:08 -04:00
traefikConfig.test.ts Format all files 2025-12-09 10:56:14 -05:00
TraefikConfigManager.ts Fix wildcard resource domain pulling 2026-11-03 10:40:36 -05:00
types.ts Support matching on the base wildcard resources 2026-11-02 15:30:16 -05:00
utils.ts fix: simplify path encoding per review — inline utils, use single key scheme 2026-03-01 15:48:26 +05:30