diff options
author | 2020-03-04 05:05:24 +0100 | |
---|---|---|
committer | 2020-03-04 05:05:24 +0100 | |
commit | dda658f89dd2514a89dade9fa9d52d14b4d2c7cb (patch) | |
tree | 7fbdce3b665017b1376ad04303f73ce63a79a1b6 | |
parent | cvetool: info: show internal CVE id in addition (diff) | |
download | security-dda658f89dd2514a89dade9fa9d52d14b4d2c7cb.tar.gz security-dda658f89dd2514a89dade9fa9d52d14b4d2c7cb.tar.bz2 security-dda658f89dd2514a89dade9fa9d52d14b4d2c7cb.zip |
cvetool: add 'getcveidlist' action
'getcveidlist' action will allow you to get list of internal CVE ids
required for API request.
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rwxr-xr-x | bin/cvetool | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/cvetool b/bin/cvetool index 28b8901..05d0b6e 100755 --- a/bin/cvetool +++ b/bin/cvetool @@ -47,6 +47,13 @@ class CVETool: sys.exit(1) self.assign(args[0], [self.cleanup_cve(cve) for cve in args[1:]]) + elif command =='getcveidlist': + if len(args) < 1: + print('Usage: getcveidlist <CVE> [<CVE>...]') + print('Returns a list of the real CVE IDs') + sys.exit(1) + + self.getcveidlist([self.cleanup_cve(cve) for cve in args[0:]]) elif command == 'new': if len(args) != 1: print('Usage: new <CVE>') @@ -90,6 +97,11 @@ class CVETool: print(' State: ' + data['state']) print(' Bugs: ' + ' , '.join(['https://bugs.gentoo.org/' + str(bug) for bug in data['bugs']])) + def getcveidlist(self, cves): + cve_ids = [self.get_internal_cve_id(cve) for cve in cves] + print('CVE IDs: cves=' + ','.join([str(c) for c in cve_ids])) + + def assign(self, bug, cves): cve_ids = [self.get_internal_cve_id(cve) for cve in cves] response = self.request('/cve/assign/?bug=' + str(bug) + '&cves=' + ','.join([str(c) for c in cve_ids])) |