summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2015-04-14 13:56:27 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2015-04-15 14:35:30 +0000
commit3e7a48372299231dc7383964c514969efa296d1e (patch)
tree4740aba6a01bcb45a5ff9b2ae1e8bf279b19e221
parentc244702280771e025bf0e5ed0a83d2ff6921e3ec (diff)
downloadmorph-3e7a48372299231dc7383964c514969efa296d1e.tar.gz
Make it easier to add software to internal DB
Change-Id: Ib4fe778ce09451d6d54d6012266c9aa7333ac2fe
-rw-r--r--morphlib/plugins/cve_check_plugin.py34
1 files changed, 25 insertions, 9 deletions
diff --git a/morphlib/plugins/cve_check_plugin.py b/morphlib/plugins/cve_check_plugin.py
index 8a3694e0..a80c10e1 100644
--- a/morphlib/plugins/cve_check_plugin.py
+++ b/morphlib/plugins/cve_check_plugin.py
@@ -146,15 +146,31 @@ class CVEDataBase:
# For now it just creates a hardcoded DB
self.db = []
- # Add LibPNG
- libpng = CVESoftware('libpng')
- libpng.add_cve('CVE-2014-9495',
- [['0', '1.5.20'],
- ['1.6.9', '1.6.15']])
- libpng.add_cve('CVE-2014-0333',
- [['1.6.0', '1.6.9']])
-
- self.db.append(libpng)
+ self._add_software('libpng',
+ [['CVE-2014-9495', [['0', '1.5.20'],
+ ['1.6.9', '1.6.15']]],
+ ['CVE-2014-0333', [['1.6.0', '1.6.9' ]]]
+ ])
+
+ self._add_software('openssl-new',
+ [['CVE-2014-3567', [['1.0.1', '1.0.1i' ],
+ ['1.0.0', '1.0.0n' ],
+ ['0.9.8', '0.9.8zc']]],
+ ['CVE-2014-3568', [['1.0.1', '1.0.1i' ],
+ ['1.0.0', '1.0.0n' ],
+ ['0.9.8', '0.9.8zc']]],
+ ['CVE-2014-3513', [['1.0.1', '1.0.1i' ]]],
+ ['CVE-2015-0289', [['1.0.2', '1.0.2' ],
+ ['1.0.1', '1.0.1l' ],
+ ['1.0.0', '1.0.0q' ],
+ ['0.9.8', '0.9.8ze']]]
+ ])
+
+ def _add_software(self, name, cves):
+ sw = CVESoftware(name)
+ for v in cves:
+ sw.add_cve(v[0], v[1])
+ self.db.append(sw)
def check_vulnerability(self, name, version):
for s in self.db: