Skip to main content

SignatureDB

PyPI Python License Format

Compiler and loader for .sigdb files: technology fingerprint rules compiled into a single Aho-Corasick automaton for fast matching of HTTP headers, HTML, scripts and other signals.

Install

pip install sigdb

Requires Python 3.11+ and zstandard.

Usage

from sigdb.core import Reader, build_sigdb

rules = {
    "nginx": {"headers": {"Server": "nginx"}},
    "wordpress": {
        "meta": {"generator": "WordPress"},
        "html": {"tag": "link", "attr": "rel", "value": "https://api.w.org/"},
    },
    "jquery": {"js": "jquery"},
}

build_sigdb(rules=rules, output_path="tech.sigdb", metadata={"dataset": "example"})

db = Reader("tech.sigdb")
db.match("Server: nginx/1.25.3").item.key                         # "nginx"
db.match_group("meta", "WordPress 6.4", name="generator").item.key  # "wordpress"
db.match_html('<link rel="https://api.w.org/" href="/wp-json/">').item.key  # "wordpress"
db.match_search({"js": ["jquery-3.7.1.min.js"]}).item.key          # "jquery"

Rules can also be compiled straight from a JSON file with compile_sigdb_json.

Rules

A rule set is a JSON object: technology name to groups of patterns.

  • Map groups (name -> value): headers, meta
  • List groups (string or list of strings): js, script_src, css, url, path, file, dns, subdomain, link, json, api, tls, server, framework, cms, cdn
  • html: string tag:X:attr:Y:value:Z or object {"tag", "attr", "value"}, or a list of either

Matching:

  • Case-insensitive, leading and trailing whitespace ignored.
  • Patterns are literal strings. Regex and version capture are not supported in format v2.
  • Inside a group, the value must start with the pattern (js:jquery matches jquery.min.js). headers patterns have no group prefix and match anywhere in Name: value.
  • If several rules share a pattern, the one defined first wins.

File format

"SIGT" | version (u8 = 2) | u32 len + header JSON | u32 len + zstd(items JSON)
       | u32 len + zstd(automaton) | SHA256(items + automaton)

Lengths are big-endian. The hash is checked on load (verify_hash=True by default). Version 1 files (Ed25519-signed layout) are rejected; rebuild them from the rules.

Tests

pip install -e .
for f in tests/test_*.py tests/validate_lib.py; do python "$f"; done

tests/golden/ holds rule sets with expected match results. After an intentional behavior change, regenerate them with python tests/test_golden.py --regen and review the diff.

License

MIT

Metadata

Release files for sigdb 2.1.0

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

Source distribution (sdist)

Source distribution for sigdb 2.1.0
File Size Uploaded
sigdb-2.1.0.tar.gz 12.6 kB Details

Built distribution (wheel)

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

Total release size: 30.3 kB

Release files / sigdb-2.1.0.tar.gz

Download URL sigdb-2.1.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8121cfeec59420540e99c501f2b7c43081988e7ec39276ebf969df4ca9e13128
BLAKE2b-256 checksum
How to use checksums
c4f3b04df3f3c5e0ba06cdd30b6308ad5f3c99aa6c677fe1279f2dd55c95a35d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 26, 2026.

Transparency log

Release files / sigdb-2.1.0-py3-none-any.whl

Download URL sigdb-2.1.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fb433e04c4bf61ed74dd990509fffc15583b63c311cf18e765c2b31b9222214
BLAKE2b-256 checksum
How to use checksums
964f83dc11e88f08f77fa7bf05b0414dec1eba727562a3d39f6365239023063c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

3.0.0

2 release files

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

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