async def get_malware_data(
        self, threat_id, malware_url, session: aiohttp.ClientSession, proxy_data
    ):
        """Get malware data from cofense and add download urls.

        Args:
            threat_id (str): threat_id
            malware_url (str): get malware data url to fetch the data from cofense
            session (aiohttp.ClientSession): aiohttp session object to make api calls.

        Returns:
            dict: malware data
        """
        __method_name = inspect.currentframe().f_code.co_name
        try:
            final_url = malware_url.format(threat_id=threat_id)
            retry_count_429 = 0
            retry_count_401 = 0
            while retry_count_429 <= 1 and retry_count_401 <= 1:
                response = await session.get(
                    url=final_url,
                    auth=aiohttp.BasicAuth(
                        consts.COFENSE_USERNAME, consts.COFENSE_PASSWORD
                    ),
                    proxy=proxy_data["proxy_url"],
                    proxy_auth=proxy_data["proxy_auth"],
                )
                get_malware_status_code = response.status
                if get_malware_status_code >= 200 and get_malware_status_code <= 299:
                    applogger.info(
                        "{}(method={}) : {} : Fetched malware successfully for :{}.".format(
                            consts.LOGS_STARTS_WITH,
                            __method_name,
                            consts.COFENSE_MALWARE_DATA_TO_LOG_ANALYTICS,
                            threat_id,
                        )
                    )
                    json_response = await response.json()
                    malware_data = json_response.get("data", {})
                    html_report_url = malware_data.get("apiReportURL", "")
                    url = html_report_url.rsplit("/", 1)
                    malware_data[
                        "ReportDownload(HTML)"
                    ] = "https://{}.azurewebsites.net/api/DownloadThreatReports?url={}/html".format(
                        consts.FUNCTION_APP_NAME, url[0]
                    )
                    malware_data[
                        "ReportDownload(PDF)"
                    ] = "https://{}.azurewebsites.net/api/DownloadThreatReports?url={}/pdf".format(
                        consts.FUNCTION_APP_NAME, url[0]
                    )
                    return malware_data
                elif get_malware_status_code == 401:
                    applogger.error(
                        "{}(method={}) : {} : Authentication Error, Status:401, trying again.".format(
                            consts.LOGS_STARTS_WITH,
                            __method_name,
                            consts.COFENSE_MALWARE_DATA_TO_LOG_ANALYTICS,
                        )
                    )

                    retry_count_401 += 1
                elif get_malware_status_code == 429:
                    applogger.error(
                        "{}(method={}) : {} : Rate Limit Error, Status_Code:429,trying again.".format(
                            consts.LOGS_STARTS_WITH,
                            __method_name,
                            consts.COFENSE_MALWARE_DATA_TO_LOG_ANALYTICS,
                        )
                    )
                    retry_count_429 += 1
                    time.sleep(consts.COFENSE_429_SLEEP)
                else:
                    applogger.error(
                        "{}(method={}) : {} : url: {}, Status Code : {}."
                        " while pulling Malware data.".format(
                            consts.LOGS_STARTS_WITH,
                            __method_name,
                            consts.COFENSE_MALWARE_DATA_TO_LOG_ANALYTICS,
                            url,
                            get_malware_status_code,
                        )
                    )
                    raise CofenseIntelligenceException()
            raise CofenseIntelligenceException()
        except CofenseIntelligenceException as cofense_error:
            applogger.error(
                "{}(method={}) : {} : error occured while fetching malware data : {}.".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.COFENSE_MALWARE_DATA_TO_LOG_ANALYTICS,
                    cofense_error,
                )
            )
            raise CofenseIntelligenceException()

        except Exception as error:
            applogger.error(
                "{}(method={}) : {} : error occured while fetching malware data : {}.".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.COFENSE_MALWARE_DATA_TO_LOG_ANALYTICS,
                    error,
                )
            )
            raise CofenseIntelligenceException()
Get malware data from cofense and add download urls.

        Args:
            threat_id (str): threat_id
            malware_url (str): get malware data url to fetch the data from cofense
            session (aiohttp.ClientSession): aiohttp session object to make api calls.

        Returns:
            dict: malware data
        
Solutions/CofenseIntelligence/Data Connectors/CofenseIntelligenceDataConnector/CofenseIntelligenceMalware/cofense_malware_data_to_sentinel.py