Skip to content

Commit

Permalink
Handle UNKNOWN severity in PDF reports (#1152)
Browse files Browse the repository at this point in the history
Fixes: #1151
  • Loading branch information
BreadGenie committed May 13, 2021
1 parent 36991da commit 3361493
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cve_bin_tool/output_engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import csv
import json
import os
import time
from logging import Logger
from typing import IO, Dict

Expand Down Expand Up @@ -56,6 +57,7 @@ def output_pdf(all_cve_data: Dict[ProductInfo, CVEData], outfile):
pdfdoc = pdfbuilder.PDFBuilder()
cm = pdfdoc.cm
severity_colour = {
"UNKNOWN": pdfdoc.grey,
"LOW": pdfdoc.blue,
"MEDIUM": pdfdoc.green,
"HIGH": pdfdoc.orange,
Expand Down
9 changes: 9 additions & 0 deletions cve_bin_tool/output_engine/pdfbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ class PDFBuilder:

body = PS(name="body", fontSize=12, fontName="Helvetica", leading=12)

body_unknown = PS(
name="body",
fontSize=12,
textColor=colors.grey,
fontName="Helvetica-Bold",
leading=12,
)

body_low = PS(
name="body",
fontSize=12,
Expand Down Expand Up @@ -123,6 +131,7 @@ class PDFBuilder:
]
)

grey = colors.grey
blue = colors.blue
red = colors.red
green = colors.green
Expand Down

0 comments on commit 3361493

Please sign in to comment.