convez.ai
AgenteDevOps & InfraestruturaAvançado
JacksonMlk

Sentinela — Plataforma AWS FinOps & Segurança

JacksonMlk/sentinela

Análise automatizada de custos + segurança AWS com IA em 10 minutos

Ver no GitHub
BomPluginScore · de 0 a 100

Agent que automatiza análise de contas AWS combinando custos e postura de segurança usando Claude AI. Coleta dados de ~30 fontes AWS em paralelo e gera relatórios contextualizados com matriz de risco-custo, quick wins acionáveis e comandos AWS prontos para remediação em ~10 minutos.

Instalação

$npx convez-ai JacksonMlk/sentinela

1 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

Estrelas
5
Forks
3
Acompanhando
1
Saúde
71%
Último commit
há 6 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Auditoria de contas AWS para consultores FinOps
  • Identificação de recursos custosos E inseguros simultaneamente
  • Geração de planos de ação com economia estimada e comandos CLI prontos

Veredito

Solução robusta dirigida a consultores LATAM que elimina ciclos manuais de 2-3 dias. Integração profunda com AWS (STS, Cost Explorer, IAM, GuardDuty) e uso sofisticado de Claude para contextualização. UI em PT-BR, documentação em EN, deploy via FastAPI.

README

A tradução para o português deste README ainda está na fila.

Sentinela — AWS FinOps & Security Platform

Status Python FastAPI License Last Commit

Multi-tenant platform that analyzes AWS accounts with AI, delivering cost visibility, security posture, and a prioritized action plan in ~10 minutes.

Sentinela — Operations Panel

Note on language: the UI and AI-generated reports are currently in Brazilian Portuguese (target audience: LATAM consultancies). Documentation is in English. Internationalization is on the roadmap.


Why I built this

Working with FinOps and cloud security in consulting, I kept repeating the same manual cycle for every new client account:

  1. Log into the AWS console, open Cost Explorer, export spreadsheets
  2. Run a security checklist across IAM, S3, Security Groups, VPCs
  3. Cross-reference everything in Excel to assemble a "what's expensive and insecure" slide
  4. Write actionable quick wins with aws cli commands and savings estimates

Each report took 2–3 days, and the hardest part — connecting cost to risk — was almost always dropped because it didn't fit the deadline.

Sentinela was built to automate this flow end-to-end:

  • STS AssumeRole removes credential juggling between accounts
  • Parallel collection of ~30 AWS sources (Cost Explorer, EC2, RDS, IAM, GuardDuty, Security Hub…) in a single pass
  • Claude AI turns raw data into contextualized analysis — not generic checklist answers
  • Combined matrix surfaces resources that are both expensive and insecure
  • Read-only client portal delivers the report to the customer without re-exporting PDFs

The result: what used to be 2–3 days of manual work became ~10 minutes of automated analysis.


Screenshots

Consolidated client portfolio, prioritized alerts, FinOps and security scores side by side.

Admin Dashboard

12-month cost trend, breakdown by service/UsageType, anomalies, and forecast.

FinOps Dashboard

Score 0–100, critical/high/medium findings, top issues ranked by score impact.

Security Dashboard

Low-effort actions with estimated USD savings, ready-to-run aws cli commands, and step-by-step instructions.

Quick Wins FinOps

Security quick wins grouped by severity, with remediation commands and score-impact estimates.

Quick Wins Security

Read-only view delivered to the client via a unique token — overview, FinOps, security, quick wins.

Client Portal


Overview

Sentinela automates what used to be done by hand: connecting to each client's AWS account, collecting cost and security data, cross-referencing it, and producing a prioritized report. With Claude AI (Anthropic) integrated into every analysis, each insight is contextualized with the account's real data — not generic recommendations.

What the platform delivers

ModuleWhat it does
FinOps DashboardMonthly cost, 12-month trend, breakdown by service and UsageType, detected anomalies
Maturity ModelScore across 5 dimensions: tagging, rightsizing, commitments, waste elimination, governance
Idle ResourcesDetached EBS volumes, unused EIPs, stopped instances, Load Balancers with no traffic
Security Dashboard0–100 score, critical/high/medium findings, IAM, S3, Security Groups, encryption
Combined AnalysisPriority matrix crossing cost and risk — identifies what is expensive AND insecure at the same time
Quick WinsLow-effort actions with estimated USD savings and step-by-step instructions
ProjectsMedium-term strategic initiatives with projected ROI
Client PortalRead-only link with a unique token for the client to follow progress

