mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
security: Move security report to new page
Signed-off-by: James Valleroy <jvalleroy@mailbox.org> [sunil@medhas.org Remove status header similar to other toolbars] [sunil@medhas.org Add icon to 'show security report' button] [sunil@medhas.org Handle error retrieving past CVE counts] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
5fe84bf395
commit
03f5ca0b05
4 files changed
+76
-45
No files matched your search
@@ -43,7 +43,6 @@ def index(request):
|
||||
else:
|
||||
form = SecurityForm(initial=status, prefix='security')
|
||||
|
||||
vulnerability_counts = security.get_vulnerability_counts()
|
||||
return TemplateResponse(
|
||||
request, 'security.html', {
|
||||
'name':
|
||||
@@ -52,11 +51,6 @@ def index(request):
|
||||
security.manual_page,
|
||||
'form':
|
||||
form,
|
||||
'freedombox_vulns':
|
||||
vulnerability_counts.pop('freedombox'),
|
||||
'apps_vulns':
|
||||
sorted(vulnerability_counts.values(),
|
||||
key=lambda app: app['name']),
|
||||
})
|
||||
|
||||
|
||||
@@ -86,3 +80,18 @@ def _apply_changes(request, old_status, new_status):
|
||||
actions.superuser_run('service', ['enable', 'fail2ban'])
|
||||
else:
|
||||
actions.superuser_run('service', ['disable', 'fail2ban'])
|
||||
|
||||
|
||||
def report(request):
|
||||
"""Serve the security report page"""
|
||||
vulnerability_counts = security.get_vulnerability_counts()
|
||||
return TemplateResponse(
|
||||
request, 'security_report.html', {
|
||||
'title':
|
||||
_('Security Report'),
|
||||
'freedombox_vulns':
|
||||
vulnerability_counts.pop('freedombox'),
|
||||
'apps_vulns':
|
||||
sorted(vulnerability_counts.values(),
|
||||
key=lambda app: app['name']),
|
||||
})
|
||||
Reference in new issue
Block a user