Webhooks
Flare provides a generic webhook integration that allows you to receive alerts into any service that supports receiving data from an incoming webhook. Automation services such as Tines, Zapier and IFTTT are a few examples of such services.
Click through the following demo to learn how to configure Webhooks.
Validating the Request Signature
This step is only necessary if you have implemented a webhook collector endpoint on your own system and want the added security of validating the payload.
The signature secret is generated by Flare. When you create a webhook alert channel, Flare automatically creates a secret and shows it in the Signature Secret field. You can’t type or paste your own secret in this field.
Follow these steps to set up signature validation:
- In the webhook alert channel, click the Copy icon next to the Signature Secret field.
- Paste this exact value into the system that receives the webhook (your SIEM, SOAR or custom endpoint), as the shared secret used to validate the signature. Don’t add or remove any characters.
- Save the alert channel in Flare.
If you click the Generate New Secret icon, Flare replaces the secret. Copy the new value into your receiving system again, or the signatures will stop matching and your system will reject the requests.
To validate the payload, follow these steps:
- The string in the header is formatted as follows: t=<timestamp>,v1=<signature>.
- Extract the text from the header named X-Flare-Signature.
- Split the text on ,. You now have two parts.
- Split both parts on =. You now have the timestamp and the signature.
- Generate a HMAC hash:
- They key is the secret that you generated and copied from webhook alert channel.
- The data or msg will be a combination of the timestamp retrieved from the X-Flare-Signature above and the raw request body separated by a period as follows: <timestamp>.<raw_request_body>.
- The algo should be set as sha256.
IMPORTANT: To prevent replay timing attacks, it is important to compare the hashes using a constant-time-string comparison algorithm. For example, in Python you would use hmac.compare_digest(), in Php you would use hash_equals(). Use the appropriate comparison function you have available to you and compare the hash that you received within the X-Flare-Signature header and the one you generated from step 5.
Optional: Another step you can take is to limit the time window in which you will allow the processing of a request. With the timestamp received within the X-Flare-Signature, compute the difference between that timestamp and the current time. Then decide if it's within your tolerance.
Please note that there is no standard for building request signature strings. Therefore, it is unlikely that our request signature will work with other third party systems. Again, taking the example of Tines.com, their endpoint expects a different formatting of the msg/data string to be hashed and, therefore, their validation will fail with the signature that we provide. We provide this feature for those who can implement their own webhook endpoint and compute the signature as described above.
Basic Auth
This is optional Since the Request Signature Validation explained above is unfortunately non-standardized, it you encounter any issue with your webhook integration you can use the more standardized Basic Auth as explained below.
You can also validate the webhook using the optional basic authentication configuration. This will include a header of the format Authorization: Basic aGVsbG8= in the request. The string after the Basic keyword follows RFC 7617.
Webhook Headers
Custom headers can also be added to the webhook. When creating a new webhook select "Add Header" to allow custom headers.