-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the vulnerability list as a table #138
Signed-off-by: tdruez <[email protected]>
- Loading branch information
Showing
4 changed files
with
146 additions
and
134 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
component_catalog/templates/component_catalog/includes/vulnerability_icon_link.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<a href="{{ object.get_absolute_url }}#vulnerabilities" target="_blank" class="vulnerability" data-bs-toggle="tooltip" title="Vulnerabilities"> | ||
<a href="{{ object.get_absolute_url }}#vulnerabilities" class="vulnerability" data-bs-toggle="tooltip" title="Vulnerabilities"> | ||
<i class="fas fa-bug"></i>{% if count %}{{ count }}{% endif %} | ||
</a> |
67 changes: 67 additions & 0 deletions
67
component_catalog/templates/component_catalog/tabs/tab_vulnerabilities.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{% load i18n %} | ||
<table class="table table-bordered table-hover table-md text-break"> | ||
<thead> | ||
<tr> | ||
<th style="width: 210px;"> | ||
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Link to the VulnerableCode app."> | ||
{% trans 'Affected by' %} | ||
</span> | ||
</th> | ||
<th> | ||
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Summary of the vulnerability."> | ||
{% trans 'Summary' %} | ||
</span> | ||
</th> | ||
<th style="width: 210px;"> | ||
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="A list of aliases for this vulnerability."> | ||
{% trans 'Aliases' %} | ||
</span> | ||
</th> | ||
<th style="min-width: 320px;"> | ||
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="The identifiers of Package Versions that have been reported to fix a specific vulnerability and collected in VulnerableCodeDB."> | ||
{% trans 'Fixed packages' %} | ||
</span> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for vulnerability in values.vulnerabilities %} | ||
<tr> | ||
<td> | ||
<a href="{{ values.vulnerablecode_url }}vulnerabilities/{{ vulnerability.vulnerability_id }}" target="_blank"> | ||
{{ vulnerability.vulnerability_id }} | ||
<i class="fa-solid fa-up-right-from-square mini"></i> | ||
</a> | ||
</td> | ||
<td> | ||
{{ vulnerability.summary }} | ||
</td> | ||
<td> | ||
{% for alias in vulnerability.aliases %} | ||
{% if alias|slice:":3" == "CVE" %} | ||
<a href="https://nvd.nist.gov/vuln/detail/{{ alias }}" target="_blank">{{ alias }} | ||
<i class="fa-solid fa-up-right-from-square mini"></i> | ||
</a> | ||
{% elif alias|slice:":4" == "GHSA" %} | ||
<a href="https://github.com/advisories/{{ alias }}" target="_blank">{{ alias }} | ||
<i class="fa-solid fa-up-right-from-square mini"></i> | ||
</a> | ||
{% elif alias|slice:":3" == "NPM" %} | ||
<a href="https://github.com/nodejs/security-wg/blob/main/vuln/npm/{{ alias|slice:"4:" }}.json" target="_blank">{{ alias }} | ||
<i class="fa-solid fa-up-right-from-square mini"></i> | ||
</a> | ||
{% else %} | ||
{{ alias }} | ||
{% endif %} | ||
<br> | ||
{% endfor %} | ||
</td> | ||
<td> | ||
{% if vulnerability.fixed_packages_html %} | ||
{{ vulnerability.fixed_packages_html }} | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters