Skip to content

Instantly share code, notes, and snippets.

@ag-michael
Created December 21, 2020 20:10
Show Gist options
  • Save ag-michael/e2fd3aef7cc9d14f46505c559902677b to your computer and use it in GitHub Desktop.
Save ag-michael/e2fd3aef7cc9d14f46505c559902677b to your computer and use it in GitHub Desktop.
Auto publish MISP events
#! /usr/bin/python3
misp_url = '<misp url>'
misp_key = '<apikey>'
misp_verifycert = True
relative_path = 'events/restSearch'
body = {
"returnFormat": "json",
"timestamp": "90d",
"published": 0
}
from pymisp import ExpandedPyMISP
misp = ExpandedPyMISP(misp_url, misp_key,ssl=False)
results = misp.direct_call(relative_path, body)
for r in results:
print(r['Event']['id'])
print(misp.publish(r['Event']['id']))
print("Published all events")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment