colander_data_converter.converters.stix2.mapping

class colander_data_converter.converters.stix2.mapping.Stix2MappingLoader[source]

Bases: object

Loads and provides access to the STIX2 to Colander mapping data.

__init__()[source]

Initialize the mapping loader.

get_actor_mapping(actor_type)[source]
Return type:

Dict[str, Any]

get_colander_to_stix2_field_mapping(entity_type)[source]
Return type:

Dict[str, str]

get_device_mapping(device_type)[source]
Return type:

Dict[str, Any]

get_entity_extra_values(entity_type, entity_subtype)[source]
Return type:

Dict[str, Any]

get_entity_subtype_mapping(entity_type, entity_subtype)[source]

Get the mapping data for a specific Colander entity type.

Parameters:
  • entity_type (str) – The entity type (e.g., “actor”, “device”).

  • entity_subtype (str) – The Colander entity subtype (e.g. “ipv4”).

Returns:

The mapping data for the entity type.

Return type:

Dict[str, Any]

get_entity_type_for_stix2(stix2_type)[source]

Get the Colander entity type for a STIX2 type (e.g. “indicator”, “threat-actor”).

Parameters:

stix2_type (str) – The STIX2 type.

Returns:

The corresponding Colander type and the list of subtype candidates, or None if not found.

Return type:

Tuple[Optional[str], Optional[List[str]]]

get_entity_type_mapping(entity_type)[source]

Get the mapping data for a specific Colander entity type.

Parameters:

entity_type (str) – The entity type (e.g., “actor”, “device”).

Returns:

The mapping data for the entity type.

Return type:

Dict[str, Any]

get_field_relationship_mapping()[source]
Return type:

Dict[str, str]

get_malware_types_for_threat(threat_type)[source]
Return type:

List[str]

get_observable_mapping(observable_type)[source]
Return type:

Dict[str, Any]

get_observable_pattern(observable_type)[source]
Return type:

str

get_stix2_to_colander_field_mapping(entity_type)[source]

Get the field mapping from STIX2 to Colander for a specific entity type.

Parameters:

entity_type (str) – The entity type.

Returns:

The field mapping from STIX2 to Colander.

Return type:

Dict[str, str]

get_stix2_type_for_entity(entity)[source]
Return type:

str

get_supported_colander_types()[source]
Return type:

List[str]

get_supported_stix2_types()[source]
Return type:

List[str]

get_threat_mapping(threat_type)[source]
Return type:

Dict[str, Any]