networkinsights_get_findings
Retrieve security findings for AWS network analysis to identify potential vulnerabilities and access scope issues.
Instructions
Retrieve all findings for a given analysis.
Parameters:
aws_region (str): The AWS region - use 'us-east-1' if not specified.
analysis_id (str): The ID of the analysis to retrieve findings for.
max_results (int): Maximum number of findings to return.
Returns:
JSON list of NetworkInsightsAccessScopeAnalysisFinding objects.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aws_region | Yes | ||
| analysis_id | Yes | ||
| max_results | No |
Implementation Reference
- server.py:857-889 (handler)The handler function decorated with @mcp.tool(), which registers and implements the tool logic to retrieve findings for a Network Insights Access Scope Analysis by paginating through EC2 API calls and returning JSON.@mcp.tool() async def networkinsights_get_findings( aws_region: str, analysis_id: str, max_results: int = 1 ) -> str: """ Retrieve all findings for a given analysis. Parameters: aws_region (str): The AWS region - use 'us-east-1' if not specified. analysis_id (str): The ID of the analysis to retrieve findings for. max_results (int): Maximum number of findings to return. Returns: JSON list of NetworkInsightsAccessScopeAnalysisFinding objects. """ client = boto3.client('ec2', region_name=aws_region) findings = [] next_token = None while True: kwargs = { 'NetworkInsightsAccessScopeAnalysisId': analysis_id, 'MaxResults': max_results } if next_token: kwargs['NextToken'] = next_token resp = client.get_network_insights_access_scope_analysis_findings(**kwargs) findings.extend(resp.get('AnalysisFindings', [])) next_token = resp.get('NextToken') if not next_token: break return json.dumps(findings, indent=2, cls=DateTimeEncoder)