Add defcon1 banner

Fixes #771
This commit is contained in:
Joseph Schorr 2015-11-20 16:13:50 -05:00
parent de9a0e51d3
commit 666114dea4
3 changed files with 20 additions and 2 deletions

View file

@ -13,7 +13,11 @@
}
.vulnerability-priority-view-element.High,
.vulnerability-priority-view-element.Critical,
.vulnerability-priority-view-element.Defcon1 {
.vulnerability-priority-view-element.Critical {
color: #D64456;
}
.vulnerability-priority-view-element.Defcon1 {
color: black;
font-weight: bold;
}

View file

@ -18,6 +18,13 @@
<!-- Normal View -->
<div ng-show="!showingHistory">
<div class="co-alert co-alert-danger" ng-if="hasDefcon1">
One or more of your tags has an <strong>extremely critical</strong> vulnerability which should be addressed immediately:
<a href="{{ vuln.Link }}" ng-repeat="(key, vuln) in defcon1" style="margin-left: 10px;" target="_blank">
{{ vuln.ID }}
</a>
</div>
<div class="co-check-bar">
<span class="cor-checkable-menu" controller="checkedTags">
<div class="cor-checkable-menu-item" item-filter="allTagFilter">

View file

@ -36,6 +36,8 @@ angular.module('quay').directive('repoPanelTags', function () {
$scope.showingHistory = false;
$scope.tagsPerPage = 25;
$scope.imageVulnerabilities = {};
$scope.defcon1 = {};
$scope.hasDefcon1 = false;
var setTagState = function() {
if (!$scope.repository || !$scope.selectedTags) { return; }
@ -173,6 +175,11 @@ angular.module('quay').directive('repoPanelTags', function () {
};
resp.data.Vulnerabilities.forEach(function(v) {
if (VulnerabilityService.LEVELS[v.Priority].index == 0) {
$scope.defcon1[v.ID] = v;
$scope.hasDefcon1 = true;
}
if (VulnerabilityService.LEVELS[v.Priority].index < highest.index) {
highest = {
'Priority': v.Priority,