From 4b513968601a1e8791c291e5a4e505f77cd8659f Mon Sep 17 00:00:00 2001
From: James Valleroy
Date: Mon, 23 Aug 2021 07:59:34 -0400
Subject: [PATCH] security: Remove display of past vulnerabilities
Signed-off-by: James Valleroy
Reviewed-by: Sunil Mohan Adapa
---
plinth/modules/security/__init__.py | 16 ----------------
.../security/templates/security_report.html | 12 +++++-------
2 files changed, 5 insertions(+), 23 deletions(-)
diff --git a/plinth/modules/security/__init__.py b/plinth/modules/security/__init__.py
index 2cb859746..b67e0105e 100644
--- a/plinth/modules/security/__init__.py
+++ b/plinth/modules/security/__init__.py
@@ -7,7 +7,6 @@ import re
import subprocess
from collections import defaultdict
-import requests
from django.utils.translation import ugettext_lazy as _
from plinth import actions
@@ -109,12 +108,6 @@ def get_apps_report():
(label, package, *_) = line.split()
cves[label].add(package)
- try:
- past_cves = requests.get(
- 'https://security-tracker.debian.org/tracker/data/json').json()
- except Exception:
- past_cves = None
-
service_exposure_lines = subprocess.check_output(
['systemd-analyze', 'security']).decode().strip().split('\n')
service_exposure_lines.pop(0)
@@ -130,12 +123,8 @@ def get_apps_report():
'name': 'freedombox',
'packages': {'freedombox'},
'vulns': 0,
- 'past_vulns': 0 if past_cves else None,
}
}
- if past_cves and 'freedombox' in past_cves:
- apps['freedombox']['past_vulns'] = len(past_cves['freedombox'])
-
for module_name, module in module_loader.loaded_modules.items():
try:
packages = module.managed_packages
@@ -155,14 +144,9 @@ def get_apps_report():
'name': module_name,
'packages': set(packages),
'vulns': 0,
- 'past_vulns': 0 if past_cves else None,
'sandboxed': None,
}
- for package in packages:
- if past_cves and package in past_cves:
- apps[module_name]['past_vulns'] += len(past_cves[package])
-
if services:
apps[module_name]['sandboxed'] = False
for service in services:
diff --git a/plinth/modules/security/templates/security_report.html b/plinth/modules/security/templates/security_report.html
index 4401c1e48..9869828cf 100644
--- a/plinth/modules/security/templates/security_report.html
+++ b/plinth/modules/security/templates/security_report.html
@@ -17,11 +17,11 @@
{% blocktrans trimmed %}
- The following table lists the current reported number, and historical
- count, of security vulnerabilities for each installed app.
- More information on the vulnerabilities can be found on the
- Debian Security
- Bug Tracker.
+ The following table lists the current reported number of
+ security vulnerabilities for each installed app. More
+ information on the vulnerabilities can be found on the
+ Debian
+ Security Bug Tracker.
{% endblocktrans %}
@@ -44,7 +44,6 @@
| {% trans "App Name" %} |
{% trans "Current Vulnerabilities" %} |
- {% trans "Past Vulnerabilities" %} |
{% trans "Sandboxed" %} |
{% trans "Sandbox Coverage" %} |
@@ -54,7 +53,6 @@
| {{ app.name }} |
{{ app.vulns }} |
- {{ app.past_vulns|default_if_none:"❗"}} |
{% if app.sandboxed is None %}
{% trans "N/A" %}
|