Better handling of defcon1
This commit is contained in:
parent
821b09daaf
commit
a941b26a2d
7 changed files with 21 additions and 7 deletions
|
@ -113,3 +113,8 @@
|
|||
.image-feature-view-element .vuln-summary i.fa {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.image-feature-view-element .defcon1 {
|
||||
background-color: #FF8181;
|
||||
color: white;
|
||||
}
|
||||
|
|
|
@ -193,3 +193,8 @@
|
|||
margin-left: 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.image-vulnerability-view-element .defcon1 {
|
||||
background-color: #FF8181;
|
||||
color: white;
|
||||
}
|
|
@ -92,7 +92,7 @@
|
|||
<td class="hidden-xs options-col"></td>
|
||||
</thead>
|
||||
<tbody ng-repeat="feature in orderedFeatures.visibleEntries" bindonce>
|
||||
<tr>
|
||||
<tr ng-class="feature.primarySeverity.index == 0 ? 'defcon1' : ''">
|
||||
<td class="single-col">
|
||||
<span bo-text="feature.name"></span>
|
||||
</td>
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
<td class="hidden-xs options-col"></td>
|
||||
</thead>
|
||||
<tbody ng-repeat="vuln in orderedVulnerabilities.visibleEntries" bindonce>
|
||||
<tr>
|
||||
<tr ng-class="vuln.severityInfo.index == 0 ? 'defcon1' : ''">
|
||||
<td class="caret-col">
|
||||
<span ng-click="toggleDetails(vuln)">
|
||||
<i class="fa"
|
||||
|
|
|
@ -28,11 +28,15 @@ angular.module('quay').directive('imageVulnerabilityView', function () {
|
|||
};
|
||||
|
||||
$scope.getDistro = function(vuln) {
|
||||
if (vuln['severity'] == 'Defcon 1') {
|
||||
return 'the Quay Engineering Team';
|
||||
}
|
||||
|
||||
return vuln['namespace'].split(':', 1);
|
||||
};
|
||||
|
||||
$scope.getSeverityTooltip = function(vuln) {
|
||||
var distro = vuln['namespace'].split(':', 1);
|
||||
var distro = $scope.getDistro(vuln);
|
||||
|
||||
if (vuln.scoreDivergence != 'adjusted-lower') {
|
||||
return 'Marked with a ' + vuln['severity'] + ' severity by ' + distro;
|
||||
|
|
|
@ -47,7 +47,7 @@ angular.module('quay').factory('ImageMetadataService', ['UtilService', function(
|
|||
|
||||
metadataService.getDockerfileCommand = function(command) {
|
||||
if (!command) { return ''; }
|
||||
command = command.join(' ').split(' ')
|
||||
command = command.join(' ').split(' ');
|
||||
|
||||
// ["/bin/sh", "-c", "#(nop)", "RUN", "foo"]
|
||||
if (command[0] != '/bin/sh' || command[1] != '-c') { return ''; }
|
||||
|
|
|
@ -133,15 +133,15 @@ angular.module('quay').factory('VulnerabilityService', ['Config', 'ApiService',
|
|||
};
|
||||
|
||||
// Save the highest vulnerability severity for this feature.
|
||||
highestSeverityIndex = Math.min(severity['index'], highestSeverityIndex)
|
||||
highestSeverityIndex = Math.min(severity['index'], highestSeverityIndex);
|
||||
|
||||
// Add the score and (if necessary) the fixable scores.
|
||||
score += exponentialScore;
|
||||
severityCountMap[severity['index']]++
|
||||
severityCountMap[severity['index']]++;
|
||||
vulnerabilities.push(vuln_object);
|
||||
|
||||
if (vuln.FixedBy) {
|
||||
fixableCountMap[severity['index']]++
|
||||
fixableCountMap[severity['index']]++;
|
||||
fixableScore += exponentialScore;
|
||||
fixable.push(vuln_object)
|
||||
}
|
||||
|
|
Reference in a new issue