Staging server. Your account won't work here. Build: dev@Dec/20-16:26
Hardenize has joined Red Sift! Find out more in our blog post.

Blog

Welcome to the Hardenize blog. This is where we will document our journey as we make the Internet a more secure place and have some fun and excitement along the way.

16 Oct
2018

Certificate Transparency
Webhook Notifications

by Ivan Ristić

We're continuing to develop our APIs; this month we extended our capabilities with Certificate Transparency (CT) events and webhooks, enabling our customers to receive programmatic real-time notifications of new certificates issued for their domain name space.

Events

Before we started to work on the webhook functionality, we decided to build a strong foundation is the form of events, which are things of interest that happen within an account. After all, we're interested in CT log entries today, but there is a myriad of other things in which we may be interested tomorrow. A generic mechanism for both events and webhooks will make for a much nicer experience in the long term.

An event, as a concept, is rather simple. It contains some metadata to document how it came to be and when, and to indicate who created it. The really interesting parts of an event are its type and the embedded data object, which carries the information of interest. For illustration, this is what our test event looks like:

{
    "id": 10001,
    "type": "test",
    "createdOn": "2018-09-03T14:09:59.000Z",
    "apiVersion": "0.14.0",
    "source": "hardenize",
    "data": {
        "message": "This is a simple test event."
    }
}

This concept of events is not particularly new or innovative. In fact, we've modelled our events after how they are implemented in the Stripe API. We liked their design and decided to adapt it for our needs.

Events are generated only if they are needed. In practice that means that you will first need to selectively activate generation of those event types that you intend to consume. This is all done via our APIs. After that, new events will be deposited into your account as they become available. Event lifetime is limited—you have to collect them within 10 days.

Webhooks

Our webhook implementation builds on top of events. When you create a webhook, you express your interest in a particular set of event types we can generate, and specify the URL at which we should deliver the events. We provide you some tools for the testing, to ensure that you will correctly handle our payloads. After that, whenever a new event is created we schedule one job for every configured webhook that matches the event type. On your end, you receive exactly the same event, plus some additional information that enables you to verify that the webhook came from us.

Should the delivery of a webhook fail, we try again later. In fact, we use an exponential back-off algorithm to try up to 10 times in total within roughly 24 hours. If your webhook remains unavailable for longer, you will miss some events. On the positive side, you can always pull the events from us via the API, provided you do that before the events themselves expire.

Certificate Transparency Event

With events and webhooks available, we added our first event type ct.entry. This event contains roughly the same information found in CT logs. Whenever we see a certificate with a hostname that matches the domain name space configured for an account, we create an event similar to the following:

{
  "log": "ct.googleapis.com/icarus",
  "index": 251676662,
  "timestamp": 1538747492396,
  "sha256": "7b72bbe8b7faeea24d9bd8ded5f057114a14ad503b33022b54b16603a8b074b7",
  "precert": false,
  "subject": "CN=www.example.com",
  "issuer": "C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3",
  "hosts": [
    "example.com"
  ],
  "chain": [
    "MIIGJTCCBQ2gAwIBAgISA9CTYlAcEi7o1Cyk3RM9D6/JMA0GCSqGSIb3DQEBCwUAMEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQDExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xODA1MDIxMTA2NTdaFw0xODA3MzExMTA2NTdaMBwxGjAYBgNVBAMTEWJvbm4tMDYucWx1ZWQubmV0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy+muYgsZOUD2epeJwP6ToDmE6YeO9T+gsf9ACuLbrQqC5JZPy+AmREuo3dU3dkmBRoU9Brpmo/KMQavKueGVW3DpAIJKemGBC0yWNFgTho4+DAOvSM4odcB96HPFIh0vp13LH5og/wsNZwt+n56mrUTrcqnZYbUwugBghb0QCptwCnHnKOk2/YdRRraasgmiFWYeNjCqBUR5iKqmubgBoCqqkBYzWUhjWc7aySKYQFpSlZ2d3t0IilJp5sZq5pDiHa58G6fGZSh9TIAZvuvozW762cghBZgEF3wlvKy1joSAWLalPYQcsd0v2G9F7vJOu6Rf9HAbmdKqnu0i8TExjwIDAQABo4IDMTCCAy0wDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBQlgfnFoFLAegwCUrKiuz+Nu61SCDAfBgNVHSMEGDAWgBSoSmpjBH3duubRObemRWXv86jsoTBvBggrBgEFBQcBAQRjMGEwLgYIKwYBBQUHMAGGImh0dHA6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b290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAwVAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcCARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAzMDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwuY3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsFAAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJouM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwuX4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlGPfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg=="
  ],
  "matchedHosts": [
    "example.com"
  ]
}

The complete explanations of the individual fields are available in our API documentation.