InsightVM Python from GitHub

We’re trying to utilize the scripting features from the InsightVM GitHub repo. We’re running into errors and I was curious if anyone was able to work around these or if they reached out to Rapid7 for assistance.

I’m using the sample “assets.py” file in the repo.
Rapid7 VM Console Python Stuff

Traceback (most recent call last):
  File "c:/Users/uid/Documents/Scripts/Rapid7/poam.py", line 38, in <module>
    assets = asset_api.get_assets()
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api\asset_api.py", line 2081, in get_assets
    (data) = self.get_assets_with_http_info(**kwargs)  # noqa: E501
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api\asset_api.py", line 2148, in get_assets_with_http_info
    return self.api_client.call_api(
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 315, in call_api
    return self.__call_api(resource_path, method,
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 159, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 231, in deserialize
    return self.__deserialize(data, response_type)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 270, in __deserialize
    return self.__deserialize_model(data, klass)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 611, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 247, in __deserialize
    return [self.__deserialize(sub_data, sub_kls)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 247, in <listcomp>
    return [self.__deserialize(sub_data, sub_kls)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 270, in __deserialize
    return self.__deserialize_model(data, klass)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 611, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 247, in __deserialize
    return [self.__deserialize(sub_data, sub_kls)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 247, in <listcomp>
    return [self.__deserialize(sub_data, sub_kls)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 270, in __deserialize
    return self.__deserialize_model(data, klass)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 611, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 247, in __deserialize
    return [self.__deserialize(sub_data, sub_kls)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 247, in <listcomp>
    return [self.__deserialize(sub_data, sub_kls)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 270, in __deserialize
    return self.__deserialize_model(data, klass)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\api_client.py", line 613, in __deserialize_model
    instance = klass(**kwargs)
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\models\configuration.py", line 48, in __init__
    self.name = name
  File "C:\Users\uid\AppData\Local\Programs\Python\Python38-32\lib\site-packages\rapid7vmconsole\models\configuration.py", line 73, in name
    raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
ValueError: Invalid value for `name`, must not be `None`

Just saw that I have the same behavior on my script. It might have something to do with the urllib2 that they use. I have to dig a bit deeper.

Traceback (most recent call last):
  File "/scannetadminhosts/bin/scanNetAdminHosts.py", line 796, in <module>
    main()
  File "/scannetadminhosts/bin/scanNetAdminHosts.py", line 776, in main
    scan_hosts()
  File "/scannetadminhosts/bin/scanNetAdminHosts.py", line 571, in scan_hosts
    prepare_insightvm_connection()
  File "/scannetadminhosts/bin/scanNetAdminHosts.py", line 367, in prepare_insightvm_connection
    api_response = api_instance.get_site_assets(SiteID, page=0, size=500).resources
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api/site_api.py", line 2920, in get_site_assets
    (data) = self.get_site_assets_with_http_info(id, **kwargs)  # noqa: E501
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api/site_api.py", line 3008, in get_site_assets_with_http_info
    collection_formats=collection_formats)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 320, in call_api
    _preload_content, _request_timeout)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 159, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 231, in deserialize
    return self.__deserialize(data, response_type)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 270, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 611, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 248, in __deserialize
    for sub_data in data]
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 248, in <listcomp>
    for sub_data in data]
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 270, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 611, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 248, in __deserialize
    for sub_data in data]
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 248, in <listcomp>
    for sub_data in data]
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 270, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 611, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 248, in __deserialize
    for sub_data in data]
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 248, in <listcomp>
    for sub_data in data]
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 270, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/api_client.py", line 613, in __deserialize_model
    instance = klass(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/models/configuration.py", line 48, in __init__
    self.name = name
  File "/usr/local/lib/python3.6/site-packages/rapid7vmconsole/models/configuration.py", line 73, in name
    raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
ValueError: Invalid value for `name`, must not be `None`

Or could it be that they only accept TLS 1.2 nowadays