-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update rule query clarification #2985
Conversation
The example 2 provided in the documentation has a few typos and is using an incorrect parameter.
Documentation previews: |
This pull request does not have a backport label. Could you fix it @Tibo669? 🙏
NOTE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @banderror is it safe to close this PR since changes were updated in #3019? |
Hey @jmikell821, not sure I understand the question. #3019 is a follow-up issue, it doesn't update the docs. |
Oops, sorry @banderror, I misread. If the changes @Tibo669 made look good to you (they look 👍 to me), I can merge this. Thanks! |
The example 2 provided in the documentation has a few typos and is using an incorrect parameter. Also the documentation on the "params" in the action schema could use an example. https://www.elastic.co/guide/en/security/current/bulk-actions-rules-api.html#actions-object-schema-bulk  It can be difficult to apprehend that you need to define it as a list with a single item that is an array. An example would have made it a lot more clear. Like for example: ``` POST api/detection_engine/rules/_bulk_action "query": "alert.attributes.params.severity: \"critical\"", "action": "edit", "edit": [ { "type": "set_rule_actions", "value": { "actions": [ { "id": "id", "group": "default", "params": { "subAction": "pushToService", "subActionParams": { "incident": { "issueType": "10009", "priority": "Critical", "description": "{{#context.alerts}}\n*Host:* {{host.name}} ({{source.ip}}) *OS:* {{host.os.name}} {{host.os.version}}\n*Time:* {{event.start}} - {{event.end}}\n*Reason:* {{signal.reason}}\n\n*------------------ Optional Fields ------------------*\n*Username:* {{winlog.user.name}} - {{user.name}}\n*File name:* {{file.name}}\n*Process Name:* {{process.name}} \n*Parent Process:* {{parent.process.name}}\n*-----------------------------------------------------*\n{{/context.alerts}}\n\n*Count of events:* {{state.signals_count}}\n\n*Link:* TENANTURL{{{context.results_link}}}", "summary": "{{context.rule.name}} - {{context.rule.severity}}" }, "comments": [ { "commentId": "1", "comment": "*Description:* {{context.rule.description}}\n\n*Rule Severity:* {{context.rule.severity}}\n\n*References:* {{context.rule.references}}\n\n*Possible false positive reason:* {{context.rule.false_positives}}\n\n*MITRE ATT&CK and ID:* {{context.rule.threat}}" } ] } } }, { "group": "default", "id": "id", "params": { "message": "# **{{context.rule.name}}**\n\n**Alerts:** {{state.signals_count}}\n\n**Severity:** {{context.rule.severity}}\n\n**Kibana URL:** TENANTURL{{{context.results_link}}}" } } ], "throttle": "rule" } } ] ``` (cherry picked from commit f7aff54)
The example 2 provided in the documentation has a few typos and is using an incorrect parameter. Also the documentation on the "params" in the action schema could use an example. https://www.elastic.co/guide/en/security/current/bulk-actions-rules-api.html#actions-object-schema-bulk  It can be difficult to apprehend that you need to define it as a list with a single item that is an array. An example would have made it a lot more clear. Like for example: ``` POST api/detection_engine/rules/_bulk_action "query": "alert.attributes.params.severity: \"critical\"", "action": "edit", "edit": [ { "type": "set_rule_actions", "value": { "actions": [ { "id": "id", "group": "default", "params": { "subAction": "pushToService", "subActionParams": { "incident": { "issueType": "10009", "priority": "Critical", "description": "{{#context.alerts}}\n*Host:* {{host.name}} ({{source.ip}}) *OS:* {{host.os.name}} {{host.os.version}}\n*Time:* {{event.start}} - {{event.end}}\n*Reason:* {{signal.reason}}\n\n*------------------ Optional Fields ------------------*\n*Username:* {{winlog.user.name}} - {{user.name}}\n*File name:* {{file.name}}\n*Process Name:* {{process.name}} \n*Parent Process:* {{parent.process.name}}\n*-----------------------------------------------------*\n{{/context.alerts}}\n\n*Count of events:* {{state.signals_count}}\n\n*Link:* TENANTURL{{{context.results_link}}}", "summary": "{{context.rule.name}} - {{context.rule.severity}}" }, "comments": [ { "commentId": "1", "comment": "*Description:* {{context.rule.description}}\n\n*Rule Severity:* {{context.rule.severity}}\n\n*References:* {{context.rule.references}}\n\n*Possible false positive reason:* {{context.rule.false_positives}}\n\n*MITRE ATT&CK and ID:* {{context.rule.threat}}" } ] } } }, { "group": "default", "id": "id", "params": { "message": "# **{{context.rule.name}}**\n\n**Alerts:** {{state.signals_count}}\n\n**Severity:** {{context.rule.severity}}\n\n**Kibana URL:** TENANTURL{{{context.results_link}}}" } } ], "throttle": "rule" } } ] ``` (cherry picked from commit f7aff54)
The example 2 provided in the documentation has a few typos and is using an incorrect parameter. Also the documentation on the "params" in the action schema could use an example. https://www.elastic.co/guide/en/security/current/bulk-actions-rules-api.html#actions-object-schema-bulk  It can be difficult to apprehend that you need to define it as a list with a single item that is an array. An example would have made it a lot more clear. Like for example: ``` POST api/detection_engine/rules/_bulk_action "query": "alert.attributes.params.severity: \"critical\"", "action": "edit", "edit": [ { "type": "set_rule_actions", "value": { "actions": [ { "id": "id", "group": "default", "params": { "subAction": "pushToService", "subActionParams": { "incident": { "issueType": "10009", "priority": "Critical", "description": "{{#context.alerts}}\n*Host:* {{host.name}} ({{source.ip}}) *OS:* {{host.os.name}} {{host.os.version}}\n*Time:* {{event.start}} - {{event.end}}\n*Reason:* {{signal.reason}}\n\n*------------------ Optional Fields ------------------*\n*Username:* {{winlog.user.name}} - {{user.name}}\n*File name:* {{file.name}}\n*Process Name:* {{process.name}} \n*Parent Process:* {{parent.process.name}}\n*-----------------------------------------------------*\n{{/context.alerts}}\n\n*Count of events:* {{state.signals_count}}\n\n*Link:* TENANTURL{{{context.results_link}}}", "summary": "{{context.rule.name}} - {{context.rule.severity}}" }, "comments": [ { "commentId": "1", "comment": "*Description:* {{context.rule.description}}\n\n*Rule Severity:* {{context.rule.severity}}\n\n*References:* {{context.rule.references}}\n\n*Possible false positive reason:* {{context.rule.false_positives}}\n\n*MITRE ATT&CK and ID:* {{context.rule.threat}}" } ] } } }, { "group": "default", "id": "id", "params": { "message": "# **{{context.rule.name}}**\n\n**Alerts:** {{state.signals_count}}\n\n**Severity:** {{context.rule.severity}}\n\n**Kibana URL:** TENANTURL{{{context.results_link}}}" } } ], "throttle": "rule" } } ] ``` (cherry picked from commit f7aff54) Co-authored-by: Thibaut Besacier <[email protected]>
The example 2 provided in the documentation has a few typos and is using an incorrect parameter. Also the documentation on the "params" in the action schema could use an example. https://www.elastic.co/guide/en/security/current/bulk-actions-rules-api.html#actions-object-schema-bulk  It can be difficult to apprehend that you need to define it as a list with a single item that is an array. An example would have made it a lot more clear. Like for example: ``` POST api/detection_engine/rules/_bulk_action "query": "alert.attributes.params.severity: \"critical\"", "action": "edit", "edit": [ { "type": "set_rule_actions", "value": { "actions": [ { "id": "id", "group": "default", "params": { "subAction": "pushToService", "subActionParams": { "incident": { "issueType": "10009", "priority": "Critical", "description": "{{#context.alerts}}\n*Host:* {{host.name}} ({{source.ip}}) *OS:* {{host.os.name}} {{host.os.version}}\n*Time:* {{event.start}} - {{event.end}}\n*Reason:* {{signal.reason}}\n\n*------------------ Optional Fields ------------------*\n*Username:* {{winlog.user.name}} - {{user.name}}\n*File name:* {{file.name}}\n*Process Name:* {{process.name}} \n*Parent Process:* {{parent.process.name}}\n*-----------------------------------------------------*\n{{/context.alerts}}\n\n*Count of events:* {{state.signals_count}}\n\n*Link:* TENANTURL{{{context.results_link}}}", "summary": "{{context.rule.name}} - {{context.rule.severity}}" }, "comments": [ { "commentId": "1", "comment": "*Description:* {{context.rule.description}}\n\n*Rule Severity:* {{context.rule.severity}}\n\n*References:* {{context.rule.references}}\n\n*Possible false positive reason:* {{context.rule.false_positives}}\n\n*MITRE ATT&CK and ID:* {{context.rule.threat}}" } ] } } }, { "group": "default", "id": "id", "params": { "message": "# **{{context.rule.name}}**\n\n**Alerts:** {{state.signals_count}}\n\n**Severity:** {{context.rule.severity}}\n\n**Kibana URL:** TENANTURL{{{context.results_link}}}" } } ], "throttle": "rule" } } ] ``` (cherry picked from commit f7aff54) Co-authored-by: Thibaut Besacier <[email protected]>
The example 2 provided in the documentation has a few typos and is using an incorrect parameter.
Also the documentation on the "params" in the action schema could use an example.

https://www.elastic.co/guide/en/security/current/bulk-actions-rules-api.html#actions-object-schema-bulk
It can be difficult to apprehend that you need to define it as a list with a single item that is an array. An example would have made it a lot more clear.
Like for example: