threatbus/src/connector.py
def _send_to_threatbus(self, indicator: Indicator):
        """
        Sends a STIX-2 Indicator to Threat Bus. Requires the ZeroMQ App plugin
        to be installed and configured to accept data on the same port that this
        connector is instructed to use via its `config.yaml` file.
        @param indicator The STIX-2 indicator to send
        """
        socket = zmq.Context().socket(zmq.PUB)
        socket.connect(
            f"tcp://{self.threatbus_zmq_host}:{self.threatbus_zmq_receive_port}"
        )
        encoded = indicator.serialize()
        socket.send_string(f"stix2/indicator {encoded}")
        self.helper.log_info(f"Sending: {encoded}")

        Sends a STIX-2 Indicator to Threat Bus. Requires the ZeroMQ App plugin
        to be installed and configured to accept data on the same port that this
        connector is instructed to use via its `config.yaml` file.
        @param indicator The STIX-2 indicator to send
        
Sends a STIX-2 Indicator to Threat Bus. Requires the ZeroMQ App plugin
to be installed and configured to accept data on the same port that this
connector is instructed to use via its `config.yaml` file.
@param indicator The STIX-2 indicator to send
Sends a STIX - 2 Indicator to Threat Bus . Requires the ZeroMQ App plugin to be installed and configured to accept data on the same port that this connector is instructed to use via its ` config . yaml ` file . @param indicator The STIX - 2 indicator to send
def _send_to_threatbus(self, indicator: Indicator):
        socket = zmq.Context().socket(zmq.PUB)
        socket.connect(
            f"tcp://{self.threatbus_zmq_host}:{self.threatbus_zmq_receive_port}"
        )
        encoded = indicator.serialize()
        socket.send_string(f"stix2/indicator {encoded}")
        self.helper.log_info(f"Sending: {encoded}")
def _send_to_threatbus ( self , indicator : Indicator ) : socket = zmq . Context ( ) . socket ( zmq . PUB ) socket . connect ( f"tcp://{self.threatbus_zmq_host}:{self.threatbus_zmq_receive_port}" ) encoded = indicator . serialize ( ) socket . send_string ( f"stix2/indicator {encoded}" ) self . helper . log_info ( f"Sending: {encoded}" )
Sends a STIX-2 Indicator to Threat Bus.
Sends a STIX - 2 Indicator to Threat Bus .
"""
        Sends a STIX-2 Indicator to Threat Bus. Requires the ZeroMQ App plugin
        to be installed and configured to accept data on the same port that this
        connector is instructed to use via its `config.yaml` file.
        @param indicator The STIX-2 indicator to send
        """
self
indicator
Indicator