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
Updating Existing Event, NewAttributeError "The info field of the new event is required." #321
Comments
I've got the same issue Take the following code block as an example: pm = PyMISP("url", "apikey")
event = pm.get(1234)
# Printing the event will give you the fill event, with attributes and all)
print(event)
pm.add_domain(event, "exampledomain.com")
# Printing the event now contains considerably less data. For example, following keys aren't present:
# event['Event']['id']
# event['Event']['info']
print(event) I'm under the impression that whatever is adding an attribute and updating is causing the event to get refreshed, and many of the fields are stripped or not returned It's definitely a PyMISP issue - Old version of PyMISP works as expected on the same MISP |
Looks like it may be an issue with how the misp_event.py is popping all the records from the MISP event, such as: Lines 489 to 491 in d4daa2f
What's happening is that if you pass the entire event to @Rafiot - What is the recommended approach for adding/removing attributes from an event? Should we be passing the ID instead of the entire event, i.e. |
Also, what's interesting is that it's raising a |
This is the line which causes this to fire when adding attributes in my case Line 467 in d4daa2f
|
Same issue we have, the updated branch of pymisp seems to consider this modification as a new event so event_info is a required field to be passed now for existing events. It worked on the older branch of pymisp but newer updates of MISP (and PyMISP) have impacted this. Also, there is no specific method available to update an event's eventinfo which ideally needs a new method "change_eventinfo" but in my example I don't want the eventinfo to change. |
Sorry for the late answer. Okay, that was definitely a weird one to figure out. Basically, calling If you use HEAD, it should work as expected. |
This is still not working for me when I update to HEAD or checkout that commit; With that commit: (was on PyMISP v2.99) cat .git/HEAD
Same error with latest HEAD: (PyMISP v2.102) cat .git/HEAD git describe |
Where does The sample code here works. Oh, I see. It's failing further down in the code. Also, this piece of code uses a very old way making lots of calls to MISP and should be updated. If you point me to the project, I can probably fix it. |
That should work now. Nevertheless, the code is extremely inefficient and should really be fixed. |
The fix unfortunately didn't work @Rafiot
The script is still the same as the original post and yes could be refined. Hangs on the second edit "change_analysis_status") to the existing event(s):
Updated PyMISP
and in pip3
Appreciate some guidance on how to improve the script and get it working again. |
That would make everyone's life a lot easier if you could share the whole file, so I don't keep blindly patching things. |
replace
by:
And it should (?) work. I don't even understand how it could have worked before, because the following call is invalid (it expects an ID)...
|
Great thanks for the help @Rafiot, updated the code to that and it works now. Was only importing PyMISP library previously for the old code, once MISPEvent library was imported it worked along with the updated code. |
Cool, glad it works :) |
Note that we need pymisp==2.4.111.2 which fixes a bug, see MISP/PyMISP#321
Note that we need pymisp==2.4.111.2 which fixes a bug, see MISP/PyMISP#321
Note that we need pymisp==2.4.111.2 which fixes a bug, see MISP/PyMISP#321
Note that we need pymisp==2.4.111.2 which fixes a bug, see MISP/PyMISP#321
Searching for events belonging to an org and if the the tag is present then proceeds to tag the event only for 1 event. It fails with the following error message:
Code below:
Was there a recent change that requires passing the "eventinfo" in modifying existing events?
What is the best method to pass the existing "eventinfo" in order to publish a modified event/s?
The text was updated successfully, but these errors were encountered: