I just wanted to throw out a "me too" on this and also offer up that I believe the issue lies down further into the code than what nickhillscpl had shared in his "answer" (which is also why I think the issue got buried further down as well with the error checking they added.)
The section of code it is really stemming from is the line:
total_records = sc.get_total_records_for_vuln(scan_id)
This function call looks like this:
def get_total_records_for_vuln(self, scan_id):
args = {'type': 'vuln',
'sourceType': 'individual',
'scanID': scan_id,
'query_type': 'vuln',
'query_tool': 'listvuln',
'query_view': 'all'}
self._build_query(None, args)
args['query']['startOffset'] = 0
args['query']['endOffset'] = 0
result = self.perform_request('POST', 'analysis', args)
return int(result['totalRecords'])
Inside this is the "perform_request" function which basically is what makes the actual REST API call to the Security Center server. I had already modified my own code block in here to include a little bit of "error" help on the request call itself, but this only seems to control for HTTP errors themselves and not for the API errors which are giving back "valid" responses, but the server is rejecting it.
... View more