bugfixes, tls: dont store errors

parent 0758104c
......@@ -1060,6 +1060,7 @@ def map_data(request, weeks_back=0):
return JsonResponse(data, encoder=JSEncoder)
@cache_page(ten_minutes)
def latest_scans(request, scan_type):
scans = []
......@@ -1130,7 +1131,7 @@ class LatestScanFeed(Feed):
def item_description(self, item):
points, calculation = points_and_calculation(item, self.scan_type)
return calculation["explanation"]
return calculation.get("explanation", "")
def item_pubdate(self, item):
return item.last_scan_moment
......
......@@ -363,7 +363,9 @@ def save_scan(url, data):
previous_scan = TlsQualysScan.objects.filter(endpoint=failmap_endpoint). \
order_by('-last_scan_moment').first()
if previous_scan:
# don't store "failures" as complete scans (with 0 scores).
# storing failures increases the amount of "waste" data. Since so many things can be not resolvable etc.
if previous_scan and rating:
if all([previous_scan.qualys_rating == rating,
previous_scan.qualys_rating_no_trust == rating_no_trust]):
log.info("Scan on %s did not alter the rating, updating scan date only." % failmap_endpoint)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment