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 SigDBReader, 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 = SigDBReader("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.0.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.0.0
File Size Uploaded
sigdb-2.0.0.tar.gz 12.6 kB Details

Built distribution (wheel)

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

Total release size: 30.5 kB

Release files / sigdb-2.0.0.tar.gz

Download URL sigdb-2.0.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9ebf1d6c0160be4fb62feb6f1161b743b085b69c922d0f69156efaf672689a62
BLAKE2b-256 checksum
How to use checksums
18f452c833a8ab4f81c02d31b2c8903d7ca6bccb0b985a6d4becbe69e539cc79
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.0.0-py3-none-any.whl

Download URL sigdb-2.0.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c067a29bf832803fe199627e9e84c18872e1296803b6a107aaffaef08e50a2c
BLAKE2b-256 checksum
How to use checksums
4af35059771e72e8f8d261c6dddbdb3c416de683b3897267a45681a6a6e40cc7
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

2.1.0

2 release files

This release

2.0.0 This release

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