Securing Webhook Communications
Introduction
Webhooks transmit information directly from the Custody Infrastructure๏ปฟ platform to your listener machine. If you are transmitting sensitive information, you will want to ensure the security of your data in-flight from your custody platform to your listener.
HTTP offers no security to your data. If you configure your webhooks to fire to an HTTP address, you cannot assume the communications are private.
๏ปฟGalaxy's Custody Infrastructure๏ปฟ cannot take responsibility for how data is stored on your listening machine or the security of your packets in motion from the Custody Infrastructure๏ปฟ platform to the listener. This article contains common-sense steps to help provide more secure handling of your webhook return data in motion.
HTTPS
Configuring your listener machine with an HTTPS address and directing all webhook traffic there ensures your data in motion uses the following security measures:
- Transport Layer Security (TLS): TLS security encrypts data in flight. If the data is intercepted, the malicious party cannot read it without the proper key.
- Data Integrity: Like the blockchain itself, TLS traffic is self-authenticating. Your listener will be aware if the webhook return is altered in flight in an attempt to spoof you with bad data.
- PublicโPrivate Key Encryption: HTTPS traffic utilizes asymmetric encryption. The private keys for your webhook data never leave their home machines.
Random Key in the URL
Even using HTTPS, a malicious actor can target your listener's address with fake traffic in a denial-of-service attack. To do so, the actor must know your listener's URL. Appending a randomly generated value to your listener's address and the webhook URL makes the listener's address much more challenging to attack.
This string is generated once and then used in both setting up the webhook and the listener machine.
For example:
https://<listener_url>/random_secret_token=sadkfnherwklfnvkwlrhnjfklewjflkewjnknwklonewklfnewkonlkewnkwe
Your listener needs to authenticate the random key. Once authenticated, you will probably want to route the webhook according to your business logic.
Further Reading
Learn about configuring webhooks in the Webhook Usage๏ปฟ article. For a more technical overview, check out the /registerWebhook๏ปฟ API endpoint.
See what data webhook output can contain (and why it's so essential to secure it!) in Webhook v2 Output๏ปฟ .
You can review your current webhook configuration using the /getAllWebhooks๏ปฟ endpoint.