summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Tropf <asymmail@googlemail.com>2009-08-22 13:24:57 +0200
committerBjoern Tropf <asymmail@googlemail.com>2009-08-22 13:24:57 +0200
commitd33c6244713440bedb34c4df1b76de1a5b273a4a (patch)
tree1bae71ed7e5286fff3a42a4fd76b5947298ba7f7
parentImplement show bugid (diff)
downloadkernel-check-d33c6244713440bedb34c4df1b76de1a5b273a4a.tar.gz
kernel-check-d33c6244713440bedb34c4df1b76de1a5b273a4a.tar.bz2
kernel-check-d33c6244713440bedb34c4df1b76de1a5b273a4a.zip
Further work on output
-rw-r--r--TODO1
-rwxr-xr-xkernel-check.py20
-rwxr-xr-xkernellib.py4
3 files changed, 17 insertions, 8 deletions
diff --git a/TODO b/TODO
index cc6e67e..68855c8 100644
--- a/TODO
+++ b/TODO
@@ -4,6 +4,7 @@ Implementation
- Handle "best kernel not found"
- Add further error handling
- Implement find_cve() (return bugid)
+- Create a GENERIC-MAP-NOMATCH entry in the cve xml files
Cleanup and Rework
==================
diff --git a/kernel-check.py b/kernel-check.py
index e5a0c70..b486998 100755
--- a/kernel-check.py
+++ b/kernel-check.py
@@ -137,22 +137,26 @@ def main(argv):
def print_summary(vullist):
'Prints the vulnerability summary'
- severity = str()
-
for item in vullist:
- print '\nBugid %s' % item.bugid
+ print ''
+
+ if len(item.cves) is 0:
+ #TODO Explicit cve score instead of 0.0
+ print '\nBugid %s %-32s %s\n"%s..."' % (item.bugid,
+ color('GOOD', 'Low' + ' (' + str(0.0) + ')'),
+ color('BRACKET', lib.NOCVE), lib.NOCVEDESC[:term[1]-6])
+
for cve in item.cves:
+ severity = 'BAD'
if cve.severity == 'Low':
severity = 'GOOD'
elif cve.severity == 'Medium':
severity = 'WARN'
- else:
- severity = 'BAD'
- print '%s - %s\n"%s..."' % (cve.cve,
+ print '\nBugid %s %-32s %s\n"%s..."' % (item.bugid,
color(severity, cve.severity + ' (' + cve.score + ')'),
- cve.desc[:term[1]-6])
- print ''
+ color('BRACKET', cve.cve), cve.desc[:term[1]-6])
+ print '\n'
def print_bug(bugid):
diff --git a/kernellib.py b/kernellib.py
index 921a37a..922daf2 100755
--- a/kernellib.py
+++ b/kernellib.py
@@ -60,6 +60,10 @@ KERNEL_TYPES = [
VERSION = '0.5.6'
NOCVE = 'GENERIC-MAP-NOMATCH'
+NOCVEDESC = 'This GENERIC identifier is not specific to any vulnerability. '\
+ 'GENERIC-MAP-NOMATCH is used by products, databases, and ' \
+ 'services to specify when a particular vulnerability element ' \
+ 'does not map to a corresponding CVE entry.'
CVES = dict()
PORTDIR = portage.settings['PORTDIR']
DEBUG = False