2016-02-24 21:01:27 +00:00
|
|
|
# NOTE: This objects are used directly in the external-notification-data and vulnerability-service
|
|
|
|
# on the frontend, so be careful with changing their existing keys.
|
|
|
|
PRIORITY_LEVELS = {
|
|
|
|
'Unknown': {
|
|
|
|
'title': 'Unknown',
|
2016-02-25 20:58:42 +00:00
|
|
|
'index': 6,
|
2016-02-24 21:01:27 +00:00
|
|
|
'level': 'info',
|
2016-02-22 23:39:04 +00:00
|
|
|
'color': '#9B9B9B',
|
|
|
|
'score': 0,
|
2016-02-24 21:01:27 +00:00
|
|
|
|
|
|
|
'description': 'Unknown is either a security problem that has not been assigned ' +
|
|
|
|
'to a priority yet or a priority that our system did not recognize',
|
|
|
|
'banner_required': False
|
|
|
|
},
|
|
|
|
|
|
|
|
'Negligible': {
|
|
|
|
'title': 'Negligible',
|
2016-02-25 20:58:42 +00:00
|
|
|
'index': 5,
|
2016-02-24 21:01:27 +00:00
|
|
|
'level': 'info',
|
2016-02-22 23:39:04 +00:00
|
|
|
'color': '#9B9B9B',
|
|
|
|
'score': 1,
|
2016-02-24 21:01:27 +00:00
|
|
|
|
|
|
|
'description': 'Negligible is technically a security problem, but is only theoretical ' +
|
|
|
|
'in nature, requires a very special situation, has almost no install base, ' +
|
|
|
|
'or does no real damage.',
|
|
|
|
'banner_required': False
|
|
|
|
},
|
|
|
|
|
|
|
|
'Low': {
|
|
|
|
'title': 'Low',
|
2016-02-25 20:58:42 +00:00
|
|
|
'index': 4,
|
2016-02-24 21:01:27 +00:00
|
|
|
'level': 'warning',
|
2016-03-09 20:28:21 +00:00
|
|
|
'color': '#F8CA1C',
|
2016-02-22 23:39:04 +00:00
|
|
|
'score': 3,
|
2016-02-24 21:01:27 +00:00
|
|
|
|
|
|
|
'description': 'Low is a security problem, but is hard to exploit due to environment, ' +
|
|
|
|
'requires a user-assisted attack, a small install base, or does very ' +
|
|
|
|
'little damage.',
|
|
|
|
'banner_required': False
|
|
|
|
},
|
|
|
|
|
|
|
|
'Medium': {
|
|
|
|
'title': 'Medium',
|
|
|
|
'value': 'Medium',
|
2016-02-25 20:58:42 +00:00
|
|
|
'index': 3,
|
2016-02-24 21:01:27 +00:00
|
|
|
'level': 'warning',
|
2016-03-09 20:28:21 +00:00
|
|
|
'color': '#FCA657',
|
2016-02-22 23:39:04 +00:00
|
|
|
'score': 6,
|
2016-02-24 21:01:27 +00:00
|
|
|
|
|
|
|
'description': 'Medium is a real security problem, and is exploitable for many people. ' +
|
|
|
|
'Includes network daemon denial of service attacks, cross-site scripting, ' +
|
|
|
|
'and gaining user privileges.',
|
|
|
|
'banner_required': False
|
|
|
|
},
|
|
|
|
|
|
|
|
'High': {
|
|
|
|
'title': 'High',
|
|
|
|
'value': 'High',
|
2016-02-25 20:58:42 +00:00
|
|
|
'index': 2,
|
2016-02-24 21:01:27 +00:00
|
|
|
'level': 'warning',
|
2016-03-09 20:28:21 +00:00
|
|
|
'color': '#F77454',
|
2016-02-22 23:39:04 +00:00
|
|
|
'score': 9,
|
2016-02-24 21:01:27 +00:00
|
|
|
|
|
|
|
'description': 'High is a real problem, exploitable for many people in a default installation. ' +
|
|
|
|
'Includes serious remote denial of services, local root privilege escalations, ' +
|
|
|
|
'or data loss.',
|
|
|
|
'banner_required': False
|
|
|
|
},
|
|
|
|
|
|
|
|
'Critical': {
|
|
|
|
'title': 'Critical',
|
|
|
|
'value': 'Critical',
|
2016-02-25 20:58:42 +00:00
|
|
|
'index': 1,
|
2016-02-24 21:01:27 +00:00
|
|
|
'level': 'error',
|
2016-02-22 23:39:04 +00:00
|
|
|
'color': '#D64456',
|
|
|
|
'score': 10,
|
2016-02-24 21:01:27 +00:00
|
|
|
|
|
|
|
'description': 'Critical is a world-burning problem, exploitable for nearly all people in ' +
|
|
|
|
'a installation of the package. Includes remote root privilege escalations, ' +
|
|
|
|
'or massive data loss.',
|
2016-04-22 17:21:35 +00:00
|
|
|
'banner_required': False
|
2016-02-24 21:01:27 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
'Defcon1': {
|
|
|
|
'title': 'Defcon 1',
|
|
|
|
'value': 'Defcon1',
|
2016-02-25 20:58:42 +00:00
|
|
|
'index': 0,
|
2016-02-24 21:01:27 +00:00
|
|
|
'level': 'error',
|
2016-02-22 23:39:04 +00:00
|
|
|
'color': 'black',
|
|
|
|
'score': 11,
|
2016-02-24 21:01:27 +00:00
|
|
|
|
|
|
|
'description': 'Defcon1 is a Critical problem which has been manually highlighted ' +
|
|
|
|
'by the Quay team. It requires immediate attention.',
|
|
|
|
'banner_required': True
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def get_priority_for_index(index):
|
2016-07-11 19:04:50 +00:00
|
|
|
try:
|
|
|
|
int_index = int(index)
|
|
|
|
except ValueError:
|
|
|
|
return 'Unknown'
|
2016-02-24 21:01:27 +00:00
|
|
|
|
2016-07-11 19:04:50 +00:00
|
|
|
for priority in PRIORITY_LEVELS:
|
|
|
|
if PRIORITY_LEVELS[priority]['index'] == int_index:
|
|
|
|
return priority
|
|
|
|
|
|
|
|
return 'Unknown'
|