Izveidot kontuCreate account
‹ All playbooks
Check certificates before they expire

tech.ssl-expiry-check·version 1.0.0·draft

Check certificates before they expire

Every HTTPS endpoint the company runs has a certificate that is valid, matches its names, chains correctly, and is being renewed — anything else is a task with a deadline.

KasparsInfrastructure Engineerruns itProfile ›
Whenscheduled · weekly — weekly — certificates that lapse take the website and mail down with no warning
Who actsthe agent acts and reports
Time15 min active
Countryany country
Sign in to run thisThis playbook opens inside Brain Club. Sign in to read and run it.

When to use

Every week, for every domain and hostname the company serves over HTTPS. Not when a site is already down or throwing certificate errors in a browser — that is an incident, use tech.website-down. Not for the domain name itself expiring — that is tech.renew-domain, which this check must not overlap with (a valid certificate on a lapsed domain is still a red row).

Before you start

  • The domain list is current: every domain in the registrar list appears here, including defensive and
  • The hostname map exists: for each domain, which names are expected to answer with a certificate
  • It is known which certificates are automatic (ACME/Let's Encrypt) and which were bought and must be

The trail7 steps

  1. Collect the targetsagent

    Read the domain list and the hostname map; resolve each hostname to confirm it still points at our infrastructure.

    Done when the run has a list of hostnames to check, each marked expected / unexpected.

  2. Read each certificate from the outsideagent

    For every hostname, fetch the certificate a visitor actually receives: issuer, notBefore, notAfter, subject and SANs.

    Done when every hostname has an expiry date and days remaining in the table.

    ⛔ Never read the expiry from the renewal system's own records — read what the server serves.

  3. Verify the certificate fits the name and the chainagent

    Check the hostname is covered by the SANs, the chain validates from outside (no missing intermediate), and the certificate is not self-signed or for a neighbouring name.

    Done when each hostname is marked fit / misnamed / broken chain.

  4. Verify renewal is actually happeningagent

    For automatic certificates, compare notBefore with today: a Let's Encrypt certificate renewed within the last ~90 days means the job works; an old notBefore with a far expiry means it was bought once and nothing renews it. For bought certificates, confirm the renewal date is in the watch (ops.contract-renewal-watch or the domain list).

    Done when each certificate is marked auto-renewing / manual / orphaned.

  5. Check the endpoints behind the certificateagent

    Open each HTTPS endpoint; confirm it answers, redirects http→https where expected, and the certificate the browser sees matches S2.

    Done when each hostname is marked serving / stale cert / not answering.

    ⛔ A certificate renewed on disk but not reloaded is the classic false pass — S5 catches it.

  6. Flag and open tasksagent

    Every red row (under 30 days, misnamed, broken chain, orphaned, not answering) gets a task in the tasks module with the hostname, the finding, and a deadline before the expiry date.

    Done when every red row has a task id next to it.

  7. Reportagent

    Send the owner the weekly summary: how many hostnames checked, how many red, the earliest expiry, and the task ids opened.

    Done when the report is sent and the dated table is stored as evidence.

Checks — how we know it worked

  • Every hostname on the map appears in the table — a missing row is a miss, not a pass.
  • Every certificate has 30 days or more remaining, or has a task with a deadline before expiry.
  • Every automatic certificate shows a recent notBefore — renewal proven, not assumed.
  • Every hostname answers with the same certificate S2 recorded (ask the server, not the renewal tool).

If it goes wrong

SymptomResponse
Automatic certificate under 30 days, notBefore oldThe renewal job is broken: check the ACME account contact still receives mail, re-run the renewal by hand once, open a task with the outcome.
Server serves an older certificate than issuedThe service was not reloaded after renewal — reload it, re-check from outside in S5, note the service in the task so it is watched next run.
Hostname answers but is not on the mapA leftover or someone's new subdomain — record who it belongs to, ask the owner whether to keep, monitor or remove it.
Certificate expired, site showing errorsStop checking, escalate as an incident — hand to tech.website-down; this playbook records the failure, it does not fight the fire.
Chain validates locally but not from outsideMissing intermediate on the server — install the full chain, re-run S3 from a public resolver-side check.

What each step leaves behind

  1. S1the run has a list of hostnames to check, each marked expected / unexpected.
  2. S2every hostname has an expiry date and days remaining in the table.
  3. S3each hostname is marked fit / misnamed / broken chain.
  4. S4each certificate is marked auto-renewing / manual / orphaned.
  5. S5each hostname is marked serving / stale cert / not answering.
  6. S6every red row has a task id next to it.
  7. S7the report is sent and the dated table is stored as evidence.

Evidence to keep

The dated expiry table for the run · task ids opened and their deadlines · the weekly report as sent · for any red row, the raw certificate details (issuer, SANs, notAfter) captured at check time.

How this playbook improves

After every 10 runs ask: how many red rows, and did any certificate reach under 30 days twice — meaning the fix did not hold? Were there false alarms (a red row that was fine)? Did any hostname on the map disappear, or any serving hostname stay off the map? Did any certificate expire with no warning despite this check running? A new version changes the step that missed it, and says so in its change note.