chg: Update main notebook

pull/464/head
Raphaël Vinot 2019-09-16 18:30:53 +02:00
parent b67cec60a3
commit 9a6fea67c4
1 changed files with 19 additions and 13 deletions

View File

@ -839,10 +839,10 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"# The URL of the MISP instance to connect to\n", "# The URL of the MISP instance to connect to\n",
"misp_url = 'http://127.0.0.1:8080/'\n", "misp_url = 'https://127.0.0.1:8443/'\n",
"# Can be found in the MISP web interface under \n", "# Can be found in the MISP web interface under \n",
"# http://+MISP_URL+/users/view/me -> Authkey\n", "# http://+MISP_URL+/users/view/me -> Authkey\n",
"misp_key = 'HRizIMmaxBOXAQSzKZ874rDWUsQEk4vGAGBoljQO'\n", "misp_key = 'd6OmdDFvU3Seau3UjwvHS1y3tFQbaRNhJhDX0tjh'\n",
"# Should PyMISP verify the MISP certificate\n", "# Should PyMISP verify the MISP certificate\n",
"misp_verifycert = False" "misp_verifycert = False"
] ]
@ -897,7 +897,7 @@
"event.add_object(mispObject)\n", "event.add_object(mispObject)\n",
"\n", "\n",
"print(misp)\n", "print(misp)\n",
"existing_event = misp.add_event(event)\n", "existing_event = misp.add_event(event, pythonify=True)\n",
"print(existing_event)\n", "print(existing_event)\n",
"mispObject = MISPObject('file')\n", "mispObject = MISPObject('file')\n",
"mispObject.add_attribute('filename', type='filename',\n", "mispObject.add_attribute('filename', type='filename',\n",
@ -989,10 +989,9 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"event = misp.new_event(distribution=1,\n", "misp.toggle_global_pythonify() # Returns PyMISP objects whenever possible, allows to skip pythonify\n",
" threat_level_id=1,\n", "\n",
" analysis=1,\n", "event = misp.add_event({'distribution': 1, \"threat_level_id\": 1, \"analysis\": 1, 'info':\"Event from notebook\"})\n",
" info=\"Event from notebook\")\n",
"print(\"Event id: %s\" % event.id)" "print(\"Event id: %s\" % event.id)"
] ]
}, },
@ -1047,7 +1046,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"event_id = 2752" "event_id = 9"
] ]
}, },
{ {
@ -1202,7 +1201,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"proposal = misp.get_attribute_proposal(21)\n", "proposal = misp.get_attribute_proposal(1)\n",
"print(proposal.to_json())" "print(proposal.to_json())"
] ]
}, },
@ -1212,7 +1211,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"proposal = misp.accept_attribute_proposal(25)\n", "proposal = misp.accept_attribute_proposal(1)\n",
"print(proposal)" "print(proposal)"
] ]
}, },
@ -1222,7 +1221,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"proposal = misp.discard_attribute_proposal(27)\n", "proposal = misp.discard_attribute_proposal(2)\n",
"print(proposal)" "print(proposal)"
] ]
}, },
@ -1344,7 +1343,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"misp.direct_call('attributes/add/58', {'type': 'ip-dst', 'value': '8.11.8.8'})" "misp.direct_call('attributes/add/9', {'type': 'ip-dst', 'value': '8.11.8.8'})"
] ]
}, },
{ {
@ -1394,7 +1393,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"misp.add_user('bar@foo.de', 1, 3)" "misp.add_user({'email': 'bar@foo.de'})"
] ]
}, },
{ {
@ -1453,6 +1452,13 @@
"source": [ "source": [
"misp.cache_feeds_all()" "misp.cache_feeds_all()"
] ]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
} }
], ],
"metadata": { "metadata": {