Skip to content

Commit

Permalink
Changed Total to All in table header
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-kenna committed Aug 11, 2023
1 parent 0732010 commit ad15976
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions python/cisa_risk_meter/build_cisa_risk_meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
import requests

VERSION = "1.3.0"
VERSION = "1.4.0"

# This might have to changed depending on your setup.
KENNA_BASE_URL = "https://api.kennasecurity.com/"
Expand All @@ -32,6 +32,11 @@ def process_http_error(msg, response, url):
else:
logging.error(f"{msg}, {url} status_code: {response.status_code} info: {response.text}")

# Print and log warning.
def process_warning(msg):
print(msg)
logging.warning(msg)

# Print and log information.
def process_info(msg):
print(msg)
Expand Down Expand Up @@ -219,10 +224,18 @@ def get_a_risk_meter(base_url, headers, risk_meter_name):
sys.exit(1)

resp_json = response.json()
risk_meters_resp = resp_json['asset_groups']

# Set the maximum number of pages, so that we have one loop.
if "meta" not in resp_json and "pages" not in resp_json['meta']:
process_warning(f"'meta' or 'pages' are not in {resp_json} for List Group Assets API. Page={page_num}")
max_pages = resp_json['meta']['pages']

if "asset_groups" not in resp_json:
process_warning(f"'assets_groups' is not in {resp_json} for List Group Assets API. Page={page_num}")
return None

risk_meters_resp = resp_json['asset_groups']

# Search for the risk meter by name.
for risk_meter in risk_meters_resp:
if risk_meter['name'] == risk_meter_name:
Expand Down
2 changes: 1 addition & 1 deletion python/risk_meters/mttr_vulns.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def process_report(base_url, headers, name, id, given_date, months_back, num_mon
month_to_process = months[start_month_index]

vuln_mttr_tbl = PrettyTable()
vuln_mttr_tbl.field_names = ["Date", "High", "Medium", "Low", "Total"]
vuln_mttr_tbl.field_names = ["Date", "High", "Medium", "Low", "All"]

# Get and process vuln MTTR data for each month.
for i in range(0, num_months):
Expand Down

0 comments on commit ad15976

Please sign in to comment.