From 1a337ddaa941bb36265ffd933ccd11a68a4c7046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Pinto?= Date: Mon, 10 Nov 2025 10:25:56 +0000 Subject: [PATCH 1/4] fix: href colors, and small improvements --- surface/sca/templates/views/layout.html | 4 ++++ surface/sca/templates/views/vulnerabilities.html | 4 ++-- surface/surface/settings.py | 8 -------- surface/surfapp/templates/admin/change_list.html | 5 +++++ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/surface/sca/templates/views/layout.html b/surface/sca/templates/views/layout.html index d8e5c6e6..85ab22ac 100644 --- a/surface/sca/templates/views/layout.html +++ b/surface/sca/templates/views/layout.html @@ -145,6 +145,10 @@ .ui.dropdown > .text { color: var(--ui-control-foreground) !important; } + td a[href] { + color: var(--color-primary-500) !important; + } + {% endblock %} diff --git a/surface/sca/templates/views/vulnerabilities.html b/surface/sca/templates/views/vulnerabilities.html index ddb7240b..dca18e36 100644 --- a/surface/sca/templates/views/vulnerabilities.html +++ b/surface/sca/templates/views/vulnerabilities.html @@ -104,13 +104,13 @@ {% endif %} - +

{{ vuln.summary }}

{% empty %} - No vulnerabilities found + No vulnerabilities found {% endfor %} diff --git a/surface/surface/settings.py b/surface/surface/settings.py index 070761dc..04c82916 100644 --- a/surface/surface/settings.py +++ b/surface/surface/settings.py @@ -307,13 +307,5 @@ "900": "oklch(39.1% .09 240.876)", "950": "oklch(29.3% .066 243.157)", }, - "font": { - "subtle-light": "var(--color-base-500)", # text-base-500 - "subtle-dark": "var(--color-base-400)", # text-base-400 - "default-light": "var(--color-base-600)", # text-base-600 - "default-dark": "var(--color-base-300)", # text-base-300 - "important-light": "var(--color-base-900)", # text-base-900 - "important-dark": "var(--color-primary-500)", # text-base-100 - }, }, } diff --git a/surface/surfapp/templates/admin/change_list.html b/surface/surfapp/templates/admin/change_list.html index c1bc6dee..f125c02e 100644 --- a/surface/surfapp/templates/admin/change_list.html +++ b/surface/surfapp/templates/admin/change_list.html @@ -13,6 +13,11 @@ {{ media.css }} + {% if not actions_on_top and not actions_on_bottom %} From 5e48e45489404dc463b81dde3bc6c325dd5f6005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Pinto?= Date: Mon, 10 Nov 2025 10:47:05 +0000 Subject: [PATCH 3/4] fix: fixed_in versions to ignore everything that is not an actual version --- surface/sca/management/commands/resync_sbom_repo.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/surface/sca/management/commands/resync_sbom_repo.py b/surface/sca/management/commands/resync_sbom_repo.py index 5cc3ac99..e7b1787c 100644 --- a/surface/sca/management/commands/resync_sbom_repo.py +++ b/surface/sca/management/commands/resync_sbom_repo.py @@ -60,6 +60,13 @@ def create_dependency(self, purl: str, scan_date: str) -> tuple[PackageURL | Non return purl, dep_object + def is_version(self, version: str) -> bool: + try: + semver.Version.parse(version, optional_minor_and_patch=True) + return True + except ValueError: + return False + # Check for EOL dependencies def handle_eol(self, purl: PackageURL, dependency: SCADependency): # Get Suppressed Findings for current dependency @@ -116,7 +123,7 @@ def handle_vuln(self, vuln: dict[str, Any], pkg_obj: SCADependency): for version in vuln.get("affected", {}) for version_range in version.get("ranges", {}) for event in version_range.get("events", {}) - if "fixed" in event + if "fixed" in event and self.is_version(event["fixed"]) ] SCAFinding.objects.update_or_create( From 7c155c95322941ade6100869e4e0d10d8da22918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Pinto?= Date: Mon, 10 Nov 2025 11:25:19 +0000 Subject: [PATCH 4/4] rename function --- surface/sca/management/commands/resync_sbom_repo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/surface/sca/management/commands/resync_sbom_repo.py b/surface/sca/management/commands/resync_sbom_repo.py index e7b1787c..7a9f7f7b 100644 --- a/surface/sca/management/commands/resync_sbom_repo.py +++ b/surface/sca/management/commands/resync_sbom_repo.py @@ -60,7 +60,7 @@ def create_dependency(self, purl: str, scan_date: str) -> tuple[PackageURL | Non return purl, dep_object - def is_version(self, version: str) -> bool: + def is_valid_version(self, version: str) -> bool: try: semver.Version.parse(version, optional_minor_and_patch=True) return True @@ -123,7 +123,7 @@ def handle_vuln(self, vuln: dict[str, Any], pkg_obj: SCADependency): for version in vuln.get("affected", {}) for version_range in version.get("ranges", {}) for event in version_range.get("events", {}) - if "fixed" in event and self.is_version(event["fixed"]) + if "fixed" in event and self.is_valid_version(event["fixed"]) ] SCAFinding.objects.update_or_create(