Set up Ticketing with a Webhook
Send Mondoo tickets as JSON to your own HTTPS endpoint, and verify that every delivery comes from Mondoo.
Set up a webhook integration in a space to send the tickets users create in Mondoo to an HTTPS endpoint you run. Use it when Mondoo has no dedicated integration for your ticketing system, or when a service of your own, such as middleware that forwards tickets into an internal system, needs to receive them first.
For an overview of ticketing, read Track and Fix Findings with Ticketing.
Before you begin
-
To add the integration, you need the Editor or Owner role, or another role with this permission. To create tickets, team members need the Editor or Owner role, or another role with permission to create tickets. To see every role, read Roles and permissions.
-
An HTTPS endpoint that accepts
POSTrequests with a JSON body and responds with a2xxstatus code. Mondoo sends deliveries from the Mondoo cloud, so the endpoint must be reachable from the internet. Mondoo doesn't deliver to private network addresses.
Add a webhook integration
-
In the Mondoo App, navigate to the space where you want to set up ticketing and, in the side navigation bar, select Integrations.
-
Select INSTALL, then choose the Ticket Systems category.
-
Select Webhook.
-
In the Integration Name box, enter a name that clearly shows where the webhook delivers tickets.
-
In the Webhook URL box, enter the HTTPS URL of your endpoint.
-
Under Authentication, choose how your endpoint confirms that a delivery comes from Mondoo. You can turn on either method, or both. To learn how each method works, read Authenticate deliveries.
-
To sign deliveries, enable Sign deliveries, select GENERATE SECRET, then select COPY SECRET and store the secret in your endpoint's configuration. You can also paste a secret you generated yourself.
-
To send a static credential, enable Send an authentication header, then enter the Header name (for example,
Authorization) and the Header value (for example,Bearerfollowed by your token).