Architecture

flowchart TD
    Admin("👤 Operator / Admin"):::navy

    subgraph Platform["  Sentinela Platform  "]
        API("⚡ FastAPI + Jinja2"):::navy
        subgraph Engine["  Analysis Engine  "]
            AWS("☁️ AWS Analyzer\nboto3"):::orange
            AI("🤖 Claude AI\nAnthropic API"):::pink
        end
        DB[("🗄️ Database\nSQLite / PostgreSQL")]:::blue
        subgraph Views["  Dashboards  "]
            V1("Admin Panel"):::chip
            V2("FinOps Dashboard"):::chip
            V3("Security Dashboard"):::chip
            V4("Client Portal"):::chip
        end
    end

    CA("💼 Client A\nAWS Account"):::client
    CB("💼 Client B\nAWS Account"):::client
    CC("💼 Client C\nAWS Account"):::client

    Admin -->|HTTPS| API
    API --> AWS
    API --> AI
    API --> DB
    AWS -.->|STS AssumeRole| CA
    AWS -.->|STS AssumeRole| CB
    AWS -.->|STS AssumeRole| CC

    classDef navy  fill:#0B1956,stroke:none,color:#fff
    classDef orange fill:#FF9900,stroke:none,color:#fff
    classDef pink  fill:#FF679A,stroke:none,color:#fff
    classDef blue  fill:#3B5EDB,stroke:none,color:#fff
    classDef chip  fill:#EEF2F9,stroke:#0B1956,color:#0B1956
    classDef client fill:#fff,stroke:#0B1956,color:#0B1956

Analysis flow

1. Admin registers a client with an IAM Role ARN
         │
         ▼
2. Operator triggers analysis via /admin/clients/{id}/analyze
         │
         ▼
3. aws_analyzer assumes the client's role via STS
   and collects ~30 data sources in parallel:
   Cost Explorer, EC2, RDS, EKS, Lambda, S3,
   IAM, GuardDuty, Security Hub, CloudTrail…
         │
         ▼
4. claude_analyzer sends the data to Claude AI
   and receives structured JSON analysis:
   • FinOps: score, savings, maturity, quick wins
   • Security: score, findings, quick wins
   • Combined: cross-priority matrix
         │
         ▼
5. Results stored in the database and surfaced
   in the admin dashboards + client portal

Detailed technical decisions (why SQLite + PostgreSQL, why STS AssumeRole, why Jinja2 instead of a SPA, etc.) live in docs/ARCHITECTURE.md.


Tech stack

LayerTechnology
BackendPython 3.10+, FastAPI, SQLAlchemy
FrontendJinja2, vanilla HTML/CSS/JS, Chart.js
AIAnthropic Claude API (claude-opus / claude-sonnet)
AWS SDKboto3
DatabaseSQLite (dev) / PostgreSQL (prod)
ContainerizationDocker
OrchestrationKubernetes (EKS)
SchedulingAPScheduler (automatic periodic analyses)

Data collected

FinOps

DataAWS service
Cost by service and UsageType (12 months)Cost Explorer
Next-month forecastCost Explorer
Detected cost anomaliesCost Explorer
Rightsizing recommendationsCompute Optimizer
RI / Savings Plans recommendationsCost Explorer
Detached EBS volumesEC2
Unused Elastic IPsEC2
Old snapshots (+90 days)EC2
Stopped instancesEC2
Idle Load BalancersELBv2
S3 buckets (size, lifecycle)S3 + CloudWatch
CPU/memory metrics per instanceCloudWatch
Extended-support versions (RDS, EKS, Lambda)RDS / EKS / Lambda

Security

