Skip to content
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

[8.7] update rule query clarification (backport #2985) #3123

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 3, 2023

This is an automatic backport of pull request #2985 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

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
![image](https://user-images.githubusercontent.com/22603166/218981222-839eca6c-117b-42a8-98fc-cd47f310919a.png)

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)
@mergify mergify bot added the backport label Apr 3, 2023
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

Documentation previews:

@jmikell821 jmikell821 merged commit eb30718 into 8.7 Apr 3, 2023
@mergify mergify bot deleted the mergify/bp/8.7/pr-2985 branch April 3, 2023 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants