Skip to content

Send NOTIFYING webhooks for issued X.509 certificates - #2822

Open
dcdamien wants to merge 1 commit into
smallstep:masterfrom
dcdamien:x509-notifying-webhooks
Open

dcdamien wants to merge 1 commit into
smallstep:masterfrom
dcdamien:x509-notifying-webhooks

Conversation

@dcdamien

Copy link
Copy Markdown

NOTIFYING webhooks were added for SCEP in #1544 and are only called by the SCEP provisioner. A NOTIFYING webhook configured on any other provisioner is accepted by the admin API but never fires, and no webhook is called when a certificate is renewed or rekeyed.

This calls NOTIFYING webhooks after an X.509 certificate is signed (signX509) or renewed/rekeyed (renewContext), for every provisioner backed by a Controller:

  • WebhookController.Notify, built like Enrich and Authorize. A notification cannot deny the request, so the allow field of the response is ignored.
  • Controller.NotifyX509Issued builds the body the way the SCEP notification does: the signed certificate with its DER bytes, the CSR when there is one (not on renewal), and the provisioner name.
  • Provisioners are reached through an optional interface, next to raProvisioner and attProvisioner, so external implementations of provisioner.Interface are not affected. SCEP does not implement it and keeps its own notifications, which carry the transaction ID, so SCEP is not notified twice.
  • The certificate exists at that point, so a failed notification is logged and does not fail the request, and it uses context.WithoutCancel so a client that disconnects does not cancel it.
  • Each call is counted by a new Meter.X509WebhookNotified, exported as x509_webhook_notified_total, like the enriching and authorizing webhooks.

Notes for review:

  • Adding a method to the exported Meter interface affects external implementations of it, the same way the earlier webhook metrics did.
  • The notification carries only the certificate, the CSR and the provisioner name, like SCEP. It does not carry the extra fields the enriching and authorizing webhooks get on the sign path (for example attestation data), because the same path serves renewals, where those are not available.
  • Like the other webhooks, a notification runs synchronously and can delay the response by up to the webhook timeout.

Not included: SSH certificates, and failure notifications for X.509.

Fixes #2821

NOTIFYING webhooks were only called by the SCEP provisioner, and no
webhook was called when a certificate was renewed or rekeyed.

Call them after an X.509 certificate is signed or renewed, for every
provisioner backed by a Controller. A notification cannot deny the
request: the allow field of the response is ignored, a failure is
logged and does not fail the request, and the notification is not
canceled with the request. SCEP keeps its own notifications.

Fixes smallstep#2821
@github-actions github-actions Bot added the needs triage Waiting for discussion / prioritization by team label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs triage Waiting for discussion / prioritization by team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NOTIFYING webhooks are only called for SCEP, and never on renewal

1 participant