(self, report)
return status
Process public key ip data from VirusTotal.

        Args:
            report (dict): json report information

        Return: dict with keys:
            'success' (boolean),
            'message' (str),
Process public key ip data from VirusTotal.
Process public key ip data from VirusTotal .
def _process_public_ip(self, report):
        """
        Process public key ip data from VirusTotal.

        Args:
            report (dict): json report information

        Return: dict with keys:
            'success' (boolean),
            'message' (str),
        """
        status = {
            'success':  False,
            'message':  []
        }

        detected_urls = report.get('detected_urls', [])
        if detected_urls:
            for url in detected_urls:
                stats = {
                          'scan_date': url.get('scan_date', ''),
                          'total': url.get('total', 0),
                          'positives': url.get('positives', 0)
                        }
                self._add_result('Detected URLs', url.get('url', ''), stats)
        else:
            status['message'].append("Detected URL information not included in VT response.")

        resolutions = report.get('resolutions', [])
        if resolutions:
            for resolution in resolutions:
                stats = {
                          'last_resolved': resolution.get('last_resolved', ''),
                        }
                self._add_result('Resolutions', resolution.get('hostname', ''), stats)
        else:
           status['message'].append("Resolution information not included in VT response.")

        detected_communicating_samples = report.get('detected_communicating_samples', [])
        if detected_communicating_samples:
            for samp in detected_communicating_samples:
                stats = {
                          'date': samp.get('date', ''),
                          'total': samp.get('total', 0),
                          'positives': samp.get('positives', 0)
                        }
                self._add_result('Detected Communicating Samples', samp.get('sha256', ''), stats)
        else:
            status['message'].append("Detected communicating sample information not included in VT response.")

        undetected_communicating_samples = report.get('undetected_communicating_samples', [])
        if undetected_communicating_samples:
            for samp in undetected_communicating_samples:
                stats = {
                          'date': samp.get('date', ''),
                          'total': samp.get('total', 0),
                          'positives': samp.get('positives', 0)
                        }
                self._add_result('Undetected Communicating Samples', samp.get('sha256', ''), stats)
        else:
            status['message'].append("Undetected communicating sample information not included in VT response.")

        detected_downloaded_samples = report.get('detected_downloaded_samples', [])
        if detected_downloaded_samples:
            for samp in detected_downloaded_samples:
                stats = {
                          'date': samp.get('date', ''),
                          'total': samp.get('total', 0),
                          'positives': samp.get('positives', 0)
                        }
                self._add_result('Detected Downloaded Samples', samp.get('sha256', ''), stats)
        else:
            status['message'].append("Detected downloaded sample information not included in VT response.")

        undetected_downloaded_samples = report.get('undetected_downloaded_samples', [])
        if undetected_downloaded_samples:
            for samp in undetected_downloaded_samples:
                stats = {
                          'date': samp.get('date', ''),
                          'total': samp.get('total', 0),
                          'positives': samp.get('positives', 0)
                        }
                self._add_result('Undetected Downloaded Samples', samp.get('sha256', ''), stats)
        else:
            status['message'].append("Undetected downloaded sample information not included in VT response.")

        # Updating status information and returning
        if not status['message']:
            status['success'] =  True
            status['message'] = "Processed public ip information."
        else:
            status['message'] = "\n".join(status['message'])

        return status
def _process_public_ip ( self , report ) : status = { 'success' : False , 'message' : [ ] } detected_urls = report . get ( 'detected_urls' , [ ] ) if detected_urls : for url in detected_urls : stats = { 'scan_date' : url . get ( 'scan_date' , '' ) , 'total' : url . get ( 'total' , 0 ) , 'positives' : url . get ( 'positives' , 0 ) } self . _add_result ( 'Detected URLs' , url . get ( 'url' , '' ) , stats ) else : status [ 'message' ] . append ( "Detected URL information not included in VT response." ) resolutions = report . get ( 'resolutions' , [ ] ) if resolutions : for resolution in resolutions : stats = { 'last_resolved' : resolution . get ( 'last_resolved' , '' ) , } self . _add_result ( 'Resolutions' , resolution . get ( 'hostname' , '' ) , stats ) else : status [ 'message' ] . append ( "Resolution information not included in VT response." ) detected_communicating_samples = report . get ( 'detected_communicating_samples' , [ ] ) if detected_communicating_samples : for samp in detected_communicating_samples : stats = { 'date' : samp . get ( 'date' , '' ) , 'total' : samp . get ( 'total' , 0 ) , 'positives' : samp . get ( 'positives' , 0 ) } self . _add_result ( 'Detected Communicating Samples' , samp . get ( 'sha256' , '' ) , stats ) else : status [ 'message' ] . append ( "Detected communicating sample information not included in VT response." ) undetected_communicating_samples = report . get ( 'undetected_communicating_samples' , [ ] ) if undetected_communicating_samples : for samp in undetected_communicating_samples : stats = { 'date' : samp . get ( 'date' , '' ) , 'total' : samp . get ( 'total' , 0 ) , 'positives' : samp . get ( 'positives' , 0 ) } self . _add_result ( 'Undetected Communicating Samples' , samp . get ( 'sha256' , '' ) , stats ) else : status [ 'message' ] . append ( "Undetected communicating sample information not included in VT response." ) detected_downloaded_samples = report . get ( 'detected_downloaded_samples' , [ ] ) if detected_downloaded_samples : for samp in detected_downloaded_samples : stats = { 'date' : samp . get ( 'date' , '' ) , 'total' : samp . get ( 'total' , 0 ) , 'positives' : samp . get ( 'positives' , 0 ) } self . _add_result ( 'Detected Downloaded Samples' , samp . get ( 'sha256' , '' ) , stats ) else : status [ 'message' ] . append ( "Detected downloaded sample information not included in VT response." ) undetected_downloaded_samples = report . get ( 'undetected_downloaded_samples' , [ ] ) if undetected_downloaded_samples : for samp in undetected_downloaded_samples : stats = { 'date' : samp . get ( 'date' , '' ) , 'total' : samp . get ( 'total' , 0 ) , 'positives' : samp . get ( 'positives' , 0 ) } self . _add_result ( 'Undetected Downloaded Samples' , samp . get ( 'sha256' , '' ) , stats ) else : status [ 'message' ] . append ( "Undetected downloaded sample information not included in VT response." ) # Updating status information and returning if not status [ 'message' ] : status [ 'success' ] = True status [ 'message' ] = "Processed public ip information." else : status [ 'message' ] = "\n" . join ( status [ 'message' ] ) return status