Skip to main content
Secure your webhook endpoints by verifying that each request genuinely came from Catena and hasn’t been tampered with. Every webhook includes cryptographic signatures and comprehensive headers for authentication, tracking, and event routing.
Security Critical: Always verify webhook signatures before processing events. Unverified webhooks expose your system to spoofing and tampering attacks.

Request Headers

Every webhook request includes HTTP headers for security verification, event metadata, and delivery tracking. Here’s what a typical webhook request looks like with all headers included:

Header Reference

Duplicate Detection: Store processed X-Request-ID values to detect and skip duplicate deliveries during retries.

Signature Verification

Catena signs every webhook using HMAC-SHA256 to ensure authenticity. The signature covers the timestamp and request body, preventing tampering and replay attacks.

Signing Key Management

When creating a webhook subscription, you can either provide your own signing key or let Catena generate one:
Include your secret key in the subscription request for full control over key management.
Omit the secret field and Catena will generate a secure key returned once in the creation response.The generated secret is shown in full only in the initial creation response. In all subsequent API responses, the secret is masked as ***** for security.
Store Securely: The generated secret is shown only once. Store it securely in your secrets manager.
If you lose your key or need to rotate it for security, use the webhook update endpoint to set a new secret.
If you’ve lost your signing secret, you cannot retrieve it — it’s masked as ***** in all API responses after creation. To recover, rotate to a new secret using the update endpoint:
Update your endpoint to use the new secret immediately after — deliveries will begin failing signature verification as soon as the rotation takes effect.

How Signatures Work

Each webhook includes two security headers:
  • X-Catena-Signature — Base64-encoded HMAC-SHA256 digest
  • X-Catena-Timestamp — RFC 3339 timestamp (e.g., 2024-01-15T10:30:00+00:00)
The signature is computed as:

Verification Steps

Implement signature verification in four steps:
1

Extract headers and body

Get the signature headers and raw request body:
  • X-Catena-Timestamp — The timestamp used in signature computation
  • X-Catena-Signature — The expected signature
  • Uncompressed payload — Decompress the gzipped request body to get the JSON string
Decompress First: Webhooks are always sent with Content-Encoding: gzip. You must decompress the raw request bytes to get the JSON string used for signature verification.
2

Check timestamp freshness

Parse the timestamp and verify it’s recent:
  • Parse X-Catena-Timestamp as RFC 3339 / ISO 8601
  • Reject requests older than 5 minutes to prevent replay attacks
  • Account for clock skew between servers
3

Compute expected signature

Recreate the signature using your webhook secret:
4

Compare signatures securely

Use constant-time comparison to prevent timing attacks:
  • Compare X-Catena-Signature with your computed signature
  • Use timing-safe comparison (e.g., hmac.compare_digest in Python)
  • Respond with 401 Unauthorized if verification fails
  • Respond with 400 Bad Request if headers are missing/malformed

Implementation Example

Python

Security Best Practices

Always verify signatures

Never process webhook events without signature verification. This protects against spoofing and tampering.

Use constant-time comparison

Prevent timing attacks by using constant-time comparison functions (hmac.compare_digest, crypto.timingSafeEqual).

Reject stale requests

Check timestamp freshness and reject requests older than 5 minutes to prevent replay attacks.

Always decompress payload

Webhooks are always gzip-compressed. Decompress the raw bytes to get the JSON string for signature verification.

Store secrets securely

Keep webhook secrets in environment variables or a secrets manager, never in code.

Implement rate limiting

Protect your endpoint from abuse with rate limiting, even for authenticated requests.

Log validation failures

Monitor and alert on signature validation failures to detect potential attacks.

Use HTTPS only

Configure webhook URLs with HTTPS to encrypt data in transit. Catena rejects HTTP endpoints.

Troubleshooting

Common causes:
  • Using parsed JSON instead of uncompressed payload string
  • Not decompressing the payload before verification
  • Incorrect webhook secret
  • Character encoding issues (ensure UTF-8)
Solution: Ensure you’re using the uncompressed JSON string. Decompress the raw gzipped bytes first.
Common causes:
  • Clock skew between servers
  • Timestamp tolerance too strict
  • Network delays causing stale timestamps
Solution: Allow a 5-minute tolerance window and ensure your server clock is synchronized via NTP.
Common causes:
  • Proxy or load balancer stripping headers
  • Case-sensitive header lookups
  • Framework normalizing header names
Solution: Check your infrastructure configuration. Headers may be lowercase (x-catena-signature) depending on your framework.

What’s Next

Webhook Quick Start

Create your first subscription and start receiving live fleet events.

Operations & Monitoring

Monitor delivery health, replay failed events, and manage the webhook lifecycle.

FAQ

Answers to common questions about webhook behavior and troubleshooting.

Notifications API Reference

Complete API reference for all webhook endpoints.

Contact Support

Have questions or need assistance? Our team is here to help you succeed.