2017-02-10 22:35:02 +01:00
|
|
|
"""STIX 2 Common Data Types and Properties"""
|
|
|
|
|
2017-08-11 21:11:54 +02:00
|
|
|
from collections import OrderedDict
|
|
|
|
|
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,
|
2017-05-15 16:57:40 +02:00
|
|
|
StringProperty, TimestampProperty)
|
2017-02-10 22:35:02 +01:00
|
|
|
from .utils import NOW
|
|
|
|
|
2017-08-11 21:11:54 +02:00
|
|
|
COMMON_PROPERTIES = OrderedDict()
|
|
|
|
|
|
|
|
COMMON_PROPERTIES.update([
|
2017-02-24 17:46:21 +01:00
|
|
|
# 'type' and 'id' should be defined on each individual type
|
2017-08-11 21:11:54 +02:00
|
|
|
('created_by_ref', ReferenceProperty(type="identity")),
|
|
|
|
('created', TimestampProperty(default=lambda: NOW, precision='millisecond')),
|
|
|
|
('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
|
|
|
|
('revoked', BooleanProperty()),
|
|
|
|
('labels', ListProperty(StringProperty)),
|
|
|
|
('external_references', ListProperty(ExternalReference)),
|
|
|
|
('object_marking_refs', ListProperty(ReferenceProperty(type="marking-definition"))),
|
|
|
|
('granular_markings', ListProperty(GranularMarking)),
|
|
|
|
])
|