The following example describes how to use the STIX file parser functionality.

from cbc_importer.stix_parsers.v1.parser import STIX1Parser
from cbc_importer.stix_parsers.v2.parser import STIX2Parser

from cbc_sdk import CBCloudAPI

cbcsdk = CBCloudAPI(profile="default")

# Initializing the STIX1 Parser
stix_parser_v1 = STIX1Parser(cbcsdk)
stix_parser_v1.parse_file("./stix_data.xml")

# Initializing the STIX2 Parser
stix_parser_v2 = STIX2Parser(cbcsdk)
stix_parser_v2.parse_file("./stix_data.json")

iocs_v1 = stix_parser_v1.iocs
iocs_v2 = stix_parser_v2.iocs