New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validation header to webhooks #13980
base: main
Are you sure you want to change the base?
Conversation
As per Pullrequest TryGhost/Ghost#13980 there needs to be a possibility to add the secret to a webhook.
Codecov Report
@@ Coverage Diff @@
## main #13980 +/- ##
==========================================
+ Coverage 52.92% 57.27% +4.35%
==========================================
Files 1379 580 -799
Lines 88124 47825 -40299
Branches 9918 4175 -5743
==========================================
- Hits 46638 27392 -19246
+ Misses 41435 20392 -21043
+ Partials 51 41 -10 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
As per Pullrequest TryGhost/Ghost#13980 there needs to be a possibility to add the secret to a webhook.
4c8f567
to
a72d41b
Compare
As per Pullrequest TryGhost/Ghost#13980 there needs to be a possibility to add the secret to a webhook.
|
Hey @Regrau, this is great. |
This change will allow to verify the source of the POST request. The idea is to have the same functionality as in githubs guide on securing webhooks. https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks With this change there is an additional that will be sent to the webhooks targetUrl and that can then verify the authenticity of the source.
See following for reference. https://stripe.com/docs/webhooks/signatures#replay-attacks
6f95d62
to
4885990
Compare
As per Pullrequest TryGhost/Ghost#13980 there needs to be a possibility to add the secret to a webhook.
As per Pullrequest TryGhost/Ghost#13980 there needs to be a possibility to add the secret to a webhook.
|
I'm so sorry, I thought I left a comment on this aaaaages ago. Secret is optional, we shouldn't assume one is set, and the header shouldn't be added unless there is a secret set. The current PR adds the header no-matter what. Tests would be nice, but not a deal-breaker here. |
As per Pullrequest TryGhost/Ghost#13980 there needs to be a possibility to add the secret to a webhook.
|
No problem, happens to to the best of us. :) I'll look into it as soon as I have a bit of time on my hands. |
|
The admin client is now back in this repo under |
|
Hi @ErisDS, Now the header will appear only when there is a secret set for the webhook like you suggested. |
This change will allow to verify the source of the POST request.
The idea is to have the same functionality as in githubs
guide on securing webhooks.
https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks
With this change there is an additional header that will be sent to the
webhooks targetUrl and that can then verify the authenticity of
the source.
This will require another change in the admin client. That is already prepared and I will submit a
pull request there to.
The idea was already discussed in issue #9942 but the implementation seemed to be left behind.
If there is need for any other changes please let me know.
Regards
Georg