colander_data_converter.converters.stix2.models

class colander_data_converter.converters.stix2.models.File[source]

Bases: Stix2ObjectBase

Config:
  • str_strip_whitespace: bool = True

  • arbitrary_types_allowed: bool = True

  • extra: str = allow

Fields:
field id: str [Optional]
field type: Literal['file'] = 'file'
field name: str [Required]
class colander_data_converter.converters.stix2.models.Identity[source]

Bases: Stix2ObjectBase

Config:
  • str_strip_whitespace: bool = True

  • arbitrary_types_allowed: bool = True

  • extra: str = allow

Fields:
field id: str [Optional]
field type: Literal['identity'] = 'identity'
field name: str [Required]
field identity_class: str = ''
class colander_data_converter.converters.stix2.models.Indicator[source]

Bases: Stix2ObjectBase

Config:
  • str_strip_whitespace: bool = True

  • arbitrary_types_allowed: bool = True

  • extra: str = allow

Fields:
field id: str [Optional]
field type: Literal['indicator'] = 'indicator'
field name: str [Required]
field pattern: str = ''
field pattern_type: str = 'stix'
class colander_data_converter.converters.stix2.models.Infrastructure[source]

Bases: Stix2ObjectBase

Config:
  • str_strip_whitespace: bool = True

  • arbitrary_types_allowed: bool = True

  • extra: str = allow

Fields:
field id: str [Optional]
field type: Literal['infrastructure'] = 'infrastructure'
field name: str [Required]
field infrastructure_types: List[str] = []
class colander_data_converter.converters.stix2.models.Malware[source]

Bases: Stix2ObjectBase

Config:
  • str_strip_whitespace: bool = True

  • arbitrary_types_allowed: bool = True

  • extra: str = allow

Fields:
field id: str [Optional]
field type: Literal['malware'] = 'malware'
field name: str [Required]
field malware_types: List[str] = []
class colander_data_converter.converters.stix2.models.Relationship[source]

Bases: Stix2ObjectBase

Config:
  • str_strip_whitespace: bool = True

  • arbitrary_types_allowed: bool = True

  • extra: str = allow

Fields:
field id: str [Optional]
field type: Literal['relationship'] = 'relationship'
field relationship_type: str = ''
field source_ref: str [Required]
field target_ref: str [Required]
class colander_data_converter.converters.stix2.models.Stix2Bundle[source]

Bases: BaseModel

Fields:
field id: str [Optional]
field type: Literal['bundle'] = 'bundle'
field spec_version: Literal['2.1'] = '2.1'
field objects: List[Annotated[File | Indicator | Infrastructure | Identity | Malware | ThreatActor | Relationship, FieldInfo(annotation=NoneType, required=True, discriminator='type')]] = []
by_type(object_type)[source]
Return type:

Generator[Stix2Object_T, None, None]

by_id(obj_id)[source]
Return type:

Stix2Object_T | None

static load(raw_object)[source]
Return type:

Stix2Bundle

class colander_data_converter.converters.stix2.models.Stix2ObjectBase[source]

Bases: BaseModel

Config:
  • str_strip_whitespace: bool = True

  • arbitrary_types_allowed: bool = True

  • extra: str = allow

Fields:
field type: str [Required]
field created: str = '2025-08-10T18:48:34.713033+00:00'
field modified: str = '2025-08-10T18:48:34.713064+00:00'
field description: str | None = None
model_post_init(_Stix2ObjectBase__context)[source]

Executes post-initialization logic for the model, ensuring the repository registers the current subclass instance.

Parameters:

__context (Any) – Additional context provided for post-initialization handling.

classmethod subclasses()[source]
Return type:

Dict[str, Type[Stix2ObjectBase]]

classmethod get_supported_types()[source]
Return type:

List[str]

classmethod get_model_class(type_name)[source]
Return type:

Type[Stix2ObjectBase] | None

class colander_data_converter.converters.stix2.models.Stix2Repository(*args, **kwargs)[source]

Bases: object

Singleton repository for managing and storing STIX2 objects.

This class provides centralized storage and reference management for all STIX2 objects, supporting conversion to and from Colander data.

__init__()[source]

Initializes the repository with an empty dictionary for STIX2 objects.

__lshift__(stix2_object)[source]

Adds a STIX2 object to the repository.

Parameters:

stix2_object (Dict[str, Any]) – The STIX2 object to add.

__rshift__(object_id)[source]

Retrieves a STIX2 object from the repository by its ID.

Parameters:

object_id (str) – The ID of the STIX2 object to retrieve.

Returns:

The STIX2 object if found, None otherwise.

Return type:

Optional[Dict[str, Any]]

clear()[source]

Clears all STIX2 objects from the repository.

stix2_objects: Dict[str, Annotated[File | Indicator | Infrastructure | Identity | Malware | ThreatActor | Relationship, FieldInfo(annotation=NoneType, required=True, discriminator='type')]]
class colander_data_converter.converters.stix2.models.ThreatActor[source]

Bases: Stix2ObjectBase

Config:
  • str_strip_whitespace: bool = True

  • arbitrary_types_allowed: bool = True

  • extra: str = allow

Fields:
field id: str [Optional]
field type: Literal['threat-actor'] = 'threat-actor'
field name: str [Required]
field threat_actor_types: List[str] = []