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

Bug: update_event() with add_event_report() doesn't add a report to existing Event #1112

Closed
mdavis332 opened this issue Dec 4, 2023 · 5 comments

Comments

@mdavis332
Copy link

MISP version: 2.4.178
PyMISP version: 2.4.178

Steps to reproduce

from pymisp import PyMISP

remote = 'http://misp-server:port'
token = 'api key'
verify_ssl = False

client = PyMISP(remote, token, verify_ssl)

# use existing event without a report
event_uuid = 1122
misp_event = client.get_event(event_uuid, pythonify=True)
# update local MISPEvent() obj w/ report
misp_event.add_event_report(name='test', content='test content')
# update event
result = client.update_event(misp_event)

# Verify on MISP instance that Event still doesn't have a report

However, if I'm adding a brand new event, the above steps with result = client.add_event(misp_event) (instead of update_event) work just fine to create a new Event with the expected report.

@Rafiot
Copy link
Member

Rafiot commented Dec 4, 2023

@mokaddem is it supposed to be possible over the API? It probably should, but before I start investigating, I refer ask you.

@mokaddem
Copy link
Contributor

mokaddem commented Dec 8, 2023

Yeah it should be possible. But I have a hunch the issue is on MISP side. I'll have a look.

@mokaddem
Copy link
Contributor

Did a fix regarding that endpoint in MISP/MISP@618dbb6.
Could you try again and report back if it still doesn't work? Thanks!

@mdavis332
Copy link
Author

Did a fix regarding that endpoint in MISP/MISP@618dbb6. Could you try again and report back if it still doesn't work? Thanks!

Hi @mokaddem that seemed to do the trick. I can now add a new report using add_event_report() and update_event(). Thank you!

@Rafiot
Copy link
Member

Rafiot commented Dec 15, 2023

Great, thanks!

@Rafiot Rafiot closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants