Skip to content

Ability to limit which CT log to listen to #109

Description

When you're running certstream on cheap VPS, you'll notice very high CPU usage because it connects to lots of CT logs.

By limiting where it can connect to, I was able to force certstream use much less CPU usage.

For example, if I block (return "0.0.0.0" for "*ct.sectigo.com" in DNS server):

ct-watcher.go:410: Could not get STH for 'https://tiger2026h2.ct.sectigo.com': Get "https://tiger2026h2.ct.sectigo.com/ct/v1/get-sth?": tls: failed to verify certificate: x509: certificate is not valid for any names, but wanted to match tiger2026h2.ct.sectigo.com
ct-watcher.go:359: Worker for 'https://tiger2026h2.ct.sectigo.com' failed - could not fetch STH
ct-watcher.go:360: Stopping worker for CT log: https://tiger2026h2.ct.sectigo.com
ct-watcher.go:216: Removing worker for CT log: https://tiger2026h2.ct.sectigo.com
ct-watcher.go:410: Could not get STH for 'https://tiger2026h1.ct.sectigo.com': Get "https://tiger2026h1.ct.sectigo.com/ct/v1/get-sth?": tls: failed to verify certificate: x509: certificate is not valid for any names, but wanted to match tiger2026h1.ct.sectigo.com
ct-watcher.go:359: Worker for 'https://tiger2026h1.ct.sectigo.com' failed - could not fetch STH
ct-watcher.go:360: Stopping worker for CT log: https://tiger2026h1.ct.sectigo.com
ct-watcher.go:216: Removing worker for CT log: https://tiger2026h1.ct.sectigo.com

Please consider adding an option to control where it can connect to.

Benefits:

  • Much less CPU usage
  • Internet bandwidth decreases: great for people who have internet montly cap

e.g., Config example

  • tue/false switch
limit_ct_server: true <--- default: false, false allows all CT logs
    ct_server_allowed: (googleapis|letsencrypt.org).com$ <---  allows connection only to those CT logs
  • When using null (or no specification at all), allow all CTs
limit_ct_servers: null
  • Here, allowing those 2 domains and its subdomains only
limit_ct_servers:
  - letsencrypt.org
  - googleapis.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestionSuggestions on how to improve the project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions