diff --git a/dejacode/static/css/dejacode_bootstrap.css b/dejacode/static/css/dejacode_bootstrap.css index 207adce..518ddfd 100644 --- a/dejacode/static/css/dejacode_bootstrap.css +++ b/dejacode/static/css/dejacode_bootstrap.css @@ -394,10 +394,10 @@ table.vulnerabilities-table .column-summary { width: 155px; } #tab_vulnerabilities .column-weighted_severity { - width: 125px; + width: 120px; } #tab_vulnerabilities .column-risk_score { - width: 95px; + width: 90px; } #tab_vulnerabilities .column-summary { width: 300px; diff --git a/product_portfolio/templates/product_portfolio/tabs/tab_vulnerabilities.html b/product_portfolio/templates/product_portfolio/tabs/tab_vulnerabilities.html index 39c8050..e090dcb 100644 --- a/product_portfolio/templates/product_portfolio/tabs/tab_vulnerabilities.html +++ b/product_portfolio/templates/product_portfolio/tabs/tab_vulnerabilities.html @@ -1,11 +1,11 @@ {% load i18n %} {% include 'tabs/pagination.html' %} - +
{% include 'includes/object_list_table_header.html' with filter=filterset include_actions=True %} {% for vulnerability in page_obj.object_list %} - - - - - - - {% endif %} + - + + + + + + {% if not forloop.first %}{% endif %} + {% endfor %} {% empty %} diff --git a/product_portfolio/views.py b/product_portfolio/views.py index 8f22e67..f9326f9 100644 --- a/product_portfolio/views.py +++ b/product_portfolio/views.py @@ -1112,17 +1112,27 @@ class ProductTabVulnerabilitiesView( filterset_class = VulnerabilityFilterSet table_headers = ( Header("vulnerability_id", _("Vulnerability")), - Header("affected_packages", _("Affected packages"), help_text="Affected product packages"), Header("exploitability", _("Exploitability"), filter="exploitability"), Header("weighted_severity", _("Severity"), filter="weighted_severity"), Header("risk_score", _("Risk"), filter="risk_score"), - Header("summary", _("Summary")), + Header("affected_packages", _("Affected packages"), help_text="Affected product packages"), Header( - "exploitability", + "vulnerability_analyses__state", _("Status"), help_text=_("Exploitability analysis"), filter="vulnerability_analyses__state", ), + Header( + "vulnerability_analyses__justification", + _("Justification"), + help_text=_("TODO"), + filter="vulnerability_analyses__justification", + ), + Header( + "vulnerability_analyses__responses", + _("Responses"), + help_text=_("TODO"), + ), ) def get_context_data(self, **kwargs): diff --git a/vulnerabilities/filters.py b/vulnerabilities/filters.py index 2a18ce1..b1114d0 100644 --- a/vulnerabilities/filters.py +++ b/vulnerabilities/filters.py @@ -83,6 +83,7 @@ class VulnerabilityFilterSet(DataspacedFilterSet): "weighted_severity", "risk_score", "affected_products_count", + "affected_packages", "affected_packages_count", "fixed_packages_count", "created_date", @@ -104,6 +105,7 @@ class Meta: fields = [ "q", "vulnerability_analyses__state", + "vulnerability_analyses__justification", "exploitability", ] @@ -114,6 +116,7 @@ def __init__(self, *args, **kwargs): "weighted_severity", "risk_score", "vulnerability_analyses__state", + "vulnerability_analyses__justification", ] for field_name in dropdown_fields: self.filters[field_name].extra["widget"] = DropDownRightWidget(anchor=self.anchor)
+ {% if vulnerability.resource_url %} @@ -15,69 +15,68 @@ {% else %} {{ vulnerability.vulnerability_id }} {% endif %} + {% if vulnerability.summary %} + + + + {% endif %}
{% include 'component_catalog/includes/vulnerability_aliases.html' with aliases=vulnerability.aliases only %}
-
    - {% for package in vulnerability.affected_packages.all %} -
  • - {{ package }} - {% include 'vulnerabilities/includes/risk_score_badge.html' with risk_score=package.risk_score label='risk' only %} -
  • - {% endfor %} -
-
+ {% include 'vulnerabilities/includes/exploitability.html' with instance=vulnerability only %} + {{ vulnerability.weighted_severity|default_if_none:"" }} + {% include 'vulnerabilities/includes/risk_score_badge.html' with risk_score=vulnerability.risk_score only %} - {% if vulnerability.summary %} - {% if vulnerability.summary|length > 120 %} -
- {{ vulnerability.summary|slice:":120" }}... - {{ vulnerability.summary|slice:"120:" }} -
- {% else %} - {{ vulnerability.summary }} - {% endif %} - {% endif %} -
- {% if vulnerability.vulnerability_analyses.get %} + {% for package in vulnerability.affected_packages.all %} + {% if not forloop.first %}
    - {% if vulnerability.vulnerability_analyses.get.state %} -
  • {{ vulnerability.vulnerability_analyses.get.state|capfirst }}
  • - {% endif %} - {% if vulnerability.vulnerability_analyses.get.justification %} -
  • Justification: {{ vulnerability.vulnerability_analyses.get.justification }}
  • - {% endif %} - {% if vulnerability.vulnerability_analyses.get.responses %} -
  • Responses: {{ vulnerability.vulnerability_analyses.get.responses|join:", " }}
  • - {% endif %} - {% if vulnerability.vulnerability_analyses.get.detail %} -
  • Detail: {{ vulnerability.vulnerability_analyses.get.detail }}
  • - {% endif %} +
  • + {{ package }} + {% include 'vulnerabilities/includes/risk_score_badge.html' with risk_score=package.risk_score label='risk' only %} +
- {% endif %} -
- - - - + {% if vulnerability.vulnerability_analyses.get %} +
    + {% if vulnerability.vulnerability_analyses.get.state %} +
  • {{ vulnerability.vulnerability_analyses.get.get_state_display }}
  • + {% endif %} + {% if vulnerability.vulnerability_analyses.get.detail %} +
  • Detail: {{ vulnerability.vulnerability_analyses.get.detail }}
  • + {% endif %} +
+ {% endif %} +
+ {% if vulnerability.vulnerability_analyses.get %} + {{ vulnerability.vulnerability_analyses.get.get_justification_display }} + {% endif %} + + {% if vulnerability.vulnerability_analyses.get.responses %} + {{ vulnerability.vulnerability_analyses.get.responses|join:"
" }} + {% endif %} +
+ + + +