AWS Audit
BS14/aws-audit
Escaneia boto3 e gera IAM least-privilege sem wildcards
Ver no GitHubSkill que escaneia codebases Python em busca de chamadas boto3 e gera políticas IAM com privilégios mínimos automaticamente. Produz uma tabela de auditoria completa (serviço, método, arquivo, linha, recurso) e uma política IAM JSON sem wildcards, pronta para usar.
Instalação
npx convez-ai BS14/aws-audit1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Auditar permissões AWS de lambdas e aplicações Python
- Gerar políticas IAM scoped a partir de código existente
- Identificar chamadas dinâmicas e recursos não resolvidos em código AWS
Veredito

Ferramenta sólida para reduzir surface de ataque em aplicações AWS. Excelente para DevOps e auditorias internas; requer revisão manual de recursos dinâmicos antes de produção.
README
A tradução para o português deste README ainda está na fila.
aws-audit
A Claude Code skill that scans Python codebases for boto3 API calls and generates least-privilege IAM policies. Point it at one or more repos and get a full audit table (service, method, file, line, resource target) plus a scoped IAM policy JSON — no wildcards.
What it produces
aws_audit_table.md— every AWS call found in your code, with file path, line number, service, API method, and resolved resource targetaws_iam_policy.json— a ready-to-attach least-privilege IAM policy scoped to those exact resources
Prerequisites
- Python 3.8+ (for the scanner script)
- Claude Code CLI
- The skill registered in your Claude Code project (see Installation)
Installation
1. Copy the skill into your Claude Code skills directory
Claude Code looks for skills in .claude/skills/ inside your project, or in ~/.claude/skills/ globally.
# Global install (available in all projects)
cp SKILL.md ~/.claude/skills/aws-audit.md
# Or project-local install
mkdir -p /path/to/your/project/.claude/skills
cp SKILL.md /path/to/your/project/.claude/skills/aws-audit.md
2. Copy the scanner script somewhere accessible
# Recommended: put it alongside your codebase or in a shared tools directory
cp scripts/extract_aws_calls.py ~/tools/extract_aws_calls.py
The scanner is a standalone Python script — no dependencies beyond the standard library.
Usage
Invoke the skill in Claude Code
Just describe what you want in natural language. The skill auto-triggers on phrases like:
- "What AWS calls does my code make?"
- "Generate a least-privilege IAM policy from my codebase"
- "Audit my boto3 usage in
/path/to/repo" - "Scan my repos for AWS API calls"
- "What IAM permissions does my Lambda need?"
Or explicitly: /aws-audit (if registered as a slash command)
What Claude will do
-
Run the scanner against your codebase:
python extract_aws_calls.py /path/to/your/code > aws_calls.json -
Build an audit table mapping every call to its file and line
-
Generate an IAM policy with scoped resource ARNs (no
"Resource": "*") -
Flag issues — dynamic resources, unresolved variables, clients passed across modules
-
Write output files to your working directory and display them
Scanning multiple repos
Pass the parent directory that contains all repos:
python extract_aws_calls.py /path/to/all/repos > aws_calls.json
Or scan each repo separately and tell Claude to merge the results.
Resource target resolution
The scanner resolves resource identifiers at multiple levels:
| What the code does | What the scanner reports |
|---|---|
Bucket="my-bucket" | my-bucket |
Bucket=os.getenv("BUCKET") | ENV:BUCKET |
Bucket=os.environ["BUCKET"] | ENV:BUCKET |
Bucket=settings.bucket_name | CONFIG:settings.bucket_name |
Bucket=some_var (assigned from env earlier) | resolved value |
Bucket=some_var (unknown) | var:some_var (dynamic) |
| f-string resource | dynamic (f-string) |
| Resource arg not found | UnknownResource |
Dynamic and unknown resources are flagged to the user — they need manual review before the policy is production-ready.
What the scanner can and cannot detect
Detects:
- Direct
boto3.client('service')andboto3.resource('service')calls - Environment variable and config object resolution for resource targets
- Pydantic BaseSettings / Dynaconf patterns (
settings.PROPERTY) - 35+ AWS services including S3, DynamoDB, Lambda, SQS, SNS, SSM, Secrets Manager, Cognito, SES, IAM, CloudWatch Logs, ECS, EC2, RDS, Kinesis, MSK, OpenSearch, Redshift, ECR, ElastiCache, and more
Does not detect:
- Client objects passed between functions or modules (per-file tracking only)
- Clients created inside list comprehensions, lambdas, or conditional expressions
- AWS SDK calls through helper wrappers (e.g.
aws_lambda_powertools) - Dynamically constructed method names (
getattr(client, method_name)()) - Calls inside
exec()oreval()
If your codebase uses patterns the scanner misses, see references/runtime_tracing.md for complementary runtime tracing approaches (botocore event hooks, moto, CloudTrail).
References
references/iam_action_map.md— Python method → IAM action lookup table for common servicesreferences/runtime_tracing.md— How to catch dynamic AWS calls the static scanner missesscripts/extract_aws_calls.py— The standalone AST scanner (no dependencies)
Example output
aws_audit_table.md
| AWS Service | API Call | Type | File Path | Line | Resource Target |
|---|---|---|---|---|---|
| s3 | get_object | RO | app/storage.py | 42 | ENV:BUCKET_NAME |
| dynamodb | put_item | RW | app/db.py | 87 | CONFIG:settings.TABLE_NAME |
| secretsmanager | get_secret_value | RO | app/config.py | 15 | my-app/db-password |
aws_iam_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "S3Access",
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::${BUCKET_NAME}/*"]
},
{
"Sid": "DynamoDBAccess",
"Effect": "Allow",
"Action": ["dynamodb:PutItem"],
"Resource": ["arn:aws:dynamodb:us-east-1:123456789012:table/${TABLE_NAME}"]
},
{
"Sid": "SecretsManagerAccess",
"Effect": "Allow",
"Action": ["secretsmanager:GetSecretValue"],
"Resource": ["arn:aws:secretsmanager:us-east-1:123456789012:secret:my-app/db-password-*"]
}
]
}