Skip to content

Commit

Permalink
New version
Browse files Browse the repository at this point in the history
  • Loading branch information
histrio committed Sep 10, 2019
1 parent 053cdb5 commit 83d19d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "kcare-qualys"
version = "0.1.17"
version = "0.1.18"
description = "The script marks vulnerabilities detected by Qualys, but patched by KernelCare as exceptions"
authors = ["Rinat Sabitov <rsabitov@cloudlinux.com>"]
license = "Apache-2.0"
Expand Down
9 changes: 2 additions & 7 deletions src/kcare_qualys.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,18 @@ def summary(args, qgc, keys):
if 'QID' in data:
ip, dns_name = data['IP'], data.get('DNS Name') or data.get("DNS")
report_assets[ip] = (ip, dns_name)
report_assets[dns_name] = (ip, dns_name)

writer = csv.writer(sys.stdout)
for asset in get_assets(keys):
cve_set = get_cve(asset) or frozenset()
rec = [asset.host, asset.ip, ', '.join(cve_set)]

ids = report_assets.get(asset.ip, ()) + report_assets.get(asset.host, ())
was_in_report = [report_assets.pop(id_, None) for id_ in ids]

if any(was_in_report):
if report_assets.pop(asset.ip, None):
latest = get_latest(asset.kernel_id)
if latest > asset.patch_level:
latest_asset = Asset(asset.host, asset.ip, asset.kernel_id, latest)
latest_cve_set = get_cve(latest_asset)
rec.append('not patched')
rec.append("Asset {0.ip} ({0.host}) is not fully updated. Patch "
rec.append("Asset {0.ip} is not fully updated. Patch "
"level is {0.patch_level} while latest is {1}. CVEs that"
" could be patched but not: {2}.".format(
asset, latest, ', '.join(latest_cve_set - cve_set)))
Expand Down

0 comments on commit 83d19d0

Please sign in to comment.