Open Patralos opened 7 years ago
This also applies to the software list, etc...
From https://github.com/rapid7/nexpose-client-python/blob/master/nexpose/nexpose_asset.py
# TODO:
# ----begin
details.files = []
details.vulnerability_instances = []
details.unique_identifiers = []
details.group_accounts = []
details.user_accounts = []
details.vulnerabilities = []
details.software = []
details.services = []
# TODO:
# ----end
We definitely have use cases where this information would be helpful.
Thank you!
I think this is similar to what the ruby gem has so we'll either need to lazy-load these resources or pull them all up front. The ruby gem takes advantage of some meta-programming magic to make the lazy-loading happen. It's probably doable in Python as well; otherwise the easy option is to just request all the details before returning the object.
Making it optional could be good for performance for instances where the information is not needed... e.g (in it's simplest form)
def GetAssetDetails(self, asset_or_id, get_vulnerabilities=False, get_software = False, get_services = False):
I'll submit a PR eventually, but for the time being, this worked for me. Edit the AssetDetails class in nexpose_asset.py
# TODO:
# ----begin
details.files = json_dict['files']
details.vulnerability_instances = json_dict['vulnerability_instances']
details.unique_identifiers = json_dict['unique_identifiers']
details.group_accounts = json_dict['group_accounts']
details.user_accounts = json_dict['user_accounts']
details.vulnerabilities = json_dict['vulnerabilities']
details.software = json_dict['software']
details.services = json_dict['services']
# TODO:
# ----end
Submitted PR: https://github.com/rapid7/nexpose-client-python/pull/25
Expected Behavior
There is a list of vulnerabilities provided in asset details, this list shouldn't be empty.
Current Behavior
List is empty
Steps to Reproduce (for bugs)
Load asset details
Python code that reproduces the issue: