Exemple #1
0
    def _ProcessGrrMessage(self, fs_msg):
        """Process a FS message when message_type is GrrMessage."""
        grr_id = fleetspeak_utils.FleetspeakIDToGRRID(fs_msg.source.client_id)

        msg = rdf_flows.GrrMessage.FromSerializedString(fs_msg.data.value)
        msg.source = grr_id

        # Fleetspeak ensures authentication.
        msg.auth_state = rdf_flows.GrrMessage.AuthorizationState.AUTHENTICATED

        self.frontend.EnrolFleetspeakClient(client_id=grr_id)
        self.frontend.ReceiveMessages(client_id=grr_id, messages=[msg])
Exemple #2
0
    def _ProcessMessageList(self, fs_msg):
        """Process a FS message when message_type is MessageList."""
        grr_id = fleetspeak_utils.FleetspeakIDToGRRID(fs_msg.source.client_id)

        msg_list = rdf_flows.PackedMessageList.FromSerializedString(
            fs_msg.data.value)
        msg_list = communicator.Communicator.DecompressMessageList(msg_list)

        for msg in msg_list.job:
            msg.source = grr_id
            msg.auth_state = rdf_flows.GrrMessage.AuthorizationState.AUTHENTICATED

        self.frontend.EnrolFleetspeakClient(client_id=grr_id)
        self.frontend.ReceiveMessages(client_id=grr_id, messages=msg_list.job)