mirror of https://github.com/MISP/PyMISP
Update types, allow 0 as attribute value
parent
e029b60455
commit
638ad3d4b7
|
@ -69,6 +69,10 @@
|
||||||
"default_category": "Payload delivery",
|
"default_category": "Payload delivery",
|
||||||
"to_ids": 1
|
"to_ids": 1
|
||||||
},
|
},
|
||||||
|
"float": {
|
||||||
|
"default_category": "Other",
|
||||||
|
"to_ids": 0
|
||||||
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"default_category": "External analysis",
|
"default_category": "External analysis",
|
||||||
"to_ids": 1
|
"to_ids": 1
|
||||||
|
@ -544,6 +548,7 @@
|
||||||
"email-dst",
|
"email-dst",
|
||||||
"email-subject",
|
"email-subject",
|
||||||
"email-attachment",
|
"email-attachment",
|
||||||
|
"float",
|
||||||
"url",
|
"url",
|
||||||
"http-method",
|
"http-method",
|
||||||
"user-agent",
|
"user-agent",
|
||||||
|
@ -998,14 +1003,15 @@
|
||||||
"other"
|
"other"
|
||||||
],
|
],
|
||||||
"Other": [
|
"Other": [
|
||||||
|
"comment",
|
||||||
|
"text",
|
||||||
|
"other",
|
||||||
"size-in-bytes",
|
"size-in-bytes",
|
||||||
"counter",
|
"counter",
|
||||||
"datetime",
|
"datetime",
|
||||||
"cpe",
|
"cpe",
|
||||||
"port",
|
"port",
|
||||||
"comment",
|
"float"
|
||||||
"text",
|
|
||||||
"other"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,9 +130,9 @@ class MISPAttribute(object):
|
||||||
|
|
||||||
type_defaults = self.sane_default[self.type]
|
type_defaults = self.sane_default[self.type]
|
||||||
|
|
||||||
if kwargs.get('value'):
|
self.value = kwargs.get('value')
|
||||||
self.value = kwargs['value']
|
|
||||||
elif not self.value:
|
if self.value is None:
|
||||||
raise NewAttributeError('The value of the attribute is required.')
|
raise NewAttributeError('The value of the attribute is required.')
|
||||||
|
|
||||||
# Default values
|
# Default values
|
||||||
|
@ -444,7 +444,7 @@ class MISPEvent(object):
|
||||||
raise NewEventError('{} is invalid, the analysis has to be in 0, 1, 2'.format(self.analysis))
|
raise NewEventError('{} is invalid, the analysis has to be in 0, 1, 2'.format(self.analysis))
|
||||||
if kwargs.get('published') is not None:
|
if kwargs.get('published') is not None:
|
||||||
self.unpublish()
|
self.unpublish()
|
||||||
if kwargs.get("published") == True:
|
if kwargs.get("published") is True:
|
||||||
self.publish()
|
self.publish()
|
||||||
if kwargs.get('date'):
|
if kwargs.get('date'):
|
||||||
self.set_date(kwargs['date'])
|
self.set_date(kwargs['date'])
|
||||||
|
|
Loading…
Reference in New Issue