Skip to content

Detect edge hosting (CDN or edge platform) separately from the origin host, from headers, IP ranges and ASN #1807

Closed

Description

@nc9

Problem

An audit says a site "uses Cloudflare" or "uses Vercel" but does not say what that means: is Cloudflare a proxy in front of some other origin, or is the site hosted on that platform? The two are different facts. A site behind Cloudflare in front of a WordPress host is not "hosted on Cloudflare", and its server location is not the CDN's. Today the report cannot tell them apart, and it has no way to say "edge hosted" for sites that run on an edge platform (Vercel, Netlify, Cloudflare Pages) with no separate origin.

What is detected today

From packages/tech-detect/src/fingerprints/:

  • cdn.ts (category cdn, header based): Cloudflare (cf-ray, server: cloudflare, cf-cache-status), Amazon CloudFront (x-amz-cf-id, x-amz-cf-pop, via), Fastly (x-served-by, x-fastly-request-id, via: varnish), Akamai, Vercel Edge, BunnyCDN, KeyCDN.
  • hosting.ts (category hosting): Firebase Hosting, Vercel, Netlify, GitHub Pages, Cloudflare Pages, Render, Fly.io, Heroku, AWS S3.
  • packages/waf-detect separately classifies Cloudflare, Akamai and AWS WAF from headers, for block pages.
  • The only fingerprint input types are page-derived (header, meta, script, html, dom, url-path, url-host, tag-attr). Nothing in tech-detect reads the resolved IP or an ASN. Google Cloud CDN is a known gap (its Via: 1.1 google header is shared with other products).

So "a CDN is present" and "a platform hosts the site" are both detected, but as unrelated technology rows, with no edge/origin relationship, no IP or ASN evidence, and no provider coverage for Azure Front Door, Google Cloud CDN, CDN77, StackPath, Imperva or Sucuri.

Proposal

Report an edge result for the audited host, separate from the origin hosting provider:

  • Edge: the CDN or edge platform that answers the request (Cloudflare, CloudFront, Vercel, Netlify, Fastly, Akamai, Azure Front Door, Google Cloud CDN, and so on).
  • Origin: the host behind it, when it can be told apart (for example x-powered-by, server, platform headers that leak through, or a distinct origin IP). Report "unknown" rather than guess.
  • Edge hosted: set when the platform is both edge and host (Vercel, Netlify, Cloudflare Pages), so there is no separate origin.

Sources, strongest first: platform-specific response headers, then the resolved IP matched against published provider IP ranges, then the ASN of the resolved IP. Each result records which source matched, so a consumer can judge it.

Notes

  • The resolved-IP source needs the host's A/AAAA answer. Add hosting procvider and server #10 (hosting provider, IP, country) needs the same lookup, so the two should share it.
  • IP range lists change. Ship them as generated data with a refresh script and a stated date, not hand-edited constants.
  • When an edge is detected, an IP-derived country is the edge node's location, not the origin's. The report must not present it as where the site is hosted.

Acceptance Criteria

  • Edge detection uses three sources, and each result records which one matched (header, ip-range or asn): platform response headers (the existing cdn.ts and hosting.ts signals), the resolved IP matched against published provider ranges, and the ASN of the resolved IP.
  • Coverage includes at least Cloudflare, Amazon CloudFront, Vercel, Netlify, Fastly and Akamai, plus Azure Front Door and Google Cloud CDN, which have no fingerprint today.
  • The report and JSON output (-f json) carry the edge provider separately from the origin hosting provider. When no origin can be identified the origin is reported as unknown, not as the edge.
  • A host on an edge platform with no separate origin (Vercel, Netlify, Cloudflare Pages) is reported as edge hosted.
  • When an edge is detected, the GeoIP country from Add hosting procvider and server #10 is labelled as the edge location and is not presented as the origin's country. With no edge, it is unchanged.
  • Existing cdn and hosting technology rows keep working: no technology that is detected today disappears, and the rule and golden tests still pass.
  • Unit tests use header fixtures and IP fixtures: each provider is detected from its headers alone and from an IP in its range alone, a lookalike header or an IP just outside the range is not detected, and an origin behind an edge is reported separately.
  • The IP range data is generated by a script with the refresh date recorded, and a test fails if the data file is missing a provider listed in the coverage criterion.
  • Docs (docs/) describe the edge and origin fields, how each source is judged, and the edge-location caveat on country; make validate passes.
  • The PR states whether the squirrelscan agent skill needs a change.

Activity

  1. added
    enhancement
    size: L
    engine
    on Nov 13, 2026
  2. nc9 commented on Nov 13, 2026

    @nc9
    ContributorAuthor

    Decision (lead, 2026-11-13): use DB-IP ASN Lite (CC BY 4.0, with attribution) for ASN lookups, plus the providers' own published IP-range files (Cloudflare, CloudFront, Fastly, Google Cloud, Azure Front Door), with a refresh script. Lookups stay offline at runtime. Akamai, Vercel and Netlify publish no complete list, so they stay detected by headers and ASN. Combined CLI size growth with #10 stays under 10 MB.

  3. nc9 commented on Nov 13, 2026

    @nc9
    ContributorAuthor

    Decision (lead, 2026-11-13): a match on Google Cloud's published ranges is shown as provider information only, never as an edge. Google publishes no Cloud CDN-only list, so a plain VM would otherwise read as a CDN edge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineenhancementsize: L

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions