Certificate timeline & events
Every certificate in CertAutoPilot carries a timeline of its lifecycle events — issuance, renewal, import, distribution, revocation, and AD CS enrollment approval. 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.
Event types
| Type | When emitted | Payload highlights |
|---|---|---|
cert.requested | An AD CS (MSCA) enrollment was submitted and is waiting for CA-manager approval; or a CA-connector order was placed at the vendor | message with the CA request id, issuer type; for a connector the vendor, order id and validation record |
cert.validation | A step of a CA connector's domain validation before ordering: the validation was started, an approval e-mail was sent (with the address), or the vendor validated a domain | domain, method, e-mail address |
cert.approved | The CA manager approved that pending AD CS enrollment (not the CertAutoPilot approval workflow) | issuer type |
cert.issued | Issuance succeeded — including a reissue, which runs the issue job (operation reissue). A manual-DNS issuance writes it when the validation stores the certificate, not when the TXT records are generated. A CA connector rekey is recorded as cert.issued with the text "certificate rekeyed by …" | job id, issuer type, operation |
cert.renewed | A renewal succeeded | job id, issuer type |
cert.failed | Issuance, renewal or revocation failed (for a CA connector also: the vendor refused, the validation record could not be written, or the order deadline passed) — a failed re-issue has operation reissue, and its certificate keeps the status it had | job id, error code, message, operation |
cert.imported | An externally issued certificate was imported or re-imported | actor, operation (import / reimport) |
cert.revoked | CA confirmed revocation of the certificate, or of one retained version | job id, message (names the version for a version revoke) |
cert.distributed | One distribution target was deployed successfully (one event per target) | distribution id, target host, job id |
cert.distribution_failed | One distribution target failed (one event per target) | distribution id, target host, job id, error |
That is the complete list of types that are actually written. Two further names exist in the schema but are never emitted: cert.reissued (a reissue shows up as cert.issued) and cert.downloaded (downloads are recorded in the audit log as CERTIFICATE_DOWNLOADED, not on the timeline).
Expiry and renewal-failure are notification events (cert.expiring_soon, cert.expired, cert.renewal_failed, cert.revocation_detected), delivered through notification channels and syslog. They are a different set from the timeline events above and never appear here — a renewal failure shows on the timeline only as the generic cert.failed, and an expiry produces no timeline entry at all. Point alerting at the notification system, not at this endpoint.
How 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.
Timeline 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_cursorpointer). - Each entry expands to show the full payload + actor identity.
Query via API
GET /api/v1/projects/{projectId}/certificates/{id}/timeline
?cursor=<opaque>
&limit=50
limit defaults to 50 and is capped at 100. Returns the events (newest first) plus a next_cursor when more pages are available. See API reference.
Retention
Events carry a 365-day TTL: MongoDB expires each one a year after its timestamp, automatically. If your compliance policy needs a longer horizon, export the timeline before the year is out — raising the retention means altering the TTL index on cert_events.
Routing to notifications
Timeline events are not notification events — rules subscribe to the separate notification event catalog (for example cert.renewal_failed, distribution.failed). See notifications → event types for that catalog and templating.
Troubleshooting
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. There is no per-certificate sequence counter; the timeline is ordered by timestamp (newest first), with the event id as the tie-breaker.
See also
Video tutorial
Short, hands-on videos showing this feature working for real. English audio, English and Turkish subtitles. All video tutorials →