diff options
author | Bjoern Tropf <asym@gentoo.org> | 2009-11-21 17:37:59 +0100 |
---|---|---|
committer | Bjoern Tropf <asym@gentoo.org> | 2009-11-21 17:37:59 +0100 |
commit | c9c07adb4771b597a5093f256e7cf4f505df6caa (patch) | |
tree | b9196f402dbe8d33187c510577c84fc3f49d9796 /pym/kernelcheck/kernelcheck.py | |
parent | Output design idea (diff) | |
download | kernel-check-c9c07adb4771b597a5093f256e7cf4f505df6caa.tar.gz kernel-check-c9c07adb4771b597a5093f256e7cf4f505df6caa.tar.bz2 kernel-check-c9c07adb4771b597a5093f256e7cf4f505df6caa.zip |
More ideas...
Diffstat (limited to 'pym/kernelcheck/kernelcheck.py')
-rwxr-xr-x | pym/kernelcheck/kernelcheck.py | 34 |
1 files 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 '' |