Repository navigation
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 aController:WebhookController.Notify, built likeEnrichandAuthorize. A notification cannot deny the request, so theallowfield of the response is ignored.Controller.NotifyX509Issuedbuilds 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.raProvisionerandattProvisioner, so external implementations ofprovisioner.Interfaceare not affected. SCEP does not implement it and keeps its own notifications, which carry the transaction ID, so SCEP is not notified twice.context.WithoutCancelso a client that disconnects does not cancel it.Meter.X509WebhookNotified, exported asx509_webhook_notified_total, like the enriching and authorizing webhooks.Notes for review:
Meterinterface affects external implementations of it, the same way the earlier webhook metrics did.Not included: SSH certificates, and failure notifications for X.509.
Fixes #2821