Skip to content

Commit 81b66d4

Browse files
authored
Add documentation for webhook notification signing (#297)
Signed-off-by: nscuro <nscuro@protonmail.com>
1 parent fa42a94 commit 81b66d4

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

58.8 KB
Loading

‎docs/reference/notifications/publishers.md‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Dependency-Track only connects to publisher destinations that
66
[`dt.outbound.allowed-destinations`](../configuration/properties.md#dtoutboundallowed-destinations) allows.
77

8-
!!! note "Changed in v5.2.0"
8+
!!! note "Changed in 5.2.0"
99
Before v5.2.0, the email and Kafka publishers used their own properties.
1010
To allow local connections, set:
1111

@@ -195,9 +195,29 @@ Publishes notifications as Webhooks.
195195

196196
### Alert Config {: #webhook-alert-config }
197197

198+
The alert config defines the destination of webhook requests, and optionally how to authenticate and sign them.
199+
200+
![Webhook publisher alert config](../../assets/images/reference/notifications/publishers/webhook-publisher-alert-config.png)
201+
198202
!!! note
199203
Selecting teams as recipients has no effect for this publisher.
200204

205+
### Signature
206+
207+
!!! note "Available in 5.2.0 and later"
208+
209+
Earlier versions send webhook requests unsigned.
210+
211+
When the alert config names a signing secret, each request carries an `X-Webhook-Signature` header.
212+
The signing secret **must** be a [managed secret](../../guides/user/managing-secrets.md).
213+
214+
The header value is `sha256=` followed by the lowercase hex-encoded HMAC-SHA256 of the request body,
215+
keyed with the UTF-8 bytes of the secret. The publisher computes it over the exact bytes it sends,
216+
whether it renders a template or publishes Protobuf.
217+
218+
To verify a request, compute the same HMAC over the raw request body, before parsing it,
219+
and compare it to the header value in constant time.
220+
201221
[PEM]: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
202222
[SMTP]: https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
203223
[SMTPS]: https://en.wikipedia.org/wiki/SMTPS

0 commit comments

Comments
 (0)