diff --git a/vulnerabilities/forms.py b/vulnerabilities/forms.py index 03829cd52..f06440f8e 100644 --- a/vulnerabilities/forms.py +++ b/vulnerabilities/forms.py @@ -12,6 +12,7 @@ from django.core.validators import validate_email from django_altcha import AltchaField +from vulnerabilities.models import ISSUE_TYPE_CHOICES from vulnerabilities.models import ApiUser @@ -103,3 +104,32 @@ class PipelineSchedulePackageForm(forms.Form): class AdminLoginForm(AdminAuthenticationForm): captcha = AltchaField(floating=True, hidefooter=True) + + +class AdvisoryToDoForm(forms.Form): + search = forms.CharField( + required=False, + label=False, + widget=forms.TextInput( + attrs={ + "placeholder": "Search ToDos...", + "class": "input", + }, + ), + ) + + resolved = forms.ChoiceField( + required=False, + choices=[ + ("", "All"), + ("True", "Yes"), + ("False", "No"), + ], + widget=forms.Select(attrs={"class": "select"}), + ) + + issue_type = forms.ChoiceField( + required=False, + choices=[("", "All")] + ISSUE_TYPE_CHOICES, + widget=forms.Select(attrs={"class": "select"}), + ) diff --git a/vulnerabilities/pipelines/v2_importers/fireeye_importer_v2.py b/vulnerabilities/pipelines/v2_importers/fireeye_importer_v2.py index b9d647628..5899eac37 100644 --- a/vulnerabilities/pipelines/v2_importers/fireeye_importer_v2.py +++ b/vulnerabilities/pipelines/v2_importers/fireeye_importer_v2.py @@ -43,6 +43,8 @@ class FireeyeImporterPipeline(VulnerableCodeBaseImporterPipelineV2): precedence = 200 + exclude_from_package_todo = True + @classmethod def steps(cls): return ( diff --git a/vulnerabilities/pipelines/v2_importers/linux_kernel_importer.py b/vulnerabilities/pipelines/v2_importers/linux_kernel_importer.py index 299cd57cb..ca8dd5401 100644 --- a/vulnerabilities/pipelines/v2_importers/linux_kernel_importer.py +++ b/vulnerabilities/pipelines/v2_importers/linux_kernel_importer.py @@ -35,6 +35,8 @@ class LinuxKernelPipeline(VulnerableCodeBaseImporterPipelineV2): license_url = "https://github.com/nluedtke/linux_kernel_cves/blob/master/LICENSE" run_once = True + exclude_from_package_todo = True + @classmethod def steps(cls): return ( diff --git a/vulnerabilities/pipelines/v2_importers/vulnrichment_importer.py b/vulnerabilities/pipelines/v2_importers/vulnrichment_importer.py index 218f97a32..3edb1a000 100644 --- a/vulnerabilities/pipelines/v2_importers/vulnrichment_importer.py +++ b/vulnerabilities/pipelines/v2_importers/vulnrichment_importer.py @@ -35,6 +35,7 @@ class VulnrichImporterPipeline(VulnerableCodeBaseImporterPipelineV2): repo_url = "git+https://github.com/cisagov/vulnrichment.git" precedence = 100 + exclude_from_package_todo = True @classmethod def steps(cls): diff --git a/vulnerabilities/pipelines/v2_importers/xen_importer.py b/vulnerabilities/pipelines/v2_importers/xen_importer.py index af1282e30..6968a23cb 100644 --- a/vulnerabilities/pipelines/v2_importers/xen_importer.py +++ b/vulnerabilities/pipelines/v2_importers/xen_importer.py @@ -57,6 +57,7 @@ class XenImporterPipeline(VulnerableCodeBaseImporterPipelineV2): """ precedence = 200 + exclude_from_package_todo = True _cached_data = None # Class-level cache diff --git a/vulnerabilities/templates/advisory_detail.html b/vulnerabilities/templates/advisory_detail.html index 90f1d6d8b..0b850c006 100644 --- a/vulnerabilities/templates/advisory_detail.html +++ b/vulnerabilities/templates/advisory_detail.html @@ -12,7 +12,7 @@ {% block content %} {% if advisory %} -
+
diff --git a/vulnerabilities/templates/advisory_package_details.html b/vulnerabilities/templates/advisory_package_details.html index 234c5bae0..85c1dcaba 100644 --- a/vulnerabilities/templates/advisory_package_details.html +++ b/vulnerabilities/templates/advisory_package_details.html @@ -12,7 +12,7 @@ {% block content %} {% if advisoryv2 %} -
+
diff --git a/vulnerabilities/templates/advisory_todos.html b/vulnerabilities/templates/advisory_todos.html new file mode 100644 index 000000000..82dbafd76 --- /dev/null +++ b/vulnerabilities/templates/advisory_todos.html @@ -0,0 +1,157 @@ +{% extends "base.html" %} +{% load utils %} + +{% block title %} +Advisory To-Dos +{% endblock %} + +{% block extrahead %} + +{% endblock %} + + +{% block content %} +
+
+
+ +
+
+

Advisory To-Dos

+
+
+
+ +
+
+ {{ form.search }} + + {% if form.search.value %} + + ✕ + + {% endif %} +
+ +
+ +
+
+
+ +
+ + + + + + + + + + + + {% for todo in todo_list %} + + + + {% empty %} + + + + {% endfor %} + +
+
+
+
Aliases
+
Date
+
Resolved
+
# Advisories
+
Issue Type
+
+
+
+
+ + +
+
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+
+
+
+
+
+ {{ todo.alias }} +
+
+ {{ todo.oldest_advisory_date|default:"NA" }} +
+
+ {{ todo.is_resolved|yesno:"Yes,No" }} +
+
+ {{ todo.advisories_count }} +
+
+ {{ todo.get_issue_type_display }} +
+
+
No To-Dos found.
+
+ {% include "includes/pagination_v2.html" with page_obj=page_obj %} +
+
+
+{% endblock %} + diff --git a/vulnerabilities/templates/fixing_advisories.html b/vulnerabilities/templates/fixing_advisories.html index 64af4fc65..cb4b5a20f 100644 --- a/vulnerabilities/templates/fixing_advisories.html +++ b/vulnerabilities/templates/fixing_advisories.html @@ -3,7 +3,7 @@ {% load widget_tweaks %} {% block content %} -
+
diff --git a/vulnerabilities/templates/includes/pagination_v2.html b/vulnerabilities/templates/includes/pagination_v2.html new file mode 100644 index 000000000..3afba9a53 --- /dev/null +++ b/vulnerabilities/templates/includes/pagination_v2.html @@ -0,0 +1,65 @@ +{% load utils %} + +{% if page_obj.has_other_pages %} + +{% endif %} \ No newline at end of file diff --git a/vulnerabilities/templates/navbar.html b/vulnerabilities/templates/navbar.html index 3d3fa0e91..815cd6b76 100644 --- a/vulnerabilities/templates/navbar.html +++ b/vulnerabilities/templates/navbar.html @@ -11,7 +11,7 @@
{% endif %} -