Support for supplying additional HTTP headers on webhooks #2821

Closed
opened 2025-12-29 18:22:28 +01:00 by adam · 3 comments
Owner

Originally created by @ajknv on GitHub (Aug 22, 2019).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.2

Proposed Functionality

Add ability to specify additional HTTP headers to webhook post requests.

Use Case

To improve security, I would like the endpoint that my webhook is calling to at least be secured by an API key. In order to do this, I need to be able to include an authorization header that provides the key, which is not currently possible.

Database Changes

Something might be needed to store the additional header name/value pairs associated with a webhook?

External Dependencies

None

Originally created by @ajknv on GitHub (Aug 22, 2019). # Environment * Python version: 3.6.8 * NetBox version: 2.6.2 ### Proposed Functionality Add ability to specify additional HTTP headers to webhook post requests. ### Use Case To improve security, I would like the endpoint that my webhook is calling to at least be secured by an API key. In order to do this, I need to be able to include an authorization header that provides the key, which is not currently possible. ### Database Changes Something might be needed to store the additional header name/value pairs associated with a webhook? ### External Dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 18:22:28 +01:00
adam closed this issue 2025-12-29 18:22:28 +01:00
Author
Owner

@DanSheps commented on GitHub (Aug 23, 2019):

An optional secret key can be configured for each webhook. This will append a X-Hook-Signature header to the request, consisting of a HMAC (SHA-512) hex digest of the request body using the secret as the key. This digest can be used by the receiver to authenticate the request's content.

Is this insufficient?

@DanSheps commented on GitHub (Aug 23, 2019): > An optional secret key can be configured for each webhook. This will append a X-Hook-Signature header to the request, consisting of a HMAC (SHA-512) hex digest of the request body using the secret as the key. This digest can be used by the receiver to authenticate the request's content. Is this insufficient?
Author
Owner

@ajknv commented on GitHub (Aug 23, 2019):

Things like scopes of authorization, quotas/throttling, and so forth can be associated with an API key, so the HMAC signature alone is an incomplete solution.

@ajknv commented on GitHub (Aug 23, 2019): Things like scopes of authorization, quotas/throttling, and so forth can be associated with an API key, so the HMAC signature alone is an incomplete solution.
Author
Owner

@marcin-jedynski commented on GitHub (Oct 3, 2019):

There's a plenty of APIs out there, quite often each of them has a different approach on request authentication. We could largely benefit from the possibility of setting custom headers on Netbox webhooks. This way integrating Netbox with any API would become super easy.

For example right now I am working on Netbox-> StackStorm-> Chef pipeline to use Netbox as GUI interface to our DHCP server.
Sadly the StackStorm does not support HMAC approach of Netbox for request authentication, thus I am forced to use dirty workarounds.

@marcin-jedynski commented on GitHub (Oct 3, 2019): There's a plenty of APIs out there, quite often each of them has a different approach on request authentication. We could largely benefit from the possibility of setting custom headers on Netbox webhooks. This way integrating Netbox with any API would become super easy. For example right now I am working on Netbox-> StackStorm-> Chef pipeline to use Netbox as GUI interface to our DHCP server. Sadly the StackStorm does not support HMAC approach of Netbox for request authentication, thus I am forced to use dirty workarounds.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2821