2017-02-10 22:35:02 +01:00
|
|
|
"""STIX 2 Common Data Types and Properties"""
|
|
|
|
|
2017-04-19 20:32:56 +02:00
|
|
|
from .other import ExternalReference, GranularMarking
|
2017-04-25 00:29:56 +02:00
|
|
|
from .properties import (BooleanProperty, ListProperty, ReferenceProperty,
|
|
|
|
TimestampProperty)
|
2017-02-10 22:35:02 +01:00
|
|
|
from .utils import NOW
|
|
|
|
|
|
|
|
COMMON_PROPERTIES = {
|
2017-02-24 17:46:21 +01:00
|
|
|
# 'type' and 'id' should be defined on each individual type
|
2017-04-11 18:10:55 +02:00
|
|
|
'created': TimestampProperty(default=lambda: NOW),
|
|
|
|
'modified': TimestampProperty(default=lambda: NOW),
|
2017-04-19 20:32:56 +02:00
|
|
|
'external_references': ListProperty(ExternalReference),
|
2017-03-22 00:33:43 +01:00
|
|
|
'revoked': BooleanProperty(),
|
2017-03-31 21:52:27 +02:00
|
|
|
'created_by_ref': ReferenceProperty(type="identity"),
|
2017-04-14 16:42:17 +02:00
|
|
|
'object_marking_refs': ListProperty(ReferenceProperty(type="marking-definition")),
|
2017-04-19 20:32:56 +02:00
|
|
|
'granular_markings': ListProperty(GranularMarking),
|
2017-02-10 22:35:02 +01:00
|
|
|
}
|