From c9c07adb4771b597a5093f256e7cf4f505df6caa Mon Sep 17 00:00:00 2001 From: Bjoern Tropf Date: Sat, 21 Nov 2009 17:37:59 +0100 Subject: More ideas... --- pym/kernelcheck/kernelcheck.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/pym/kernelcheck/kernelcheck.py b/pym/kernelcheck/kernelcheck.py index 0369bfb..a2d2437 100755 --- a/pym/kernelcheck/kernelcheck.py +++ b/pym/kernelcheck/kernelcheck.py @@ -3,7 +3,7 @@ # Copyright 2009-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from portage.output import bold, colorize, darkgreen, green, teal #TODO +from portage.output import bold, colorize, darkgreen, green, teal, blue#TODO from _emerge.stdout_spinner import stdout_spinner from _emerge.userquery import userquery @@ -275,12 +275,40 @@ def print_summary(vullist): elif cve.severity == 'Medium': severity = 'WARN' + cve_text = str() + cve_area = str() + + if 'AV:L' in cve.vector or 'AV:A' in cve.vector: + cve_area += color('WARN', 'local') + else: + cve_area += color('BAD', 'network') + + #no access + #no authentification + + if 'C:P' in cve.vector or 'C:C' in cve.vector: + cve_text += ' -confidentiality' + + if 'I:P' in cve.vector or 'I:C' in cve.vector: + cve_text += ' -integrity' + + if 'A:P' in cve.vector or 'A:C' in cve.vector: + cve_text += ' -availability' + + if ('C:P' in cve.vector or 'C:C' in cve.vector) \ + and ('I:P' in cve.vector or 'I:C' in cve.vector) \ + and ('A:P' in cve.vector or 'A:C' in cve.vector): + cve_text = ' -security' + first_text = textwrap.wrap(cve.desc, term[1] - 44)[0] - print '[%s %26s] %s CVSS="%s" %s' % (darkgreen('bugid'), + print '[%s %26s] %s CVSS="%s %s%s"' % (darkgreen('bugid'), color('GOOD', item.bugid), darkgreen(cve.cve), color(severity, cve.score), - teal('%s...' % first_text) + cve_area, + blue(cve_text) + #(AV:L/AC:L/Au:N/C:N/I:N/A:P) + #teal('%s...' % first_text) ) print '' -- cgit v1.2.3-65-gdbad