mirror of https://github.com/MISP/PyMISP
Merge https://github.com/MISP/PyMISP into newbranch
commit
e53f59bcbf
|
@ -2,12 +2,10 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from pymisp import PyMISP
|
||||
from keys import misp_url, misp_key, misp_verifycert
|
||||
from keys import url, key
|
||||
import argparse
|
||||
import tools
|
||||
|
||||
def init(url, key):
|
||||
return PyMISP(url, key, misp_verifycert, 'json')
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Create a given number of event containing a given number of attributes eachh.')
|
||||
|
@ -15,7 +13,7 @@ if __name__ == '__main__':
|
|||
parser.add_argument("-a", "--attribute", type=int, help="Number of attributes per event (default 3000)")
|
||||
args = parser.parse_args()
|
||||
|
||||
misp = init(misp_url, misp_key)
|
||||
misp = PyMISP(url, key, True, 'json')
|
||||
|
||||
if args.limit is None:
|
||||
args.limit = 1
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
__version__ = '2.4.48.1'
|
||||
__version__ = '2.4.48.2'
|
||||
|
||||
from .api import PyMISP, PyMISPError, NewEventError, NewAttributeError, MissingDependency, NoURL, NoKey
|
||||
|
|
|
@ -364,6 +364,13 @@ class PyMISP(object):
|
|||
|
||||
return self._check_response(response)
|
||||
|
||||
def remove_tag(self, event, tag):
|
||||
session = self.__prepare_session('json')
|
||||
to_post = {'request': {'Event': {'id': event['Event']['id'], 'tag': tag}}}
|
||||
response = session.post(urljoin(self.root_url, 'events/removeTag'), data=json.dumps(to_post))
|
||||
|
||||
return self._check_response(response)
|
||||
|
||||
def change_threat_level(self, event, threat_level_id):
|
||||
event['Event']['threat_level_id'] = threat_level_id
|
||||
self._prepare_update(event)
|
||||
|
|
Loading…
Reference in New Issue