mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
security: Remove display of past vulnerabilities
Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
efa615201b
commit
4b51396860
@ -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:
|
||||
|
||||
@ -17,11 +17,11 @@
|
||||
</p>
|
||||
<p>
|
||||
{% 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
|
||||
<a href="https://security-tracker.debian.org/tracker/">Debian Security
|
||||
Bug Tracker</a>.
|
||||
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
|
||||
<a href="https://security-tracker.debian.org/tracker/">Debian
|
||||
Security Bug Tracker</a>.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
<p>
|
||||
@ -44,7 +44,6 @@
|
||||
<tr>
|
||||
<th>{% trans "App Name" %}</th>
|
||||
<th>{% trans "Current Vulnerabilities" %}</th>
|
||||
<th>{% trans "Past Vulnerabilities" %}</th>
|
||||
<th>{% trans "Sandboxed" %}</th>
|
||||
<th>{% trans "Sandbox Coverage" %}</th>
|
||||
</tr>
|
||||
@ -54,7 +53,6 @@
|
||||
<tr>
|
||||
<td>{{ app.name }}</td>
|
||||
<td>{{ app.vulns }}</td>
|
||||
<td>{{ app.past_vulns|default_if_none:"❗"}}</td>
|
||||
<td>
|
||||
{% if app.sandboxed is None %}
|
||||
{% trans "N/A" %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user