Advertisement
Soty89

summary

Sep 24th, 2021
1,118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.   const typePage = data?.type;
  3.   const title = data?.title;
  4.   const indicators = data?.indicators;
  5.   const indicator = data?.indicator;
  6.   const httpStatus = data?.httpStatus;
  7.   const umbrellaRank = data?.umbrellaRank;
  8.   const redirectTo = data?.redirectTo;
  9.   const redirectFrom = data?.redirectFrom;
  10.   const geo = data?.geo;
  11.   const reg = data?.reg;
  12.   const ssl = data?.sslDomains.map((certificate) => certificate.value);
  13.   const risk = data?.risk;
  14.   const riskFactors = data?.riskFactors?.map((riskFactor) => `- ${riskFactor?.description}`);
  15.   const typeData = data?.typeData;
  16.   const location = data?.location;
  17.  
  18.   const renderHeader = () => {
  19.     const riskDescription = {
  20.       none: 'Very low risk',
  21.       low: 'Low risk',
  22.       medium: 'Medium risk',
  23.       critical: 'Critical risk',
  24.       unknown: 'Unknown risk',
  25.       high: 'High risk',
  26.     };
  27.     const regText = (reg?.registrant && reg?.email && `${reg.registrant} - ${reg.email}\n`) || '';
  28.     const sslCertificateText = (ssl?.length && `SSL certificate found for: ${ssl.join(', ')}\n`) || '';
  29.     const code = geo?.countryCode === 'US' ? geo?.region : geo?.countryCode;
  30.     const geoText = (geo?.countryCode && `${code}, ${geo?.org}\n`) || '';
  31.     const riskText = `- ${riskDescription[risk] || 'unknown'}`;
  32.     const riskFactorsText = riskFactors?.join('\n');
  33.     const linkText = `More info: ${location}`;
  34.     const umbrellaRankText = (umbrellaRank && `#${umbrellaRank} on Cisco Umbrella top million\n`) || '';
  35.     const copyText = `${title} \n${umbrellaRankText}${sslCertificateText}${regText}${geoText}\nLMNTRIX  risk evaluation below:\n${riskText}\nRisk is based on the following factors:\n${riskFactorsText}\n\n${linkText}`;
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement