(self, domain, ip, scandate)
Add domain to CRITs.

        Args:
            domain (str): pcap data
            scandate (str): scan date from when domain is believed to be
            collected.

        TODO:
            handle IP
Add domain to CRITs.
Add domain to CRITs .
def _process_domain(self, domain, ip, scandate):
        """
        Add domain to CRITs.

        Args:
            domain (str): pcap data
            scandate (str): scan date from when domain is believed to be
            collected.

        TODO:
            handle IP
        """

        self._info("Adding domain %s and creating relationship to %s" % (str(domain), str(self.obj.id)))
        self._notify()

        result = upsert_domain(domain,
                               self.obj.source,
                               username=self.current_task.user.username,
                               campaign=None,
                               confidence=None,
                               bucket_list=None,
                               ticket=None)

        # If domain was added, create relationship.
        if not result['success']:
            self._info("Cannot add domain %s. reason: %s" % (str(domain), str(result['message'])))
        else:
            # add relationship
            dmain = result['object']

            msg = dmain.add_relationship(rel_item=self.obj,
                                         rel_type=RelationshipTypes.RELATED_TO,
                                         rel_date=scandate,
                                         analyst=self.current_task.user,
                                         rel_confidence='unknown',
                                         rel_reason='Provided by VirusTotal. Date is from when vt analysis was performed',
                                         get_rels=False)

            if not msg['success']:
                self._info("Cannot add relationship because %s" % (str(msg['message'])))

            dmain.save(username=self.current_task.user.username)
            self.obj.save(username=self.current_task.user.username)
def _process_domain ( self , domain , ip , scandate ) : self . _info ( "Adding domain %s and creating relationship to %s" % ( str ( domain ) , str ( self . obj . id ) ) ) self . _notify ( ) result = upsert_domain ( domain , self . obj . source , username = self . current_task . user . username , campaign = None , confidence = None , bucket_list = None , ticket = None ) # If domain was added, create relationship. if not result [ 'success' ] : self . _info ( "Cannot add domain %s. reason: %s" % ( str ( domain ) , str ( result [ 'message' ] ) ) ) else : # add relationship dmain = result [ 'object' ] msg = dmain . add_relationship ( rel_item = self . obj , rel_type = RelationshipTypes . RELATED_TO , rel_date = scandate , analyst = self . current_task . user , rel_confidence = 'unknown' , rel_reason = 'Provided by VirusTotal. Date is from when vt analysis was performed' , get_rels = False ) if not msg [ 'success' ] : self . _info ( "Cannot add relationship because %s" % ( str ( msg [ 'message' ] ) ) ) dmain . save ( username = self . current_task . user . username ) self . obj . save ( username = self . current_task . user . username )