accessanalyzer_list_findings
Retrieve and filter AWS IAM Access Analyzer findings by specifying an analyzer ARN, region, and optional criteria. Useful for monitoring S3 bucket permissions and other resource access policies.
Instructions
List findings for an analyzer, with optional filter.
filter: {'resourceType': {'eq': ['AWS::S3::Bucket']}, ...}
Parameters:
aws_region (str): The AWS region - use 'us-east-1' if not specified.
analyzer_arn (str): The ARN of the analyzer to list findings for.
filter (dict, optional): Filter criteria for findings.
max_results (int): Maximum number of findings to return.
Returns:
str: JSON-formatted list of findings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| analyzer_arn | Yes | ||
| aws_region | Yes | ||
| filter | No | ||
| max_results | No |
Input Schema (JSON Schema)
{
"properties": {
"analyzer_arn": {
"title": "Analyzer Arn",
"type": "string"
},
"aws_region": {
"title": "Aws Region",
"type": "string"
},
"filter": {
"additionalProperties": true,
"default": null,
"title": "Filter",
"type": "object"
},
"max_results": {
"default": 50,
"title": "Max Results",
"type": "integer"
}
},
"required": [
"aws_region",
"analyzer_arn"
],
"title": "accessanalyzer_list_findingsArguments",
"type": "object"
}
Implementation Reference
- server.py:968-1003 (handler)Handler function for the 'accessanalyzer_list_findings' tool. Uses IAM Access Analyzer client to list findings for a given analyzer ARN, with optional filters and pagination handling. Returns JSON-formatted list of finding summaries.@mcp.tool() async def accessanalyzer_list_findings( aws_region: str, analyzer_arn: str, filter: dict = None, max_results: int = 50 ) -> str: """ List findings for an analyzer, with optional filter. filter: {'resourceType': {'eq': ['AWS::S3::Bucket']}, ...} Parameters: aws_region (str): The AWS region - use 'us-east-1' if not specified. analyzer_arn (str): The ARN of the analyzer to list findings for. filter (dict, optional): Filter criteria for findings. max_results (int): Maximum number of findings to return. Returns: str: JSON-formatted list of findings. """ client = boto3.client('accessanalyzer', region_name=aws_region) params = {'analyzerArn': analyzer_arn, 'maxResults': max_results} if filter: params['filter'] = filter findings = [] next_token = None while True: if next_token: params['nextToken'] = next_token response = client.list_findings(**params) summaries = response.get('findingSummaries', []) findings.extend(summaries) next_token = response.get('nextToken') if not next_token: break return json.dumps(findings, indent=2, cls=DateTimeEncoder)