-
Notifications
You must be signed in to change notification settings - Fork 288
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
Allow the possibility to use rule and match filed in thehive alert description #855
Conversation
…llow the use of match and rule fields in the description for the alert in thehive, based on the model of alert_text and alert_text_args'
…llow the use of match and rule fields in the description for the alert in thehive, based on the model of alert_text and alert_text_args'
add documentation for description_args field in the hive
Add the possibility to use rule and match fileds in the description of TheHive alert
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.
Thanks for your contribution! Please make the following changes:
- Document the new
description_missing_value
setting. - Add unit tests to cover the following scenarios:
- Rule does not contain a
description
subfield under thehive_alert_config
block - Rule does contain a
description
subfield under thehive_alert_config
block but does not contain adescription_args
subfield. - Rule contains both the
description
anddescription_args
subfield, with 3 args, where arg1 value is correctly looked up in the match, arg2 value has no match lookup (None), and for arg3, whatever you need to do make it get adescription_missing_value
(I'm not seeing how this can ever be used, so a test case illustrating it will be helpful).
- Update the CHANGELOG entry you added to adhere to the proper changelog format. Notice that the other changelogs contain the PR link and the author username, separated by hyphens.
Hello @jertel, Let me know if anything else is needed. Kind regards, |
Thank you for those changes. Why did you move |
… hive description in thehive_test.py
the file move was copy and pate error, my bad, sorry. Kind regards, |
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.
Couple more minor changes and we should be ready to merge this. I noticed there's no schema.yaml values for thehive alerter so eventually we'll need to get that fixed, but it doesn't need to be part of this PR.
…nctions to populate the alert fields
Looks like two of your new unit tests are failing. Once you fix those and see the build go green we will be set. |
The unit tests are now passing but there are some lint problems:
|
I tried to correct, following the output you gave me. |
Description
No breaking change.
I used the model of alert_text and alert_text_args, to give the possibility to use rule fields and match fields in thehive alert description.
For this purpose I added an optional field in the rule 'description_args'.
if not used the description will follow the normal path (either default description or the string added by the user).
I was in need for it and saw I was the only who tried to use such a thing.
Checklist
make test-docker
with my changes.Questions or Comments
I have tested this in my environment making elastalert run on a ELK Siem. I created data that would trigger my test alert and they were indexed in the elasticsearch cluster. It worked as expected, the alert was sent to TheHive with the necessary information in the description.
I tested the alert by also sending it to slack at the same time, and found no issue.
I used the last version of elastalert2.