backend/src/lib/report-generator.js
// For each finding, add cvssColor, cvssObj and criteria colors parameters
For each finding, add cvssColor, cvssObj and criteria colors parameters
For each finding add cvssColor cvssObj and criteria colors parameters
function cvssHandle(data) {
    var noneColor = "4A86E8"; 
    var lowColor = "008000"; 
    var mediumColor = "f9a009"; 
    var highColor = "fe0000"; 
    var criticalColor = "212121"; 
    var cellNoneColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="' + noneColor + '"/></w:tcPr>';
    var cellLowColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="'+lowColor+'"/></w:tcPr>';
    var cellMediumColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="'+mediumColor+'"/></w:tcPr>';
    var cellHighColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="'+highColor+'"/></w:tcPr>';
    var cellCriticalColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="'+criticalColor+'"/></w:tcPr>';
    if (data.findings) {
        for (var i=0; i<data.findings.length; i++) {
            if (data.findings[i].cvssSeverity === "Low") { data.findings[i].cvssColor = cellLowColor}
            else if (data.findings[i].cvssSeverity === "Medium") { data.findings[i].cvssColor = cellMediumColor}
            else if (data.findings[i].cvssSeverity === "High") { data.findings[i].cvssColor = cellHighColor}
            else if (data.findings[i].cvssSeverity === "Critical") { data.findings[i].cvssColor = cellCriticalColor}
            else { data.findings[i].cvssColor = cellNoneColor} ;
            var cvssObj = cvssStrToObject(data.findings[i].cvssv3);
            data.findings[i].cvssObj = cvssObj;
         }
    }
}
function cvssHandle ( data ) { var noneColor = "4A86E8" ; var lowColor = "008000" ; var mediumColor = "f9a009" ; var highColor = "fe0000" ; var criticalColor = "212121" ; var cellNoneColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="' + noneColor + '"/></w:tcPr>' ; var cellLowColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="' + lowColor + '"/></w:tcPr>' ; var cellMediumColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="' + mediumColor + '"/></w:tcPr>' ; var cellHighColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="' + highColor + '"/></w:tcPr>' ; var cellCriticalColor = '<w:tcPr><w:shd w:val="clear" w:color="auto" w:fill="' + criticalColor + '"/></w:tcPr>' ; if ( data . findings ) { for ( var i = 0 ; i < data . findings . length ; i ++ ) { if ( data . findings [ i ] . cvssSeverity === "Low" ) { data . findings [ i ] . cvssColor = cellLowColor } else if ( data . findings [ i ] . cvssSeverity === "Medium" ) { data . findings [ i ] . cvssColor = cellMediumColor } else if ( data . findings [ i ] . cvssSeverity === "High" ) { data . findings [ i ] . cvssColor = cellHighColor } else if ( data . findings [ i ] . cvssSeverity === "Critical" ) { data . findings [ i ] . cvssColor = cellCriticalColor } else { data . findings [ i ] . cvssColor = cellNoneColor } ; var cvssObj = cvssStrToObject ( data . findings [ i ] . cvssv3 ) ; data . findings [ i ] . cvssObj = cvssObj ; } } }
For each finding, add cvssColor, cvssObj and criteria colors parameters
For each finding add cvssColor cvssObj and criteria colors parameters
// Header title colors //blue //green //yellow //red //black // Global CVSS color depending on Severity // Convert CVSS string to object in cvssObj parameter