Cleanup create_events

pull/30/head
Raphaël Vinot 2016-08-26 18:23:20 +02:00
parent 1532bc879f
commit 8dbeec3f96
2 changed files with 36 additions and 5 deletions

View File

@ -13,7 +13,7 @@ except NameError:
def init(url, key):
return PyMISP(url, key, True, 'json')
return PyMISP(url, key, True, 'json', debug=True)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Create an event on MISP.')
@ -26,7 +26,4 @@ if __name__ == '__main__':
misp = init(misp_url, misp_key)
event = misp.new_event(args.distrib, args.threat, args.analysis, args.info)
print event
response = misp.add_mutex(event, 'booh')
print response
print(event)

34
tests/new_misp_event.json Normal file
View File

@ -0,0 +1,34 @@
{
"Event": {
"uuid": "57c06bb1-625c-4d34-9b9f-4066950d210f",
"orgc_id": "1",
"publish_timestamp": "0",
"RelatedEvent": [],
"org_id": "1",
"Org": {
"uuid": "55f6ea5e-2c60-40e5-964f-47a8950d210f",
"name": "CIRCL",
"id": "1"
},
"attribute_count": null,
"distribution": "0",
"sharing_group_id": "0",
"threat_level_id": "1",
"locked": false,
"Attribute": [],
"published": false,
"ShadowAttribute": [],
"date": "2016-08-26",
"info": "This is a test",
"timestamp": "1472228273",
"Orgc": {
"uuid": "55f6ea5e-2c60-40e5-964f-47a8950d210f",
"name": "CIRCL",
"id": "1"
},
"id": "594",
"proposal_email_lock": false,
"analysis": "0"
}
}