Skip to content

Commit 35b4bb6

Browse files
committed
Display a folded CVE alert on affected modules
1 parent 75131c2 commit 35b4bb6

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

root/base/release.tx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
%% }
233233
%% override content -> {
234234

235+
%% include inc::cve_banner;
235236
%% include inc::notification;
236237

237238
%% block page_content -> { }

root/inc/cve_banner.tx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
%% if $cves && $cves.size() {
2+
<details class="cve-banner">
3+
<summary class="cve-summary">
4+
<i class="fa fa-shield" aria-hidden="true"></i>
5+
<strong>Security Advisories ([% $cves.size() %])</strong>
6+
</summary>
7+
<div class="cve-body">
8+
%% for $cves -> $cve {
9+
<div class="cve-entry">
10+
<div class="cve-header">
11+
<strong>
12+
%% if $cve.cves.size() {
13+
[% $cve.cves.join(', ') %]
14+
%% }
15+
%% else {
16+
[% $cve.cpansa_id %]
17+
%% }
18+
</strong>
19+
%% if $cve.reported {
20+
([% $cve.reported %])
21+
%% }
22+
</div>
23+
<p>[% $cve.description %]</p>
24+
%% if $cve.references.size() {
25+
<ul class="cve-references">
26+
%% for $cve.references -> $ref {
27+
<li><a rel="noopener nofollow" href="[% $ref %]">[% $ref %]</a></li>
28+
%% }
29+
</ul>
30+
%% }
31+
</div>
32+
%% }
33+
</div>
34+
</details>
35+
%% }

root/static/less/notification.less

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,36 @@ label.remove-notification {
4848
.notify-MODULE_DEPRECATED {
4949
background: #f8d7da;
5050
}
51+
52+
.cve-banner {
53+
border: 1px solid @alert-danger-border;
54+
border-radius: 4px;
55+
margin-bottom: 15px;
56+
}
57+
58+
.cve-summary {
59+
display: list-item;
60+
background: @alert-danger-bg;
61+
color: @alert-danger-text;
62+
padding: 8px 12px;
63+
cursor: pointer;
64+
}
65+
66+
.cve-body {
67+
padding: 10px 12px;
68+
}
69+
70+
.cve-entry + .cve-entry {
71+
border-top: 1px solid #eee;
72+
padding-top: 8px;
73+
margin-top: 8px;
74+
}
75+
76+
ul.cve-references {
77+
margin-bottom: 0;
78+
list-style: disc;
79+
}
80+
81+
ul.cve-references a {
82+
word-break: break-all;
83+
}

0 commit comments

Comments
 (0)