[Security Solution] webhook action can sends invalid json payload when combined with mustache #88893
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Alerting
fixed
impact:high
Addressing this issue will have a high level of impact on the quality/strength of our product.
Team:Detections and Resp
Security Detection Response Team
Team: SecuritySolution
Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.
Describe the bug:
We can use webhook, in the action section of a detection rule to send a JSON to another service. In the body of the action we can use mustache to render some context information like the query that matched some logs and generated the alert.
If the query contains a
\
for exempleCommandLine:*process\ call*
then mustach will render the variable "as is" but it creates an invalid JSON.Kibana/Elasticsearch Stack version:
v 7.10.0
Server OS version:
Debian GNU/Linux 9 (stretch)
Browser and Browser OS versions:
Firefox 84.0.2 (64 bits)
Elastic Endpoint version:
N/A
Original install method (e.g. download page, yum, from source, etc.):
deb package
Functional Area (e.g. Endpoint management, timelines, resolver, etc.):
SIEM/detection rule
Steps to reproduce:
app/security/detections/rules/create
CommandLine:*process\ call*
and fill other fields with any value{"description": "{{context.rule.query}}"}
Current behavior:
Sends an invalid JSON document
Expected behavior:
results of Mustach should be "JSON dumped"
Screenshots (if relevant):
Errors in browser console (if relevant):
Provide logs and/or server output (if relevant):
Any additional context (logs, chat logs, magical formulas, etc.):
The text was updated successfully, but these errors were encountered: