2017-02-10 22:35:02 +01:00
|
|
|
"""STIX 2 Common Data Types and Properties"""
|
|
|
|
|
|
|
|
from .base import _STIXBase
|
2017-04-11 21:05:22 +02:00
|
|
|
from .properties import (Property, ListProperty, StringProperty, BooleanProperty,
|
|
|
|
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-03-22 01:06:09 +01:00
|
|
|
'external_references': Property(),
|
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-03-31 21:52:27 +02:00
|
|
|
'granular_markings': ListProperty(Property)
|
2017-02-10 22:35:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class ExternalReference(_STIXBase):
|
|
|
|
_properties = {
|
2017-04-17 20:15:01 +02:00
|
|
|
'source_name': StringProperty(required=True),
|
|
|
|
'description': StringProperty(),
|
|
|
|
'url': StringProperty(),
|
|
|
|
'external_id': StringProperty(),
|
2017-02-10 22:35:02 +01:00
|
|
|
}
|
2017-02-22 16:06:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
class KillChainPhase(_STIXBase):
|
|
|
|
_properties = {
|
2017-04-07 23:34:06 +02:00
|
|
|
'kill_chain_name': StringProperty(required=True),
|
|
|
|
'phase_name': StringProperty(required=True),
|
2017-02-22 16:06:35 +01:00
|
|
|
}
|