Merge pull request #39 from kevthehermit/master

Add Attribute by named category and type
pull/21/head
Alexandre Dulaunoy 2016-05-05 13:05:42 +02:00
commit 5fb8aac57b
1 changed files with 9 additions and 0 deletions

View File

@ -385,6 +385,15 @@ class PyMISP(object):
response = self.update_event(event['Event']['id'], event, 'json') response = self.update_event(event['Event']['id'], event, 'json')
return self._check_response(response) return self._check_response(response)
def add_named_attribute(self, event, category, type_value, value, to_ids=False, comment=None, distribution=None, proposal=False):
attributes = []
if value and category and type:
try:
attributes.append(self._prepare_full_attribute(category, type_value, value, to_ids, comment, distribution))
except NewAttributeError as e:
return e
return self._send_attributes(event, attributes, proposal)
def add_hashes(self, event, category='Artifacts dropped', filename=None, md5=None, sha1=None, sha256=None, ssdeep=None, comment=None, to_ids=True, distribution=None, proposal=False): def add_hashes(self, event, category='Artifacts dropped', filename=None, md5=None, sha1=None, sha256=None, ssdeep=None, comment=None, to_ids=True, distribution=None, proposal=False):
attributes = [] attributes = []