Mondoo never shows a signing secret or a header value again after you save the integration. Copy the secret before you select CREATE INTEGRATION.
-
-
Send close notifications is on by default for new integrations: closing a ticket in Mondoo sends a delivery to your endpoint. You can turn this off now, or later on the integration's settings page.
-
To create a Mondoo ticket and send a delivery when an asset becomes more exposed to attack, enable Automatically create tickets on drift. To learn more, read Automatically create tickets on drift.
-
Select the CREATE INTEGRATION button.
Authenticate deliveries
Anyone who learns your webhook URL can send requests to it. Authentication lets your endpoint reject every request that doesn't come from Mondoo.
Sign deliveries
This is the recommended method. Mondoo signs each delivery with HMAC-SHA256, following the Standard Webhooks specification, and adds three headers:
| Header | Value |
|---|---|
webhook-id | A unique ID for the delivery. It matches the delivery's Idempotency-Key header. |
webhook-timestamp | The time Mondoo sent the delivery, in seconds since the Unix epoch. |
webhook-signature | v1, followed by the base64-encoded signature. The specification allows several space-separated signatures, so check each one. |
The secret never leaves Mondoo or your endpoint, so a signature proves both that Mondoo sent the delivery and that nobody changed it on the way. Checking the timestamp also stops an attacker from replaying a delivery they captured.
A signing secret is whsec_ followed by the base64 encoding of 24 to 64 random bytes. The secret Mondoo generates uses 32 bytes.
Send an authentication header
Choose this method when your endpoint, or a gateway in front of it, can check a static credential but can't compute a signature. Mondoo sends the header and its value with every delivery, so the value protects your endpoint only as long as it stays secret. Prefer signing when you can.
Mondoo sets Content-Type, Idempotency-Key, and the webhook-* headers itself, so you can't use those names.
Verify a signed delivery
To verify a delivery, your endpoint must:
-
Read the raw request body. Verify the exact bytes Mondoo sent, before you parse the JSON.
-
Reject the delivery if
webhook-timestampis more than five minutes away from the current time. -
Decode the part of the secret after
whsec_from base64. Use the result as the HMAC-SHA256 key to sign the string{webhook-id}.{webhook-timestamp}.{body}. -
Encode the result as base64 and compare it, in constant time, with the value after
v1,in each signature inwebhook-signature. Accept the delivery if any signature matches.
Any Standard Webhooks library performs these steps for you. If you prefer to verify without a dependency, these examples do the same:
import base64
import hashlib
import hmac
import time
TOLERANCE_SECONDS = 5 * 60
def verify_mondoo_webhook(secret: str, headers: dict, body: bytes) -> bool:
"""Return True when a delivery is signed with secret and is recent."""
msg_id = headers["webhook-id"]
timestamp = headers["webhook-timestamp"]
signatures = headers["webhook-signature"]
if abs(time.time() - int(timestamp)) > TOLERANCE_SECONDS:
return False
key = base64.b64decode(secret.removeprefix("whsec_"))
signed = f"{msg_id}.{timestamp}.".encode() + body
expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
for signature in signatures.split(" "):
version, _, value = signature.partition(",")
if version == "v1" and hmac.compare_digest(value, expected):
return True
return FalseHeader names are case-insensitive. If your framework doesn't lowercase them, look them up accordingly.
What Mondoo sends
Each delivery is a POST request with a JSON body:
-
typeisTYPE_CREATEDwhen Mondoo creates a ticket,TYPE_UPDATEDwhen Mondoo updates the ticket, andTYPE_CLOSEDwhen it's closed. -
caseholds the Mondoo ticket. -
contentholds the ticket's description and comment as Markdown: the finding details, remediation, and affected assets. Mondoo includes it with created and updated tickets.
Mondoo treats a 2xx response as a successful delivery. Any other status code fails the delivery.
Link Mondoo tickets to your tickets
When your endpoint files its own ticket for a TYPE_CREATED delivery, it can tell Mondoo about it. Return a JSON body with the ticket's ID and a link to it:
{
"ticket_id": "INC-1234",
"ticket_url": "https://tickets.lunalectric.com/browse/INC-1234"
}Mondoo shows that ID and link on the Mondoo ticket. If your endpoint returns no ID, the ticket shows the delivery's Idempotency-Key instead, with no link.
-
Mondoo also accepts the field names
ticketIdandticketUrl. -
Mondoo ignores any other fields in the body, so your endpoint can return its own API's response as long as it includes these fields.
-
Mondoo reads the body on a best effort basis. A body that isn't JSON or doesn't include either field never fails the delivery.
-
The ID and the URL can each be at most 512 characters. Mondoo ignores a longer ID and uses the delivery's
Idempotency-Keyinstead. -
The URL must be an absolute
httpsURL with a host and no embedded credentials. If Mondoo can't use the URL, the ticket shows no link, and the integration's page shows a warning with the URL your endpoint returned.
Verify the integration
Mondoo doesn't contact your ticket system when you save the integration, so a mistyped URL, a wrong token, or a missing permission only shows up when Mondoo files its first ticket. Create one test ticket to confirm that the integration works:
-
In the side navigation bar, select Findings, then open any check or advisory. To learn more, read Create Tickets from Checks or Create Tickets from Advisories.
-
Select ACTIONS > Create ticket.
-
In Select Integration, choose the integration you just added, provide the fields it asks for, and select CREATE TICKET.
Mondoo confirms that the ticket is being created and that the external ticket will be ready shortly.
-
In the side navigation bar, select Ticketing and find the test ticket on the Open tab. As soon as Mondoo has filed it, the External Ticket column shows the issue or ticket it created (for an email integration, the recipient).
-
In your ticket system, confirm that the new issue or ticket exists and contains the finding details.
-
Close the test ticket in Mondoo. If the integration closes external tickets automatically, Mondoo closes the external one too. To learn more, read Close a ticket.
If the External Ticket column stays empty or the ticket's status is Error, read Troubleshoot below.
For a webhook integration, the External Ticket column shows the ID your endpoint returned, or the delivery's Idempotency-Key. To learn more, read Link Mondoo tickets to your tickets.
Troubleshoot
A failed delivery doesn't change the integration's status. Instead, Mondoo records it in the Most Recent Activity table on the integration's page. To open it, select Settings > Ticketing in the side navigation bar, then select the integration in the Connected integrations list.
Your endpoint rejects the delivery
Message: Most Recent Activity shows the error webhook delivery failed.
Your endpoint responded with a status code outside the 2xx range. A common reason is that it rejected the delivery's signature or authentication header.
Fix: Find the delivery in your endpoint's logs by its Idempotency-Key header. If authentication failed, compare the secret or header value your endpoint expects with the one in Mondoo. To replace it, read Change or rotate authentication.
Mondoo can't use the returned ticket URL
Message: Most Recent Activity shows the warning webhook ticket created, but the ticket url it returned was not used.
Your endpoint returned a ticket_url that Mondoo can't use.
Fix: Return an absolute https URL with a host and no embedded credentials. To learn more, read Link Mondoo tickets to your tickets.
Mondoo can't connect to your endpoint
Symptom: The test ticket's External Ticket column stays empty, and Most Recent Activity shows no error.
Mondoo couldn't connect to your endpoint. The URL is wrong, the endpoint isn't reachable from the internet, it resolves to a private network address, or its TLS certificate isn't valid.
Fix: Check the Webhook URL, and make sure the endpoint is reachable from the internet over HTTPS with a valid certificate.
After you fix the cause, create a new ticket for the finding and close the one that failed.
Change or rotate authentication
To change authentication, open the integration, select the pencil icon (Edit integration), and go to Authentication. Mondoo shows which methods are on, but never the saved secret or header value.

-
To keep a saved secret or header value, leave its box blank.
-
To replace one, enter the new value. Mondoo signs with a single secret, so update your endpoint to accept both the old and the new secret, save the new secret in Mondoo, and then remove the old one from your endpoint.
-
To stop using a method, turn it off. Mondoo deletes the saved secret or header value.
If you change the webhook URL or the header name, you must enter the header value again. Mondoo never sends a saved header value to an address or header it wasn't entered for. A signing secret is never sent, so it stays in place when the URL changes.
Next steps
Last updated on