TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Building Webhooks into Your Application: Guidelines and Best Practices (2020)

115 pointsby grinichabout 4 years ago

14 comments

weddprosabout 4 years ago
I can never understand why enforcing (sane and secure) TLS and adding a (shared) secret request header isn&#x27;t the usual simple answer.<p>As far as I know, TLS prevents all these security issues, except authentication of the webhook caller, hence the shared secret which your webhooks should check.<p>I&#x27;ve verified in the TLS specs that every issue I&#x27;ve seen raised by people is actually covered, yet people still think (and write) that TLS doesn&#x27;t sign traffic (it does), or TLS doesn&#x27;t prevent replay attacks (it does), etc.<p>Usually I give them pointers to the specs, and they say &quot;it doesn&#x27;t hurt to add even more security&quot; but they&#x27;re really rolling out their own encryption, which you shouldn&#x27;t do.<p>I&#x27;d say enforce TLS and authenticate the webhook caller...
评论 #26404239 未加载
评论 #26403482 未加载
grinichabout 4 years ago
Hey HN - I&#x27;m the author of this post. (Founder of WorkOS)<p>Lots of people have written about how to scale event-based systems or how to design distributed infrastructure for queue management. But what&#x27;s often overlooked is the subtle-yet-important product decisions that go into designing webhooks for a great developer experience.<p>We don&#x27;t actually offer webhooks-as-a-service at WorkOS, but we provide webhooks to developers and I&#x27;ve built this feature twice now, previously at Nylas and now at WorkOS. Hopefully this article helps the next person who builds them. :)<p>For anyone curious how we do it at WorkOS, here&#x27;s our webhooks API reference: <a href="https:&#x2F;&#x2F;workos.com&#x2F;docs&#x2F;reference&#x2F;webhooks&#x2F;connection" rel="nofollow">https:&#x2F;&#x2F;workos.com&#x2F;docs&#x2F;reference&#x2F;webhooks&#x2F;connection</a>
mrkurtabout 4 years ago
SSRF is a tremendous problem with webhooks. Stripe also solves this: <a href="https:&#x2F;&#x2F;fly.io&#x2F;blog&#x2F;practical-smokescreen-sanitizing-your-outbound-web-requests&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fly.io&#x2F;blog&#x2F;practical-smokescreen-sanitizing-your-ou...</a>
评论 #26403421 未加载
评论 #26404262 未加载
michaelbuckbeeabout 4 years ago
Something else Stripe and most other &quot;serious&quot; webhook senders do is only send Webhooks from a predefined set of IP addresses [1].<p>This isn&#x27;t the security guarantee that signing, etc. are but it&#x27;s a substantial help in adding some Security In Depth.<p>1 - <a href="https:&#x2F;&#x2F;stripe.com&#x2F;docs&#x2F;ips" rel="nofollow">https:&#x2F;&#x2F;stripe.com&#x2F;docs&#x2F;ips</a>
olivierduvalabout 4 years ago
Maybe a stupid question but... why not using an MQTT server instead of webhooks? Clients could be notified in RT, TLS is already backed in the protocol with client auth... the client doesn&#x27;t need to expose an endpoint, only to connect to a server...
jakejscottabout 4 years ago
AWS EventBridge announced API destinations recently [1]. I can&#x27;t find anywhere in their docs about SSRF, but given it&#x27;s a managed service running outside of your network it sounds like a good option. Anyone care to comment if this would be a good solution for webhooks?<p>1 - <a href="https:&#x2F;&#x2F;aws.amazon.com&#x2F;blogs&#x2F;compute&#x2F;using-api-destinations-with-amazon-eventbridge&#x2F;" rel="nofollow">https:&#x2F;&#x2F;aws.amazon.com&#x2F;blogs&#x2F;compute&#x2F;using-api-destinations-...</a>
tasnabout 4 years ago
Hehe, just did a show HN[1] for Diahook (webhooks as a service) earlier today. I wonder if that&#x27;s what triggered this posting. :P<p>Anyhow, I wish more people had better webhooks, it&#x27;s such an important part of any API, so please read this blog post, understand the challenges, and provide a great webhooks experience!<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26399672" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26399672</a>
评论 #26403217 未加载
alexsmolenabout 4 years ago
Kind of wild that there&#x27;s no mention of SSRF. A quick search shows it&#x27;s a pretty frequent security issue in Webhooks: <a href="https:&#x2F;&#x2F;www.google.com&#x2F;search?q=ssrf+webhook" rel="nofollow">https:&#x2F;&#x2F;www.google.com&#x2F;search?q=ssrf+webhook</a>
评论 #26404926 未加载
cdcarterabout 4 years ago
Not just logging the outbound webhooks to STDOUT and hope they get ingested into logstash or something, but actually log them in your SoR&#x2F;RDBMS so that you can present that data to a debugging developer.
评论 #26403948 未加载
bellttylerabout 4 years ago
This was a great read – thanks for sharing!<p>I&#x27;ve always been a huge fan of how Stripe handles their webhooks. They are pretty much doing everything listed in your article.
koblasabout 4 years ago
What people totally omit when thinking about webhooks is the parallels to web sockets and client side updates. In the last round of our system updates, we have &quot;attached&quot; the web sockets and webhooks to the same message bus which has simplified the overall design of the system.
评论 #26402949 未加载
winridabout 4 years ago
At FastComments we send an your API token in the webhook request, and if your API doesn&#x27;t return a 401 with an invalid token the integration won&#x27;t activate.
评论 #26407846 未加载
GhvstCodeabout 4 years ago
This was an interesting read! If you ever decide to update this article &amp; include tools for working with webhooks, Hookdeck(<a href="https:&#x2F;&#x2F;hookdeck.io" rel="nofollow">https:&#x2F;&#x2F;hookdeck.io</a>) should be at the top of the list. Hookdeck is a complete webhook infrastructure that makes working with webhooks painless. we pride ourselves in reliability. We provide tooling for easy monitoring and troubleshooting of webhooks
jarenabout 4 years ago
democratize access to webhooks -- love dat energy