Certificate timeline & events

Every certificate in CertAutoPilot carries a timeline of every lifecycle event — request, approval, issuance, renewal, distribution, revocation, download. Events are event-sourced (not log-parsed) and stored in the cert_events collection with cursor-based pagination; the timeline surface in the UI is just a read over this collection.

01Event types

TypeWhen emittedPayload highlights
cert.requestedIssuance form submittedactor, issuer, subject
cert.approvedApproval request accepted (if policy gates issuance)approver, approval_id
cert.issuedCA returned the certificatefingerprint, not_before, not_after, chain_depth
cert.renewedRenewal (or reissue) succeededtrigger (scheduler/manual/reissue), new fingerprint
cert.renewal_failedRenewal attempt failed (every retry)attempt, error_class, next_retry_at
cert.expiring_soonExpiration check sweeps at 30/14/7/3/1 day thresholdsdays_remaining, threshold
cert.expiredPast not_afterexpired_for
cert.revokedCA confirmed revocationreason_code, reason, actor, note
cert.distributedDistribution finished successfullydistribution_id, module, targets_succeeded
cert.distribution_failedDistribution ended in failed / partialdistribution_id, error_class, targets_failed
cert.distribution_rolled_backRollback executeddistribution_id, rolled_back_by
cert.downloadedManual download through the UI or APIformat, actor, ip
cert.policy_violationIssuance blocked by the certificate policyrule, offending_value
cert.ocsp_revokedDiscovery probe sees OCSP status revokedresponder, checked_at
cert.msca_pendingMSCA CA returned pending (manual approval needed)request_id, connection_id
cert.msca_approvedMSCA pending request approved in Windowsrequest_id
cert.msca_pending_timeoutMSCA pending exceeded 7 daysrequest_id

02How events are emitted

A singleton CertEventEmitter injected into every service calls Emit() synchronously from the domain code. Emission is best-effort — a transient Mongo write failure is logged but does not block the action. For critical audit trails use the separate HMAC-chained audit logs which are transactional.

03Timeline on the UI

  • Certificate detail page → Timeline tab.
  • Filter by event type (checkboxes).
  • Cursor-based pagination (the server returns 50 events per page with a next_cursor pointer).
  • Each entry expands to show the full payload + actor identity.

04Query via API

GET /api/v1/projects/{projectId}/certificates/{id}/events
    ?type=cert.renewed,cert.revoked
    &after=2026-01-01T00:00:00Z
    &limit=100
    &cursor=<opaque>

Returns the events plus a next_cursor when more pages are available. See API reference.

05Retention

Events are retained indefinitely by default. If your compliance policy needs a retention cutoff, run a scheduled db.cert_events.deleteMany({"ts": {"$lt": ...}}) job; CertAutoPilot does not auto-trim.

06Routing to notifications

Every event can trigger a notification rule. See notifications → event types for the full mapping and templating.

07Troubleshooting

Expected event missing from the timeline

Emission is best-effort; a transient Mongo issue can drop an event. Cross-check with Jobs (every workflow writes a job record) or the Audit log (transactional and chained).

Events arrived out of order

Events are timestamped at emit. Clock skew between API/worker/scheduler pods can produce sub-second out-of-order display. Order by seq (monotonic per-cert counter) rather than timestamp for strict ordering.