Skip to content

implement secure webhook delivery pipeline with retries - #388

Merged
Osuochasam merged 2 commits into
Open-audit-foundation:mainfrom
canicefavour:open12
Jul 26, 2026
Merged

implement secure webhook delivery pipeline with retries#388
Osuochasam merged 2 commits into
Open-audit-foundation:mainfrom
canicefavour:open12

Conversation

@canicefavour

Copy link
Copy Markdown
Contributor

Implemented a complete webhook notification system to replace the previous placeholder implementation, enabling secure, reliable, and auditable event delivery to external integrations.

The update introduces persistent webhook subscription and delivery models in Prisma, allowing applications to register, manage, and monitor webhook endpoints. The dispatch pipeline now automatically discovers active subscriptions, signs every outgoing payload using HMAC-SHA256, and delivers events through authenticated HTTP POST requests.

To improve reliability, the worker includes configurable retry logic with exponential backoff for transient failures while avoiding retries for client-side errors. Failed deliveries are recorded for auditing, and subscriptions are automatically deactivated after repeated unsuccessful attempts to prevent unnecessary processing.

Security was strengthened by validating webhook registration requests to reject insecure HTTP endpoints, localhost addresses, loopback interfaces, and private network IP ranges, reducing SSRF attack risks.

Management endpoints were added for registering, listing, and deactivating webhook subscriptions, providing a complete lifecycle for webhook administration. Comprehensive integration tests were also implemented to verify successful signed deliveries, retry behavior, subscription deactivation, SSRF protection, and overall delivery reliability.

Key Improvements
Implemented production-ready webhook dispatch pipeline.
Added Prisma models and migrations for webhook subscriptions and delivery history.
Signed webhook payloads using HMAC-SHA256 for request authentication.
Added exponential backoff retry logic for transient failures.
Prevented retries on non-recoverable client errors.
Automatically deactivated subscriptions after repeated delivery failures.
Added secure webhook management endpoints (register, list, deactivate).
Implemented SSRF protection by rejecting insecure and private network endpoints.
Added integration tests covering delivery, retries, signing, failure handling, and security validation.
Improved observability with persistent delivery logs and webhook lifecycle tracking.

Closes #375

@Osuochasam
Osuochasam merged commit 6bbfba8 into Open-audit-foundation:main Jul 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the webhook delivery system — currently a three-line stub that silently drops all notifications

2 participants