Security Best Practices
Verify Webhook Signatures
1
Obtain your public key
In Monitor, click “Webhook Secret” to copy the public key you’ll need to verify incoming webhook signatures.

2
Implement Verification
Verify every webhook signature before processing:
3
Handle Verification Failures
Reject invalid signatures immediately:
Network Security
Restrict Access by IP Address: Configure your firewall to only accept webhooks from Orum’s IP addresses:- Always use HTTPS URLs for webhook endpoints
- Ensure valid SSL certificates
- Regularly renew SSL certificates before expiration
- Don’t require API keys or authentication tokens
- Webhook endpoints should be publicly accessible
- Use signature verification instead of authentication
Reliability Best Practices
Implement Idempotent Processing
Handle Duplicate Events Gracefully: Orum may retry webhook deliveries, so implement idempotent processing:- Store processed event IDs in your database
- Check for duplicates before processing
- Include event ID in your processing logs
Respond Quickly
Return HTTP Response Within 30 Seconds:- Use message queues (Redis, RabbitMQ, SQS) for complex processing
- Respond to webhook immediately, process later
- Implement retry logic for failed background processing
Handle Webhook Failures Gracefully
Implement Retry Logic for Your Processing:- Log successful and failed webhook processing
- Include event IDs, timestamps, and error details
- Monitor logs for patterns and issues
Performance Best Practices
Optimize Webhook Processing
Minimize Processing Time:- Validate webhook signature first
- Perform minimal processing in the webhook handler
- Use background jobs for complex operations
- Cache frequently accessed data
Scale for High Volume
Design for Concurrent Processing:- Use connection pooling for database connections
- Implement proper error handling for database timeouts
- Consider using read replicas for webhook processing queries
- Track webhook processing times
- Monitor queue depths and processing delays
- Set up alerts for performance degradation
Event Handling Best Practices
Subscribe to Relevant Events Only
Choose Specific Event Types:Handle Event Order Correctly
Don’t Assume Event Order: Orum doesn’t guarantee webhook delivery order, so design your processing accordingly:Implement Proper Error Handling
Return Appropriate HTTP Status Codes:- 2xx: Successfully processed (won’t be retried)
- 4xx/5xx: Failed to process (will be retried)
Monitoring and Observability
Set Up Comprehensive Logging
Log Key Information:Monitor Webhook Health
Track Key Metrics:- Webhook processing success rate
- Average processing time
- Queue depth (for async processing)
- Error rates by type
- High error rates
- Processing delays
- Signature verification failures
- Endpoint downtime
Use Monitor Tools
Leverage Built-in Monitoring:- Review delivery logs regularly
- Monitor delivery success rates
- Use test functionality to validate changes
- Check webhook status and configuration
Development and Testing Best Practices
Local Development Setup
Use ngrok for Local Testing:- Use Monitor test functionality
- Test with various event types you subscribe to
- Verify signature verification works correctly
- Test error scenarios and edge cases
Staging Environment Testing
Deploy to Staging First:- Test webhook configuration in staging environment
- Use sandbox webhook IP addresses
- Verify all event types are handled correctly
- Test failure scenarios and recovery
- Load test webhook endpoints
- Verify handling of concurrent requests
- Test with high volume of events
- Monitor resource usage under load
Production Deployment Checklist
Pre-Production Checklist
Pre-Production Checklist
Security:
- Webhook signature verification implemented
- HTTPS endpoint with valid SSL certificate
- IP address restrictions configured
- No authentication requirements on webhook endpoint
- Idempotent processing implemented
- Response time under 30 seconds
- Proper HTTP status codes returned
- Error handling and logging in place
- Asynchronous processing for complex operations
- Database connection pooling configured
- Monitoring and alerting set up
- Load testing completed
- All subscribed event types tested
- Signature verification tested
- Error scenarios tested
- Recovery procedures documented