What is a webhook?
ChainPatrol uses webhooks to notify you about changes to our global blocklist. This allows you to update your blocklist in real-time, without having to wait for a scheduled cron job to run. This is especially useful if you opt to use our Asset List endpoint to sync our data as you can update your blocklist as soon as we update ours.Managing Webhooks
You can manage your webhooks through the ChainPatrol dashboard underSettings > Webhooks. From here you can:
- Create new webhooks
- View and monitor webhook deliveries
- Test webhooks with sample events
- Enable/disable webhooks
- Update webhook configurations
- Delete webhooks
Event Types
debug.test
This event is used for testing your webhook endpoint. It is sent when you click the “Test” button for a webhook in the dashboard.
asset.status-updated
This event is sent when the status of an asset changes. The status field can be one of BLOCKED, ALLOWED, or UNKNOWN.
asset.status-escalated
This event is sent when ChainPatrol escalates a threat to your organization for review. Subscribe to it to find out when something needs a decision from your team, for example to open a ticket or ping an on-call channel.
It fires when:
- A ChainPatrol analyst passes a proposal to your organization for review.
- Your organization has Obligatory Admin Approval enabled and an analyst approves a proposal. The proposal then waits for your organization’s final approval.
If a proposal is escalated to your organization more than once, you receive an event each time. Use
proposal_id to deduplicate.asset.escalation-resolved
This event is the counterpart of asset.status-escalated. It is sent once when a threat that was escalated to your organization no longer needs your review, so you can close whatever you opened when the escalation arrived.
It fires when:
- Someone in your organization approves, rejects, or watchlists the proposal, or passes it back to the ChainPatrol team.
- ChainPatrol resolves the escalation on your behalf, for example when an analyst pushes the proposal through while it is still waiting on you.
The payload does not include the asset’s status. Approving a proposal blocks the asset shortly afterwards rather than immediately, so subscribe to
asset.status-updated if you need the final status.organization.threat-detection-added
This event is sent when a new threat detection is added for your organization detection tab.
Webhook Configuration
When creating a webhook, you’ll need to provide:- A HTTPS endpoint URL that will receive the webhook events
- An optional description to help identify the webhook’s purpose
- Select which events you want to receive (available events include
asset.status-updated,asset.status-escalated,asset.escalation-resolved, andorganization.threat-detection-added) - Optional HTTP headers for supported integrations (currently Google SecOps headers are available)
Custom HTTP Headers
ChainPatrol supports specific hardcoded HTTP headers that can be configured for webhook requests. Currently, the following headers are available for Google SecOps integration:X-goog-api-key: Your Google API keyX-Webhook-Access-Key: Your webhook access key
Signature Verification
ChainPatrol signs each webhook request with a signature to verify that the request originated from ChainPatrol. The signature is included in theX-ChainPatrol-Signature header of each request. The signature is computed by taking the SHA256 HMAC of the request body using your webhook secret as the key. The signature is encoded as a hex string.
Delivery Status and Retries
Each webhook delivery attempt is logged with one of the following statuses:PENDING: The delivery is queuedIN_PROGRESS: The delivery is being attemptedSUCCESS: The delivery was successful (received 2xx response)FAILURE: The delivery failed
Security
Webhooks are sent over HTTPS and are signed with a secret that is unique to your account. You should:- Only use HTTPS endpoints
- Keep your webhook secret secure and never commit it to version control
- Always verify the signature of incoming webhooks
- Contact us immediately if you suspect your webhook secret has been compromised