This repository was archived by the owner on Dec 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 99config = yaml .load (open (os .path .dirname (__file__ ) + '/../config.yml' ))
1010
1111# File to import
12- file_to_import = '/home/oxid/Dropbox/Developpement/Associations/Luatix/Produits/OpenCTI/cti/enterprise-attack /enterprise-attack.json'
12+ file_to_import = '. /enterprise-attack.json'
1313
1414# OpenCTI initialization
1515opencti_api_client = OpenCTIApiClient (config ['opencti' ]['url' ], config ['opencti' ]['token' ])
Original file line number Diff line number Diff line change @@ -71,22 +71,24 @@ def _reconnect(self):
7171 self .connection = self ._connect ()
7272 self .channel = self ._create_channel ()
7373
74- def send_stix2_bundle (self , bundle ):
74+ def send_stix2_bundle (self , bundle , entities_types = [] ):
7575 """
7676 This method send a STIX2 bundle to RabbitMQ to be consumed by workers
7777 :param bundle: A valid STIX2 bundle
78+ :param entities_types: Entities types to ingest
7879 """
7980 if not self .channel .is_open :
8081 self ._reconnect ()
8182
8283 # Validate the STIX 2 bundle
83- #validation = validate_string(bundle)
84- #if not validation.is_valid:
85- # raise ValueError('The bundle is not a valid STIX2 JSON:' + bundle)
84+ # validation = validate_string(bundle)
85+ # if not validation.is_valid:
86+ # raise ValueError('The bundle is not a valid STIX2 JSON:' + bundle)
8687
8788 # Prepare the message
8889 message = {
8990 'type' : 'stix2-bundle' ,
91+ 'entities_types' : entities_types ,
9092 'content' : base64 .b64encode (bundle .encode ('utf-8' )).decode ('utf-8' )
9193 }
9294
You can’t perform that action at this time.
0 commit comments