Skip to main content

CDN Mapping

Provides a JS library @ds-ukassel/cdns and Python library cdns to identify CDNs. All CDNs are listed in cdns.yaml in this repository, and dist/cdns.json in the package.

YAML Format

- name: AwesomeCDN
  homepage: https://www.awesomecdn.com
  type: commercial
  domains: # See "Domain patterns" below
    - 'awesomecdn.com'      # 'awesomecdn.com' is a full match of the domain (e.g. 'awesomecdn.com')
    - '**awesomecdn**'      # 'awesomecdn' is a substring of the domain (e.g. 'a.awessomecdn.com')
    - '*.cdn.awesome.com'   # '*' is a wildcard for a single domain level (e.g. 'a.cdn.awesome.com' or 'b.cdn.awesome.com')
    - '**.awesomecdn.*'     # '**' is a wildcard for one or more domain levels (e.g. 'a.b.awesomecdn.de' or 'c.d.e.awesomecdn.com')
  ranges:
    - range_type: 'ipv4'
      url: 'https://api.awesomecdn.com/ips-v4/'
    - range_type: 'ipv6'
      url: 'https://api.awesomecdn.com/ips-v6/'
    - range_type: 'combined'
      url: 'https://api.awesomecdn.com/ips/'
    - range_type: 'ipv4'
      ranges:
        - '111.111.111.111/32'
      last_updated: 1970-01-01
  asns:
    - 12345
    - 67890
  headers: # See "Header Patterns" below
    - X-AwesomeCDN:         # 'X-AwesomeCDN' header must be present
    - Server: AwesomeCDN    # 'Server' header must contain 'AwesomeCDN'
    - X-Cache: HIT          # 'X-Cache' header must contain 'HIT'
      X-Whatever:           # AND 'X-Whatever' header must be present

Domain Wildcard Syntax

When implementing the wildcard syntax for domains, the following rules apply:

  • * matches a single domain level
    • *.example.com matches abc.example.com
    • *.example.com does not match abc.def.example.com
  • ** matches one or more domain levels or any prefix
    • **.example.com matches a.example.com and b.c.example.com
    • **example.com matches example.com, a.example.com, and b.c.example.com

* and ** can appear anywhere in the domain string, including the beginning, middle, or end.

Regex Equivalents

  • * is equivalent to [^.]+ (matches any character except dots, one or more times)

  • ** is equivalent to .* (matches any character, including dots, zero or more times)

  • All special characters are escaped, e.g. . turns into \..

  • The regex receives the prefix ^ and suffix $.

Examples

  • **example.com -> ^.*example\.com$
  • *.example.com -> ^[^.]+\.example\.com$

Header Patterns

Header patterns have a few rules:

  • Header: (JSON: {"Header": null}) means the header must be present, but can have any value.
  • Header: foo (JSON: {"Header": "foo"}) means the header must be present and equal the value.
  • Multiple patterns in the same entry, e.g.
    Header-1:
    Header-2: bar
    
    or JSON: {"Header-1": null, "Header-2": "bar"} Means ALL header patterns must match.
  • Header keys are case-insensitive, but values are case-sensitive.

The values can use * as a wildcard for any number of characters, e.g. foo* matches foo, foobar, and foo123. Any amount of * can be used at different positions.

To use a literal *, escape it with a backslash: \*.

Types

Each CDN can have a designated type field. The type can either be commercial, private, public_assets or other.

  • commercial: CDNs used by different customers (e.g. Akamai, Fastly, ...)
  • private: CDNs used internally by a single company (e.g. Meta, Instagram, ...)
  • public_assets: CDNs providing public assets not uploaded by customers (e.g. BootstrapCDN)
  • other: CDNs with an entirely different model

The field is optional as this information isn't always available/clear.

Python API

def compile_domains(domains: list[str]) -> Pattern:
    ...
def compile_domain(domain: str) -> Pattern:
    ...

(source): Compile domain patterns to a RegExp according to the Domain Pattern rules.

def matches(headers: Dict[str, str], matcher: Dict[str, Optional[str]]) -> bool:
    ...
def match_headers(headers: Dict[str, str], matchers: List[Dict[str, Optional[str]]]) -> Dict[str, str]:
    ...

(source): Match response headers against the patterns according to the Header Pattern rules.

TS API

function compileDomains(domains: string[]): RegExp
function compileDomain(domain: string): RegExp

(source): Compile domain patterns to a RegExp according to the Domain Pattern rules.

function matchHeaders(headers: Record<string, string>, patterns: Record<string, string | null>[]

(source): Match response headers against the patterns according to the Header Pattern rules.

References

License

Original content created by members of the Distributed Systems Group is licensed under the MIT license. The information compiled in this repository has in part be collected from publicly available repositories and is intended for research purposes. Content created by third parties remains subject to its respective license. Please respect the original licensing terms and provide appropriate attribution when using or redistributing third party content. See our references for more information.

Metadata

Release files for cdns 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdns 0.1.4
File Size Uploaded Provenance Actions
cdns-0.1.4.tar.gz 16.8 kB With provenance Details for cdns-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdns 0.1.4
File Interpreter ABI Platform Actions
cdns-0.1.4-py3-none-any.whl Python 3 none any Details for cdns-0.1.4-py3-none-any.whl

Total release size: 35.1 kB

Release files / cdns-0.1.4.tar.gz

Download URL cdns-0.1.4.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cb2e39a94c2af01d41bb249c1ef61b1e874208a65b85da8dd62a4fcbc385efff
BLAKE2b-256 checksum
How to use checksums
a401ff5bbe52fd51a350387f0f010ca10d93851e22e86a960bef0ed568eab4a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / cdns-0.1.4-py3-none-any.whl

Download URL cdns-0.1.4-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5efb9f709d24ed11eb9916b74f1e136d4f5858bad7127411f75119db1efb892b
BLAKE2b-256 checksum
How to use checksums
bde26a4d973d5fe117902c9b55cda305662713bada66001cd75cf9a19a2cd3ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for cdns 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cdns-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page