본문으로 건너뛰기

Webhooks

NetRecon can send real-time notifications to your endpoints when events occur. Configure webhooks from Settings > Integrations or via the API.

Configure a Webhook

POST /api/v1/integrations/webhooks
Content-Type: application/json

{
"url": "https://your-server.com/webhook",
"secret": "your-hmac-secret",
"events": ["alert.created", "scan.completed", "device.discovered"],
"active": true
}

Event Types

EventDescription
alert.createdNew alert generated
alert.resolvedAlert resolved
scan.startedScan started
scan.completedScan finished
scan.failedScan error
device.discoveredNew device found
device.offlineDevice went offline
ids.alertIDS rule triggered
honeypot.hitHoneypot interaction
rogue.detectedRogue DHCP/ARP detected
cve.matchedNew CVE matched to a device
backup.completedBackup finished
backup.failedBackup error
anomaly.detectedML anomaly detected

Payload Format

All webhook payloads follow this structure:

{
"id": "event-uuid",
"event": "alert.created",
"timestamp": "2026-03-15T10:30:00Z",
"tenant_id": "tenant-uuid",
"data": {
"alert_id": "alert-uuid",
"title": "New open port detected",
"severity": "high",
"device_ip": "192.168.1.10"
}
}

Signature Verification

Each webhook request includes an HMAC-SHA256 signature in the X-NetRecon-Signature header:

X-NetRecon-Signature: sha256=a1b2c3d4e5f6...

Python Verification Example

import hmac
import hashlib

def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
expected = "sha256=" + hmac.new(
secret.encode(), payload, hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature)

Node.js Verification Example

const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}

Retry Policy

Failed webhook deliveries are retried with exponential backoff:

AttemptDelay
1Immediate
230 seconds
32 minutes
410 minutes
51 hour

After 5 failed attempts, the webhook is marked as failing and an email notification is sent to the account owner.

Test a Webhook

POST /api/v1/integrations/webhooks/{webhook_id}/test

Sends a test payload to verify your endpoint is reachable and correctly processing events.

List Webhooks

GET /api/v1/integrations/webhooks

Delete a Webhook

DELETE /api/v1/integrations/webhooks/{webhook_id}

Webhook Delivery Log

GET /api/v1/integrations/webhooks/{webhook_id}/deliveries?page=1&per_page=25

Returns recent delivery attempts with status codes and response times.