Esempio n. 1
0
    def process(self):

        event = self.receive_message()

        for key in ['source_','destination_']:
            if event.contains(key + "ip"):
                ip = event.value(key + "ip")
                email = Abusix.query(ip)
                if email:
                    event.add(key + "abuse_contact", email)

        self.send_message(event)
        self.acknowledge_message()
Esempio n. 2
0
    def process(self):
        event = self.receive_message()

        if event is None:
            self.acknowledge_message()
            return

        for key in ['source.', 'destination.']:
            ip_key = key + "ip"
            if event.contains(ip_key):
                ip = event.value(ip_key)
                email = Abusix.query(ip)
                if email:
                    abuse_contact_key = key + "abuse_contact"
                    event.add(abuse_contact_key, email)

        self.send_message(event)
        self.acknowledge_message()