2017-02-10 22:35:02 +01:00
|
|
|
"""STIX 2 Common Data Types and Properties"""
|
|
|
|
|
|
|
|
from .base import _STIXBase
|
2017-03-22 00:44:01 +01:00
|
|
|
from .properties import Property, BooleanProperty, ReferenceProperty
|
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-03-22 01:15:06 +01:00
|
|
|
'created': Property(default=lambda: NOW),
|
|
|
|
'modified': Property(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-22 00:44:01 +01:00
|
|
|
'created_by_ref': ReferenceProperty(),
|
2017-03-22 01:20:05 +01:00
|
|
|
# TODO:
|
|
|
|
# - object_marking_refs
|
|
|
|
# - granular_markings
|
2017-02-10 22:35:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class ExternalReference(_STIXBase):
|
|
|
|
_properties = {
|
2017-02-24 20:07:54 +01:00
|
|
|
'source_name': Property(required=True),
|
|
|
|
'description': Property(),
|
|
|
|
'url': Property(),
|
|
|
|
'external_id': Property(),
|
2017-02-10 22:35:02 +01:00
|
|
|
}
|
2017-02-22 16:06:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
class KillChainPhase(_STIXBase):
|
|
|
|
_properties = {
|
2017-03-22 01:06:09 +01:00
|
|
|
'kill_chain_name': Property(required=True),
|
|
|
|
'phase_name': Property(required=True),
|
2017-02-22 16:06:35 +01:00
|
|
|
}
|