Skip to content

Commit

Permalink
v. 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-krawczyk committed Sep 9, 2019
1 parent 4d9deba commit f67c468
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ This document records all notable changes to `nessus file reader by LimberDuck <
This project adheres to `Semantic Versioning <http://semver.org/>`_.


0.2.0 (2019-09-09)
---------------------

New Features
- new function plugin.report_item_values - to get list of values for all items with given name e.g. 'cve'


0.1.0 (2019-06-23)
---------------------

Expand Down
14 changes: 14 additions & 0 deletions nessus_file_reader/plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ def report_item_value(report_item, report_item_name):
return report_item_content_value


def report_item_values(report_item, report_item_name):
"""
Function returns list of all values of given report item e.g. list of CVE numbers
:param report_item: particular report item for scanned host
:param report_item_name: exact report item name for scanned host
:return: value of given report item
"""
report_item_values_list = []
report_item_content_values = report_item.findall(report_item_name)
for report_item_content_value in report_item_content_values:
report_item_values_list.append(report_item_content_value.text)
return report_item_values_list


def compliance_check_item_value(report_item, compliance_check_item_name):
"""
Function returns value of given compliance check item e.g. cm:compliance-check-name
Expand Down
3 changes: 2 additions & 1 deletion nfr_example_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def nfr_example_simple():
plugin_id = int(nfr.plugin.report_item_value(report_item, 'pluginID'))
risk_factor = nfr.plugin.report_item_value(report_item, 'risk_factor')
plugin_name = nfr.plugin.report_item_value(report_item, 'pluginName')
print('\t', plugin_id, ' \t\t\t', risk_factor, ' \t\t\t', plugin_name)
plugin_cves = nfr.plugin.report_item_values(report_item, 'cve')
print('\t', plugin_id, ' \t\t\t', risk_factor, ' \t\t\t', plugin_name, ' \t\t\t', plugin_cves)

print()
# If you want to get output for interesting you plugin
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

setuptools.setup(
name="nessus_file_reader",
version="0.1.0",
version="0.2.0",
author="Damian Krawczyk",
author_email="damian.krawczyk@limberduck.org",
description="nessus file reader by LimberDuck (pronounced *ˈlɪm.bɚ dʌk*) is a python module"
"created to quickly parse nessus files containing the results of scans"
description="nessus file reader by LimberDuck (pronounced *ˈlɪm.bɚ dʌk*) is a python module "
"created to quickly parse nessus files containing the results of scans "
"performed by using Nessus by (C) Tenable, Inc.",
long_description=long_description,
long_description_content_type="text/x-rst",
Expand Down

0 comments on commit f67c468

Please sign in to comment.