-
Notifications
You must be signed in to change notification settings - Fork 4
Error Installing on ubuntu 20.04 #14
Comments
It looks like you had the right idea as it seems the module was installed differently in your environment, but you seem to have left the class name off the end when you changed it. Maybe try "elastalert_hive_alerter.elastalert_hive_alerter.hive_alerter.HiveAlerter"? I imagine that will get you past the "issubclass" error at least. |
Thanks @danielbrowne, changing the alert to To put thing more into context, what I am essentially trying to acheive here is grap signals from elastic SIEM, and send them to thehive while attaching the observables if and when they exist. I works great if I leave out the attaching the observables part but then what I have to do is, every time I get alerts in thehive, I have to go back in kibana, find the signal and manually copy the observables. It would be such a time savior if those observables could be attached automatically by elastalert. Because all signals don't have the same set of fields, I am trying to match the posible values to grab them when they exist. Here is an example attempt to grap related ip addresses if and when they exist in the signal:
Every time any of these fields is missing from the signal, the alert never makes it to thehive and I get the following error: Or could this be acheived in a different way? |
@fopson It looks like you have the latest version of the code which is just printing an warning when trying to create an artifact for which data does not exist. That should not stop the alert from being sent without that specific artifact. That KeyError would have caused the problem, but that was fixed and the warning is now printed instead. My next suggestion would be to print some debug lines in the HiveAlerter code to ensure that send_to_thehive is being called. |
@danielbrowne the error above is definately different than the and here is a snippet of thehive's log I am trying to produce a pdb trace of the module running but passing modules directly to pdb was not support in python3.6 so am trying to find a way around that. |
I have just build a new Ubuntu 20.04 server VM and reinstalled from the blank server but I get the same error as my previous comment. |
@fopson I see that there is a commit where jsonify is being monkey patched at the top of hive_alerter.py, but I am not sure why. Something to do with python2 vs python3. I suspect that maybe maybe allowing that monkey patch to accept *args and **kwargs might solve the problem you are seeing. |
@danielbrowne Thanks for pointing me to the right direction. For testing, I commented out the monkey patch and can now receive elarts in some conditions with observables attached to the alert. After getting these results, I decided to test the same setup but with latest elastalert v0.2.4 and tadahh I also receive alerts with mapped observables with the latest version version of elastalert. So for anybody who wants to try this in the future, this setup also works with v0.2.4 of elastalert. I seem to have lost a feature though. Whether the setup is with v0.2.1 or v0.2.4, I seem to have lost the ability use lists either in the desciption:
or in the tags: In either cases I get the following error: |
@fopson The error indicates that one of the properties in the match context path is a list, but that the subsequent element in the path treats it as a dictionary. For example, the following format would generate the error if "rule" was actually a list in the context:
You can still use a list as the leaf value in the format:
Or if you know which element you want you can refer to it specifically:
Does that help? |
@danielbrowne Yes, your explaination is of great help thanks. It helped me understand what I was doing wrong with the tags. The tags where fairely easy to resolve one I understood the right way to express the path with a list for the match. I am still having a bit of a hard time sorting the multiline description. I am sure I am screwing up the syntax somehow. When I try to retrieve just the the desciption in one line:
It works, which makes me believe it dosn't have to do with the path of the match. Now as soon as I try to use one of the multiline operators, it complains about list indices:
My final goal is to be able to use multilines formated like this:
Do the multiline operators (> or |) turn the following lines into a list? How could I then get around that to achieve my goal? |
@danielbrowne It's all working like a charm now. I was messing up the json syntax in the description. Thanks again for your help and guidance! |
@fopson no problem, I'm glad you found this useful. |
Hi all, I have unsuccessfully been trying to get this module working on ubuntu 20.04. I Used to use the latest elastalert v0.2.4 with python3.8 which worked great exept for the
KeyError:
when any entry in thehive_observable_data_mapping
doesn't find a match which causes it not to send the alert as previously discribed in issue #10. From issue #10, I read that this module solves this problem when coupled with elastalert release v0.2.1 and phython 3.6 so thought it was going to save my life but I have been struggling to get it to work. Here is my install process:1. Install phython 3.6 and python virtual env
2. Download and extract release v0.2.1 of elastalert from Yelp
wget https://github.com/Yelp/elastalert/archive/v0.2.1.tar.gz -O - | sudo tar -xz -C /opt/
3. Cd to project dir and create a virutal env called "elastalert-venv"
cd /opt/elastalert-0.2.1 && virtualenv -p /usr/bin/python3.6 elastalert-venv
4. Activate the virtual environment
source ./elastalert-venv/bin/activate
5. Install dependency (without it, I get the error: warning: no files found matching 'blist.rst' on step 6)
sudo apt install libpython3.6-dev
6. Install the Yelp Python package
python setup.py install
7. Clone the Nclose Hive Alerter master branch
git clone https://github.com/Nclose-ZA/elastalert_hive_alerter.git
8. Install the Nclose Hive Alerter python package
python elastalert_hive_alerter/setup.py install
I then used one of my previous rules but changed the alert module to

alert: "elastalert_hive_alerter.hive_alerter.HiveAlerter"
as per the documentation on this site. Now, when I ran elastalert, I got this error:Based on this output:


I changed the alert module to
alert: "elastalert_hive_alerter.elastalert_hive_alerter.hive_alerter"
and now when I run elastert, I get the following error:Note that if I change the alert back to
alert: hivealerter
, I don't get the above error but then I am back to square one where I get theKeyError:
when a field is empty in a match.I am not sure what I am doing wrong at this stage. Has anybody gotten this working lately on ubuntu 20.04? I have been googling but so far I am coming up empty. Any help will be appreciated!
The text was updated successfully, but these errors were encountered: