DocumentationModules

    23

    Certificate Management

    Certificate Management — Overview

    Certificate Management provides persistent monitoring of TLS/SSL certificates. It tracks expiry dates, sends alerts 30/14/7 days before expiry, and polls Certificate Transparency logs (crt.sh) to detect new certificates issued for your domains.

    Required tier:Security
    • •Scheduled TLS checks — configurable interval (1–72h)
    • •Expiry notifications via all configured channels (email, Telegram, Slack, ...)
    • •Grade A–F per certificate (chain validity, hostname match, key strength, days remaining)
    • •Certificate Transparency monitoring — daily poll of crt.sh for new certs
    • •Full check history with days-remaining timeline chart
    Certificate Management

    Interface Tabs

    TabDescription
    DashboardStat cards (Monitored / Valid / Expiring / Expired), expiry timeline bar chart, table of monitors requiring attention
    MonitorsList of all cert monitors with status, grade, days left. Expandable row shows full cert detail. Manual check button, add/edit/delete.
    CT AlertsNew certificates discovered in Certificate Transparency logs for monitored domains. Badge shows count of unacknowledged alerts.
    HistorySelect a monitor → line chart of days-remaining over time + table of individual checks.

    Grade Calculation

    Each check produces a grade (A/B/C/F) based on four criteria evaluated in order:

    GradeCondition
    FCertificate expired (days < 0) or connection error
    CHostname mismatch (CN / SAN does not match FQDN)
    BChain validation failed, or weak key (RSA < 2048 bit), or 0–13 days remaining
    B14–29 days remaining (cert otherwise valid)
    A≥ 30 days remaining, valid chain, hostname match, adequate key
    The grade is based only on expiry and structural validity — it does not include cipher suite analysis (which would require ~25s per check). For full SSL audit use Network Tools → SSL Audit.

    Monitor Configuration

    FieldDescriptionDefault
    NameDisplay name of the monitor—
    FQDNDomain name to check (without https://)—
    PortTLS port to connect to443
    IntervalHow often to run the check (hours)24h
    Notify before (days)Days before expiry to send a notification. Multiple thresholds can be selected.30, 14, 7
    The notification is sent only once per threshold (with ±1 day tolerance), not on every check near the threshold.

    Certificate Transparency Monitoring

    Every time a domain is checked, the system also queries the crt.sh public CT log API for any certificates issued for that domain (wildcard search: %.domain.tld). New findings are stored as CT Alerts.

    • •Detects certificates issued by third parties (potential phishing, misconfigured subdomains)
    • •Each CT entry is stored with: serial number, issuer, CN, SANs, validity period, crt.sh ID
    • •Alerts can be acknowledged to mark them as reviewed
    • •Badge on the CT Alerts tab shows count of unacknowledged alerts

    REST API

    All certificate management operations are available via REST API (Security tier, Bearer token required):

    MethodEndpointDescription
    GET/api/v1/certificates/summaryStatistics and expiry timeline
    GET/api/v1/certificates/monitorsList all monitors
    POST/api/v1/certificates/monitorsCreate monitor
    PUT/api/v1/certificates/monitors/{id}Update monitor
    DELETE/api/v1/certificates/monitors/{id}Delete monitor (CASCADE)
    POST/api/v1/certificates/monitors/{id}/checkTrigger immediate check → returns CertCheck
    GET/api/v1/certificates/monitors/{id}/historyCheck history (?limit=30)
    GET/api/v1/certificates/ct-alertsCT alerts (?limit=50, ?monitor_id=N)
    PUT/api/v1/certificates/ct-alerts/{id}/acknowledgeAcknowledge CT alert

    Architecture Notes

    Background Service

    CertificateMonitorService runs as an asyncio loop (30s tick). It uses FOR UPDATE SKIP LOCKED to safely distribute work across multiple workers. The check itself uses asyncio.open_connection with ssl.create_default_context() + cryptography.x509 parsing — no cipher enumeration, typically completes in under 2 seconds.

    Database tables

    TableDescription
    cert_monitorsWhat to monitor — FQDN, port, interval, notify thresholds
    cert_checksCheck history — full cert detail per run (CN, SANs, grade, key, fingerprint...)
    cert_ct_alertsCT transparency findings — unique per (monitor_id, serial_number)
    The service starts automatically with the uptime module license. It is governed by the same require_module("uptime") guard as Host Monitor.