question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inspector list_findings return empty findingArns

See original GitHub issue

boto3: 1.9.221

When executing:

inspector = boto3.client('inspector',os.environ['AWS_DEFAULT_REGION'])
inspector.list_findings(assessmentRunArns=["arn:aws:inspector:XXXXX"])

The resulting findingArns are empty ({‘findingArns’: []}), although there are 12 findings in that run. I initially thought it could be a permission issue or something, but I’ve ran that with another assessment run, which has 96 findings, and the return is of 12 findings (still wrong).

I’ve then executed the same search with aws inspector list-findings --assessment-run-arns arn:aws:inspector:XXXXX and the correct amount of findings were returned for both assessments.

One important piece of information is that one of this assessment run (12) is being executed toward a Windows Server 2016 with 2 rules exclusions (which aren’t supported) - CIS and Best practices.

Please let me know if you need further information.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
SkullyKiddocommented, Sep 25, 2019

So I managed to find a workaround over it:

if inspector.can_paginate('list_findings') : 
        findingArns= {'findingArns': []}
        paginator = inspector.get_paginator('list_findings')
        page_interator = paginator.paginate(assessmentRunArns=[jsonVal['run']],maxResults=500)
        for page in page_interator:
            findingArns['findingArns'] = findingArns['findingArns'] + page['findingArns']
    else : findingArns = inspector.list_findings(assessmentRunArns=[jsonVal['run']],maxResults=500)

It seems like the pagination is the issue. Not sure if it’s a boto3 issue or an Inspector’s API. Anyhow, that’s still a bug, since the findings should predict that.

0reactions
manuchadhacommented, May 7, 2020

So I managed to find a workaround over it:

if inspector.can_paginate('list_findings') : 
        findingArns= {'findingArns': []}
        paginator = inspector.get_paginator('list_findings')
        page_interator = paginator.paginate(assessmentRunArns=[jsonVal['run']],maxResults=500)
        for page in page_interator:
            findingArns['findingArns'] = findingArns['findingArns'] + page['findingArns']
    else : findingArns = inspector.list_findings(assessmentRunArns=[jsonVal['run']],maxResults=500)

It seems like the pagination is the issue. Not sure if it’s a boto3 issue or an Inspector’s API. Anyhow, that’s still a bug, since the findings should predict that.

Working .Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

ListFindings - Amazon Inspector - AWS Documentation
The following data is returned in JSON format by the service. findingArns. A list of ARNs that specifies the findings returned by the...
Read more >
Inspector — Boto3 Docs 1.26.32 documentation - AWS
Amazon Inspector enables you to analyze the behavior of your AWS resources and to identify potential security issues. For more information, see Amazon ......
Read more >
Amazon Inspector Findings | Trend Micro
Ensure that Amazon Inspector Findings are analyzed and resolved. ... aws inspector list-findings --region us-east-1. 02 The command output should return a ...
Read more >
inspector - Go Packages
Package inspector provides the API client, operations, and parameter ... New returns an initialized Client based on the functional options.
Read more >
Class: AWS.Inspector
the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found