DataAWS service
Root MFA, password policyIAM
Users without MFAIAM
Old access keys (+90 days)IAM
Overly permissive policiesIAM
Inactive usersIAM
Public S3 bucketsS3
Unencrypted S3 bucketsS3
Security Groups open to 0.0.0.0/0EC2
VPCs without Flow LogsEC2
Unencrypted EBS volumesEC2
Unencrypted RDS instancesRDS
GuardDuty per regionGuardDuty
CloudTrail statusCloudTrail
Security Hub findingsSecurity Hub
AWS Config failing rulesConfig

Quickstart

Prerequisites

  • Python 3.10+
  • AWS credentials configured locally (CLI or environment variables)
  • An Anthropic API key

Running locally

# 1. Clone and prepare the environment
git clone https://github.com/jacksonmlk/sentinela-opensource.git
cd sentinela-opensource
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt

# 2. Configure environment variables
cp .env.example .env
# edit .env and fill in at least:
#   ANTHROPIC_API_KEY=sk-ant-...
#   ADMIN_SECRET_TOKEN=something-secure
#   AWS_DEFAULT_REGION=us-east-1

# 3. Start the app
uvicorn app.main:app --reload --port 8000

# 4. Open
open http://localhost:8000
# you'll be redirected to /admin/login — use the ADMIN_SECRET_TOKEN from .env

Onboarding your first client

In the client's AWS account, create a role with trust to your operator account and attach the ReadOnlyAccess + SecurityAudit policies. The full walkthrough (trust policy, aws cli commands, credential modes) is in SETUP.md.

Production deploy (EKS)

# Configure variables in deploy.sh and run:
./deploy.sh

Kubernetes manifests live in k8s/. You'll need to:

  • Create an ECR repository
  • Configure the sentinela-env Secret with the variables from .env.example
  • Adjust the IAM Role ARN and domain in k8s/ingress.yaml

Environment variables

VariableRequiredDescription
ANTHROPIC_API_KEY✅Anthropic API key
ANTHROPIC_MODEL✅Claude model (e.g. claude-sonnet-4-6)
ADMIN_SECRET_TOKEN✅Admin panel password
DATABASE_URL✅SQLite or PostgreSQL
AWS_DEFAULT_REGION✅Default AWS region
FINOPS_AWS_PROFILEDevLocal AWS profile for development
COGNITO_*ProdOIDC settings for corporate authentication

Status and known limitations

Sentinela is in beta — it works end-to-end and is used in production, but some rough edges remain:

  • No automated tests yet. The focus so far was validating the flow with real clients. Adding smoke tests + CI is at the top of the list.
  • Schema migrations via manual ALTER TABLE in the FastAPI lifespan (app/main.py) — works for the current schema, but Alembic is the natural next step.
  • AWS only. GCP and Azure are out of scope for now.
  • Multi-tenant by row, not by database. Fits a consultancy workflow; not hardened for a public SaaS model.
  • Anthropic API cost per analysis. A full analysis costs anywhere from a few cents to a few dollars depending on account size and model (Sonnet vs Opus).
  • Portuguese UI. Templates, prompts, and reports are in PT-BR. Internationalization is not yet implemented.

Future ideas

Featured direction — Sentinela v2: autonomous remediation agent

Today Sentinela analyzes and reports. v2 would close the loop:

  • Operator reviews findings in the dashboard and approves what should be fixed
  • A Claude-powered agent executes the remediation: applies bucket policies, tightens IAM, opens a Terraform PR for infra-level changes
  • Dry-run mode shows the exact diff that would be applied before any action touches the account
  • Every action is logged with the approver, the rationale, and the rollback step

This is the natural next step from "what should I do?" to "do it for me, with my approval."

Other directions

Not a formal roadmap — directions that make sense. No timelines.

  • Multi-cloud support (GCP first, then Azure)
  • Smoke tests + CI on GitHub Actions
  • Migrate schema management to Alembic
  • Background-job PDF/Docx export (currently synchronous)
  • Webhook on analysis completion (Slack/Teams/Discord)
  • Historical diff between consecutive analyses of the same client
  • Drift detection — alert when score drops between runs
  • English UI / i18n

Contributions are welcome — see CONTRIBUTING.md.


Security

Found a vulnerability? Please do not open a public issue. See SECURITY.md for the responsible-disclosure channel.


License

MIT © Jackson Santos

Ver o original no GitHub

Bom para

Relacionados