mirror of https://github.com/MISP/PyMISP
Merge branch 'master' into sightingAPI
commit
444a9f5755
|
@ -3,8 +3,11 @@
|
||||||
*.pyc
|
*.pyc
|
||||||
examples/keys.py
|
examples/keys.py
|
||||||
examples/cudeso.py
|
examples/cudeso.py
|
||||||
examples/feed-generator/output/*.json
|
examples/feed-generator/output/*\.json
|
||||||
|
examples/feed-generator/output/hashes\.csv
|
||||||
|
examples/feed-generator/settings\.py
|
||||||
build/*
|
build/*
|
||||||
dist/*
|
dist/*
|
||||||
pymisp.egg-info/*
|
pymisp.egg-info/*
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json', debug=True)
|
return PyMISP(url, key, misp_verifycert, 'json', debug=True)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Add an attribute to an event')
|
parser = argparse.ArgumentParser(description='Add an attribute to an event')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json')
|
return PyMISP(url, key, misp_verifycert, 'json')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Add a new user by setting the mandory fields.')
|
parser = argparse.ArgumentParser(description='Add a new user by setting the mandory fields.')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json')
|
return PyMISP(url, key, misp_verifycert, 'json')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Add the user described in the given json. If no file is provided, returns a json listing all the fields used to describe a user.')
|
parser = argparse.ArgumentParser(description='Add the user described in the given json. If no file is provided, returns a json listing all the fields used to describe a user.')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json', debug=True)
|
return PyMISP(url, key, misp_verifycert, 'json', debug=True)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Create an event on MISP.')
|
parser = argparse.ArgumentParser(description='Create an event on MISP.')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json')
|
return PyMISP(url, key, misp_verifycert, 'json')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Delete the user with the given id. Keep in mind that disabling users (by setting the disabled flag via an edit) is always prefered to keep user associations to events intact.')
|
parser = argparse.ArgumentParser(description='Delete the user with the given id. Keep in mind that disabling users (by setting the disabled flag via an edit) is always prefered to keep user associations to events intact.')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json')
|
return PyMISP(url, key, misp_verifycert, 'json')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Edit the email of the user designed by the user_id.')
|
parser = argparse.ArgumentParser(description='Edit the email of the user designed by the user_id.')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json')
|
return PyMISP(url, key, misp_verifycert, 'json')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Edit the user designed by the user_id. If no file is provided, returns a json listing all the fields used to describe a user.')
|
parser = argparse.ArgumentParser(description='Edit the user designed by the user_id. If no file is provided, returns a json listing all the fields used to describe a user.')
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
|
|
||||||
import sys, json, time, requests
|
import sys, json, time, requests
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
|
|
||||||
et_url = 'https://rules.emergingthreats.net/fwrules/emerging-Block-IPs.txt'
|
et_url = 'https://rules.emergingthreats.net/fwrules/emerging-Block-IPs.txt'
|
||||||
et_str = 'Emerging Threats '
|
et_str = 'Emerging Threats '
|
||||||
|
|
||||||
def init_misp():
|
def init_misp():
|
||||||
global mymisp
|
global mymisp
|
||||||
mymisp = PyMISP(misp_url, misp_key)
|
mymisp = PyMISP(misp_url, misp_key, misp_verifycert)
|
||||||
|
|
||||||
def load_misp_event(eid):
|
def load_misp_event(eid):
|
||||||
global et_attr
|
global et_attr
|
||||||
|
|
|
@ -5,9 +5,26 @@ This python script can be used to generate a MISP feed based on an existing MISP
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
````
|
````
|
||||||
git clone https://github.com/CIRCL/PyMISP
|
git clone https://github.com/MISP/PyMISP.git
|
||||||
cd examples/feed-generator
|
cd examples/feed-generator
|
||||||
cp settings-default.py settings.py
|
cp settings-default.py settings.py
|
||||||
vi settings.py #adjust your settings
|
vi settings.py #adjust your settings
|
||||||
python3 generate.py
|
python3 generate.py
|
||||||
````
|
````
|
||||||
|
|
||||||
|
# Output
|
||||||
|
|
||||||
|
The generated feed will be stored in your `outputdir`.
|
||||||
|
It contains the files:
|
||||||
|
- `manifest.json` - containing the feed manifest (generic event information)
|
||||||
|
- `hashes.csv` - listing the hashes of the attribute values
|
||||||
|
- `*.json` - a large amount of `json` files
|
||||||
|
|
||||||
|
|
||||||
|
# Importing in MISP
|
||||||
|
|
||||||
|
To import this feed into your MISP instance:
|
||||||
|
- Sync Actions > List Feeds > Add feed
|
||||||
|
- Fill in the form while ensuring the 'source format' is set to 'MISP Feed'
|
||||||
|
|
||||||
|
For more information about feeds please read: https://misp.gitbooks.io/misp-book/content/managing-feeds/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
@ -79,15 +79,17 @@ valid_attribute_distributions = []
|
||||||
|
|
||||||
attributeHashes = []
|
attributeHashes = []
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
# If we have an old settings.py file then this variable won't exist
|
# If we have an old settings.py file then this variable won't exist
|
||||||
global valid_attribute_distributions
|
global valid_attribute_distributions
|
||||||
try:
|
try:
|
||||||
valid_attribute_distributions = valid_attribute_distribution_levels
|
valid_attribute_distributions = valid_attribute_distribution_levels
|
||||||
except:
|
except Exception:
|
||||||
valid_attribute_distributions = ['0', '1', '2', '3', '4', '5']
|
valid_attribute_distributions = ['0', '1', '2', '3', '4', '5']
|
||||||
return PyMISP(url, key, ssl)
|
return PyMISP(url, key, ssl)
|
||||||
|
|
||||||
|
|
||||||
def recursiveExtract(container, containerType, leaf, eventUuid):
|
def recursiveExtract(container, containerType, leaf, eventUuid):
|
||||||
temp = {}
|
temp = {}
|
||||||
if containerType in ['Attribute', 'Object']:
|
if containerType in ['Attribute', 'Object']:
|
||||||
|
@ -118,8 +120,8 @@ def recursiveExtract(container, containerType, leaf, eventUuid):
|
||||||
temp[childType].append(processed)
|
temp[childType].append(processed)
|
||||||
return temp
|
return temp
|
||||||
|
|
||||||
|
|
||||||
def saveEvent(misp, uuid):
|
def saveEvent(misp, uuid):
|
||||||
result = {}
|
|
||||||
event = misp.get_event(uuid)
|
event = misp.get_event(uuid)
|
||||||
if not event.get('Event'):
|
if not event.get('Event'):
|
||||||
print('Error while fetching event: {}'.format(event['message']))
|
print('Error while fetching event: {}'.format(event['message']))
|
||||||
|
@ -130,11 +132,13 @@ def saveEvent(misp, uuid):
|
||||||
eventFile.write(event)
|
eventFile.write(event)
|
||||||
eventFile.close()
|
eventFile.close()
|
||||||
|
|
||||||
|
|
||||||
def __blockByDistribution(element):
|
def __blockByDistribution(element):
|
||||||
if element['distribution'] not in valid_attribute_distributions:
|
if element['distribution'] not in valid_attribute_distributions:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def saveHashes():
|
def saveHashes():
|
||||||
if not attributeHashes:
|
if not attributeHashes:
|
||||||
return False
|
return False
|
||||||
|
@ -148,7 +152,6 @@ def saveHashes():
|
||||||
sys.exit('Could not create the quick hash lookup file.')
|
sys.exit('Could not create the quick hash lookup file.')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def saveManifest(manifest):
|
def saveManifest(manifest):
|
||||||
try:
|
try:
|
||||||
manifestFile = open(os.path.join(outputdir, 'manifest.json'), 'w')
|
manifestFile = open(os.path.join(outputdir, 'manifest.json'), 'w')
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ except NameError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, False, 'json', debug=False)
|
return PyMISP(url, key, misp_verifycert, 'json', debug=False)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from io import open
|
from io import open
|
||||||
|
@ -15,7 +15,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
pymisp = PyMISP(misp_url, misp_key)
|
pymisp = PyMISP(misp_url, misp_key, misp_verifycert)
|
||||||
|
|
||||||
with open(args.input, 'r') as f:
|
with open(args.input, 'r') as f:
|
||||||
result = pymisp.freetext(args.event, f.read())
|
result = pymisp.freetext(args.event, f.read())
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import sys
|
import sys
|
||||||
import datetime
|
import datetime
|
||||||
from pymisp import PyMISP, MISPAttribute
|
from pymisp import PyMISP, MISPAttribute
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
|
|
||||||
cefconfig = {"Default_Severity":1, "Device_Vendor":"MISP", "Device_Product":"MISP", "Device_Version":1}
|
cefconfig = {"Default_Severity":1, "Device_Vendor":"MISP", "Device_Product":"MISP", "Device_Version":1}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ def make_cef(event):
|
||||||
|
|
||||||
def init_misp():
|
def init_misp():
|
||||||
global mymisp
|
global mymisp
|
||||||
mymisp = PyMISP(misp_url, misp_key)
|
mymisp = PyMISP(misp_url, misp_key, misp_verifycert)
|
||||||
|
|
||||||
|
|
||||||
def echeck(r):
|
def echeck(r):
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from pymisp import PyMISP, MISPAttribute
|
from pymisp import PyMISP, MISPAttribute
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
|
|
||||||
|
|
||||||
def init_misp():
|
def init_misp():
|
||||||
global mymisp
|
global mymisp
|
||||||
mymisp = PyMISP(misp_url, misp_key)
|
mymisp = PyMISP(misp_url, misp_key, misp_verifycert)
|
||||||
|
|
||||||
|
|
||||||
def echeck(r):
|
def echeck(r):
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json')
|
return PyMISP(url, key, misp_verifycert, 'json')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Get a list of the sharing groups from the MISP instance.')
|
parser = argparse.ArgumentParser(description='Get a list of the sharing groups from the MISP instance.')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json')
|
return PyMISP(url, key, misp_verifycert, 'json')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Add sighting.')
|
parser = argparse.ArgumentParser(description='Add sighting.')
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True)
|
return PyMISP(url, key, misp_verifycert)
|
||||||
|
|
||||||
|
|
||||||
def fetch(m, all_events, event):
|
def fetch(m, all_events, event):
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json', True)
|
return PyMISP(url, key, misp_verifycert, 'json', True)
|
||||||
|
|
||||||
|
|
||||||
def get_tags(m):
|
def get_tags(m):
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from io import open
|
from io import open
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json', debug=True)
|
return PyMISP(url, key, misp_verifycert, 'json', debug=True)
|
||||||
|
|
||||||
def up_event(m, event, content):
|
def up_event(m, event, content):
|
||||||
with open(content, 'r') as f:
|
with open(content, 'r') as f:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
# For python2 & 3 compat, a bit dirty, but it seems to be the least bad one
|
||||||
|
@ -13,7 +13,7 @@ except NameError:
|
||||||
|
|
||||||
|
|
||||||
def init(url, key):
|
def init(url, key):
|
||||||
return PyMISP(url, key, True, 'json')
|
return PyMISP(url, key, misp_verifycert, 'json')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Get a list of the sharing groups from the MISP instance.')
|
parser = argparse.ArgumentParser(description='Get a list of the sharing groups from the MISP instance.')
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from pymisp.tools import load_warninglists
|
from pymisp.tools import load_warninglists
|
||||||
import argparse
|
import argparse
|
||||||
from keys import misp_url, misp_key
|
from keys import misp_url, misp_key, misp_verifycert
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -18,5 +18,5 @@ if __name__ == '__main__':
|
||||||
if args.package:
|
if args.package:
|
||||||
print(load_warninglists.from_package())
|
print(load_warninglists.from_package())
|
||||||
elif args.remote:
|
elif args.remote:
|
||||||
pm = PyMISP(misp_url, misp_key)
|
pm = PyMISP(misp_url, misp_key, misp_verifycert)
|
||||||
print(load_warninglists.from_instance(pm))
|
print(load_warninglists.from_instance(pm))
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
"name": "url",
|
"name": "url",
|
||||||
"sharing_group_id": "0",
|
"sharing_group_id": "0",
|
||||||
"template_uuid": "60efb77b-40b5-4c46-871b-ed1ed999fce5",
|
"template_uuid": "60efb77b-40b5-4c46-871b-ed1ed999fce5",
|
||||||
"template_version": "6",
|
"template_version": "7",
|
||||||
"uuid": "b"
|
"uuid": "b"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
"meta-category": "file",
|
"meta-category": "file",
|
||||||
"description": "File object describing a file with meta-information",
|
"description": "File object describing a file with meta-information",
|
||||||
"template_uuid": "688c46fb-5edb-40a3-8273-1af7923e2215",
|
"template_uuid": "688c46fb-5edb-40a3-8273-1af7923e2215",
|
||||||
"template_version": "7",
|
"template_version": "6",
|
||||||
"event_id": "6719",
|
"event_id": "6719",
|
||||||
"uuid": "5a4e4ffe-4cb8-48b1-bd5c-48fb950d210f",
|
"uuid": "5a4e4ffe-4cb8-48b1-bd5c-48fb950d210f",
|
||||||
"timestamp": "1515081726",
|
"timestamp": "1515081726",
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
"name": "file",
|
"name": "file",
|
||||||
"sharing_group_id": "0",
|
"sharing_group_id": "0",
|
||||||
"template_uuid": "688c46fb-5edb-40a3-8273-1af7923e2215",
|
"template_uuid": "688c46fb-5edb-40a3-8273-1af7923e2215",
|
||||||
"template_version": "7",
|
"template_version": "8",
|
||||||
"timestamp": "1514975928",
|
"timestamp": "1514975928",
|
||||||
"uuid": "5a4cb2b8-7958-4323-852c-4d2a950d210f"
|
"uuid": "5a4cb2b8-7958-4323-852c-4d2a950d210f"
|
||||||
}
|
}
|
||||||
|
|
|
@ -836,8 +836,10 @@ class TestComprehensive(unittest.TestCase):
|
||||||
|
|
||||||
def test_taxonomies(self):
|
def test_taxonomies(self):
|
||||||
# Make sure we're up-to-date
|
# Make sure we're up-to-date
|
||||||
self.admin_misp_connector.update_taxonomies()
|
|
||||||
r = self.admin_misp_connector.update_taxonomies()
|
r = self.admin_misp_connector.update_taxonomies()
|
||||||
|
print(r)
|
||||||
|
r = self.admin_misp_connector.update_taxonomies()
|
||||||
|
print(r)
|
||||||
self.assertEqual(r['name'], 'All taxonomy libraries are up to date already.')
|
self.assertEqual(r['name'], 'All taxonomy libraries are up to date already.')
|
||||||
# Get list
|
# Get list
|
||||||
taxonomies = self.admin_misp_connector.get_taxonomies_list()
|
taxonomies = self.admin_misp_connector.get_taxonomies_list()
|
||||||
|
|
Loading…
Reference in New Issue