Skip to main content

Certificate Transparency log streamer

Project description

Certificate Transparency Log Streamer

crtstream is a lightweight Certificate Transparency (CT) log streamer written in Python.
It continuously monitors CT logs and outputs newly issued certificates in real time.

It supports multiple output modes:

  • Domain names only
  • Human-readable summaries
  • Full structured JSON suitable for pipelines and data analysis

✨ Features

  • 📡 Real-time streaming from multiple CT logs
  • 📜 Supports X.509 and precert entries (RFC 6962)
  • 🧵 Multi-threaded (one thread per log)
  • 📦 Installable via pip
  • 🔌 Clean CLI interface
  • 🧾 JSON output suitable for SIEM, analytics, or storage
  • ⚙️ Default bundled logs.json, no setup required
  • 🛠 Custom CT log configuration supported via --logs

📦 Installation

From PyPI (recommended)

pip install crtstream

Or with pipx:

pipx install crtstream

From source (development)

git clone https://github.com/glaubermagal/crtstream.git
cd crtstream
pip install -e .

⚙️ Configuration

crtstream uses a default logs.json bundled with the package. You do not need to create a file manually.

Use default logs (no setup required)

crtstream

Use a custom CT logs file

crtstream --logs /path/to/logs.json

Example logs.json format

{
  "google_us": "https://ct.googleapis.com/logs/us1/argon2025h2",
  "google_eu": "https://ct.googleapis.com/logs/eu1/xenon2025h2",
  "cloudflare_nimbus": "https://ct.cloudflare.com/logs/nimbus2025",
  "digicert_yeti": "https://yeti2025.ct.digicert.com/log",
  "digicert_nessie": "https://nessie2025.ct.digicert.com/log"
}

🚀 Usage

Basic usage

crtstream

Print only domains

crtstream --domains-only

Output full JSON (one object per line)

crtstream --json

Custom logs file + JSON output

crtstream --logs /path/to/logs.json --json

🧾 JSON Output Format

Each line is a JSON object when using --json:

{
  "log_name": "google_us",
  "log_url": "https://ct.googleapis.com/logs/us1/argon2025h2",
  "entry_index": 123456,
  "timestamp": "2025-01-01T12:00:00Z",
  "certificate": {
    "domains": ["example.com", "www.example.com"],
    "subject": { "commonName": "example.com" },
    "issuer": { "commonName": "Google Trust Services" },
    "validity": {
      "not_before": "2025-01-01T00:00:00",
      "not_after": "2025-04-01T23:59:59"
    },
    "serial_number": "0x123abc",
    "public_key": {
      "type": "RSAPublicKey",
      "key_size": 2048
    },
    "version": "v3"
  },
  "raw_entry": { "...": "..." }
}

Ideal for:

  • Log ingestion pipelines
  • Data analysis
  • Security monitoring
  • Threat intelligence

🧠 How it works

  • Polls each CT log every few seconds
  • Fetches new entries using /ct/v1/get-entries
  • Parses X.509 or precert entries
  • Extracts SAN domains and certificate metadata
  • Streams output continuously to stdout

⚠️ Notes & Limitations

  • No persistent state (restarts from near-tip by default)
  • CT logs may rate-limit or temporarily fail
  • No filtering is applied by default

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

Please keep changes focused and well-documented.


📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crtstream-0.1.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crtstream-0.1.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file crtstream-0.1.3.tar.gz.

File metadata

  • Download URL: crtstream-0.1.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for crtstream-0.1.3.tar.gz
Algorithm Hash digest
SHA256 49b59026288a02f2bd8dd1f85f52005c51d1d73c7dcf247fcc974c51a995a515
MD5 ae3c9223af0b20ec7a79bee896518173
BLAKE2b-256 a7ef5ee8adc05fb4b01d04b4ca9f2b1eb0c9559c66ca253dd23300ceca24cff9

See more details on using hashes here.

File details

Details for the file crtstream-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: crtstream-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for crtstream-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f7f854e79eff4449af8e3fcd53f8c5dbc5ab89673469c4c6cc3dd5142effd4bb
MD5 b1ed82f404ab951ea046a268bd961481
BLAKE2b-256 2ede38498f1a0e942193400226322de6dd34ac9f57a856b81f78b26e2cfc365a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page