aboutsummaryrefslogtreecommitdiffstats
path: root/bin/mitre/srtool_mitre.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mitre/srtool_mitre.py')
-rwxr-xr-xbin/mitre/srtool_mitre.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/mitre/srtool_mitre.py b/bin/mitre/srtool_mitre.py
index 2ac8bc08..3c6af89d 100755
--- a/bin/mitre/srtool_mitre.py
+++ b/bin/mitre/srtool_mitre.py
@@ -91,7 +91,7 @@ def srt_error_log(msg):
# Newly discovered or updated CVEs default to NEW for triage
# Inited CVEs default to HISTORICAL, unless they are within the courtesy CVE_INIT_NEW_DELTA
init_new_date = None
-def get_cve_default_status(is_init,publishedDate):
+def get_cve_default_status(is_init,publishedDate,description):
global init_new_date
if None == init_new_date:
@@ -114,7 +114,12 @@ def get_cve_default_status(is_init,publishedDate):
# Note: the NIST 'published date' is in the format "2017-05-11", so do a simple string compare
#print("INIT status: %s versus %s" % (init_new_date,publishedDate))
if not publishedDate or (publishedDate > init_new_date):
- return ORM.STATUS_NEW
+ # Is this reserved by Mitre? Is '** RESERVED **' within the first 20 char positions?
+ reserved_pos = description.find('** RESERVED **')
+ if (0 <= reserved_pos) and (20 > reserved_pos):
+ return ORM.STATUS_NEW_RESERVED
+ else:
+ return ORM.STATUS_NEW
else:
return ORM.STATUS_HISTORICAL
else:
@@ -310,7 +315,7 @@ def append_cve_database(is_init,file_xml):
print("MITRE:FOUND %20s\r" % cve_name, end='')
else:
# Get the default CVE status
- status = get_cve_default_status(is_init,summary['Published'])
+ status = get_cve_default_status(is_init,summary['Published'],summary['Description'])
sql = ''' INSERT into orm_cve (name, name_sort, priority, status, comments, comments_private, cve_data_type, cve_data_format, cve_data_version, public, publish_state, publish_date, description, publishedDate, lastModifiedDate, recommend, recommend_list, cvssV3_baseScore, cvssV3_baseSeverity, cvssV2_baseScore, cvssV2_severity, srt_updated, packages)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'''