Logo de Database Sentinel

Database Sentinel

Comunidade
Farenhytee

Open-source security audits for Supabase: a read-only MCP server, a CLI agent and a Claude Skill. Finds RLS misconfigurations, exposed keys and risky functions, and returns a scored report with fix SQL. Hosted version: Locksoup.

Publicado porFarenhytee
Repositóriodatabase-sentinel
IdiomaPython
Forks
8
Estrelas
50
Ferramentas disponíveis
0
Tipo de transportestdio
LicençaMIT
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    Database Sentinel disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    50 estrelas e 8 forks no repositório vinculado.

🛡️ Database Sentinel

ci

Security audits for your database backend. Ask "audit my database" and get a scored report with exact fix code.

Works as a Claude Skill (Supabase, MongoDB), a read-only MCP server for any AI client, or a CLI agent that uses your own model (both Supabase).

→ MCP server setup and usage guide

→ Don't want to run it yourself? Locksoup is the hosted version: a Supabase security audit with scheduled re-checks and alerts.


Changelog

2026-10-01 (v1.0.1)

  • Fixed: an UPDATE policy without WITH CHECK is no longer reported as letting users reassign row ownership (Postgres reuses USING as the check). Q8's label and the agent prompt said otherwise, which produced false mass-assignment findings on real projects.
  • Benchmark: new dev case 027 from that project. Test F1 unchanged (0.836 vs 0.838, same day). Runs.

2026-09-30 (docs)

  • MCP flow benchmarked: a model driving the real server over stdio scored test F1 0.865, precision 0.905, critical recall 1.0 (results). Harness: evals/mcp_client.py, eval system m.

v1.0.0 (2026-09-30): MCP server release

  • MCP server v1.0: four read-only Supabase tools, an audit prompt and the catalog resources. Benchmarked end to end: a model driving the server over stdio scored test F1 0.865, with critical recall 1.0.
  • Verified on hosted Supabase: session pooler, read-only role with BYPASSRLS, all 20 queries.
  • Fewer false alarms:
    • Q1 now checks API grants: RLS off with anon/authenticated revoked isn't reported as exposed.
    • The audit prompt knows SECURITY INVOKER functions only have the caller's rights.
    • Found on a real project; new dev case 026.
  • Pin a version: git+https://github.com/Farenhytee/database-sentinel@v1.0.0 in any uvx/pipx command. The Claude Code plugin is pinned automatically.
  • Standard audit is now the CLI default: one prompt plus anon-probe verification, ~$0.0007 and ~15s per audit. --deep runs the tool-using agent, which scored the same on our bench at ~5× the cost.

v0.2.1 (2026-09-30)

  • Test F1: agent 0.782 → 0.831, single-prompt 0.766 → 0.849. No crashes or timeouts (results).
  • Fixed:
    • A bad tool argument no longer ends the audit; the error goes back to the model.
    • OpenRouter calls route to the fastest provider (slow ones caused timeouts).
    • The agent's final findings step no longer lists candidates it had dismissed.

v0.2.0 (2026-09-29)

  • Published test results: agent F1 0.782, single-prompt 0.766, rules 0.559 on a blind, locked 10-case test split, 3 runs each (results).
  • Bench: 25 labeled cases (15 dev, 10 blind test).
  • Agent:
    • Verify step: probes as anon to confirm exploitable findings.
    • --fix: prints fix SQL for findings you pick. It's never executed.
    • Cost reporting: tokens, $ and tool calls for each audit.
  • CI: free rules-only regression gate.

2026-09-29

  • One-command install: Claude Code plugin (skill + MCP server, prompts for your connection string) and an Add to Cursor button.
  • Install from GitHub: one command for the MCP server (uvx --from git+… sentinel-mcp) and the agent (pipx install "database-sentinel[agent] @ git+…").
  • sentinel-mcp --role-sql prints the read-only role setup SQL.
  • Clearer errors: the MCP client now sees why a call failed, and the CLI prints a single-line error.

2026-09-28

  • New: MCP server for Supabase. Four read-only tools, an audit prompt and the pattern catalog as resources. Your own LLM does the analysis, so it's free.
  • New: lite agent (sentinel-audit). A LangGraph pipeline that works with any OpenAI-compatible model: OpenRouter, OpenAI, or local Ollama.
  • New: benchmark + evals. 10 labeled Supabase cases, with precision/recall/F1 compared across a rules baseline, a single-prompt baseline and the agent.
  • Fixed: six Supabase audit queries. Q8 (UPDATE without WITH CHECK) never matched anything, Q16 and Q19 missed rows for least-privilege roles, and Q6, Q13 and Q14 had wrong conditions.

Quick start

Claude Code installs the audit skill and the MCP server in one go (needs uv):

bash
claude plugin marketplace add Farenhytee/database-sentinel
claude plugin install database-sentinel@database-sentinel

Supabase users: create the read-only login (step 1), then run /plugin configure database-sentinel@database-sentinel in Claude Code. Then ask: Audit my database.

Cursor   Add to Cursor

Other MCP clients, and full setup: MCP guide

Skill only (Claude Code picks it up automatically):

bash
git clone https://github.com/Farenhytee/database-sentinel.git ~/.claude/skills/database-sentinel

CLI agent (Supabase, bring your own model):

bash
pipx install "database-sentinel[agent] @ git+https://github.com/Farenhytee/database-sentinel"
export SENTINEL_BASE_URL=http://localhost:11434/v1 SENTINEL_MODEL=<model>   # Ollama, or any OpenAI-compatible API + SENTINEL_API_KEY
sentinel-audit --dsn "postgresql://sentinel_auditor:<password>@<host>:5432/postgres" \
  --rest-url https://<ref>.supabase.co --anon-key <anon key> --repo ./my-app

The default audit is one prompt plus anon-probe verification. --deep runs a tool-using agent instead: same accuracy on our bench, ~5× the cost. --fix prints fix SQL for the findings you pick; it's never executed.


What it catches

BackendPatternsExamples
Supabase27 (catalog)RLS disabled, service-role key in frontend, USING (true), views bypassing RLS, exposed SECURITY DEFINER functions, user_metadata in policies, mass assignment, public buckets
MongoDB20 (catalog)MongoBleed (CVE-2025-14847), auth disabled, 0.0.0.0/0 Atlas allowlist, server-side JS, privileged app user

Full tables are in Appendix A.

Safety

  • Read-only by default. Only system catalogs are read. The MCP server and agent can't write, drop or delete anything.
  • Your rows are never read. The audit role has no access to table data. Repo scans report file and line, never secret values.
  • Write and network probes are opt-in (Skill only). Details are in Appendix D.

Status

BackendSkillMCP server / agent
Supabase✅✅
MongoDB✅planned
Firebase, Postgres, MySQL, cross-backendplannedplanned

License

MIT. Exception: database_sentinel/agent/, database_sentinel/mcp_server/ and database_sentinel/kb/ are AGPL-3.0 (see the LICENSE in each).


Appendix

A. Pattern highlights

Supabase

SeverityPatternWhat
🔴 CRITICALRLS_DISABLEDTables without Row-Level Security are fully exposed
🔴 CRITICALSERVICE_ROLE_EXPOSEDservice_role key in frontend code bypasses all security
🔴 CRITICALPOLICIES_BUT_NO_RLSPolicies written but RLS never enabled
🟠 HIGHUSING_TRUEUSING (true) on writes or private data
🟠 HIGHVIEW_NO_SECURITY_INVOKERViews bypass RLS and run as their owner
🟠 HIGHSECURITY_DEFINER_EXPOSEDRLS-bypassing functions callable via the API
🟠 HIGHUSER_METADATA_IN_POLICYPolicies trust user-editable metadata
🟠 HIGHMASS_ASSIGNMENTUsers can update privilege/billing columns on their own rows
🟠 HIGHGHOST_AUTHUnconfirmed sign-ups get authenticated sessions
🟠 HIGHJWT_SECRET_EXPOSEDLeaked signing secret lets attackers forge any token
🟡 MEDIUM+ 17 moreanti-patterns.md

MongoDB

SeverityPatternWhat
🔴 CRITICALMG-SH-001 MongoBleed (CVE-2025-14847, CISA KEV)Pre-auth heap memory disclosure; ~87K instances exposed at disclosure
🔴 CRITICALMG-SH-002 Auth disabledNo authentication (Meow ransomware surface)
🔴 CRITICALMG-SH-003 Internet-bound mongod--bind_ip_all + reachable 27017
🔴 CRITICALMG-AT-001 Atlas allowlist 0.0.0.0/0Cluster reachable from anywhere
🟠 HIGHMG-SH-005 Server-side JS enabled$where / $function / mapReduce reachable
🟠 HIGHMG-SH-007 Privileged app userApp connects as root / dbAdminAnyDatabase
🟠 HIGHMG-AT-002 Atlas Function pass-throughNoSQL injection over HTTPS
🟡 MEDIUM+ 13 moreanti-patterns.md

The MongoBleed probe (mongobleed-probe.md) is a single-packet, read-only detector. It was verified against mongo:7.0.20 (vulnerable) and 7.0.28 (patched), and runs only after two opt-in confirmations.

B. How the Skill audits

  1. Detect backends. 2. Scan code for exposed credentials. 3. Introspect schema, policies and config. 4. Match against the anti-pattern catalogs. 5. Probe safely (opt-in). 6. Score and report. 7. Generate fix code.

Only SKILL.md (~2K tokens) and core/* load up front; each backend's files load only when that backend is detected.

C. Example output

╔════════════════════════════════════════════════════════╗
║                  SENTINEL SECURITY AUDIT               ║
║  Backends: supabase        Score: 35/100 🔴            ║
╚════════════════════════════════════════════════════════╝

🔴 CRITICAL — public.users: RLS Disabled                  [RLS_DISABLED]
  Risk:   Anyone on the internet can read your entire users table.
  Attack: Copy the anon key from DevTools → curl the API → dump all rows.
  Source: CVE-2025-48757 / Splinter 0013_rls_disabled_in_public
  Fix:    ALTER TABLE public.users ENABLE ROW LEVEL SECURITY;
          CREATE POLICY "users_select_own" ON public.users FOR SELECT
            TO authenticated USING ((SELECT auth.uid()) = id);

D. Safety details

  • Supabase write probes: Prefer: tx=rollback, so no data is modified.
  • MongoDB write probes: session + abortTransaction() on replica sets; canary insert + delete on standalone (opt-in).
  • MongoBleed network probe: double opt-in; some monitoring tools alert on the 42-byte probe packet.
  • Auth probes use .invalid email domains (RFC 6761).
  • Credentials are held in memory for the audit only, and redacted in reports.
  • MCP server: five independent read-only layers (details).

E. Benchmark and evals

bench/cases/ holds labeled Supabase schemas applied to a local Supabase. evals/ scores three systems on precision, recall and F1: R0 (rules, no LLM), B0 (single prompt) and A (agent). The test split is frozen and never tuned on.

Test split (10 blind, locked cases), deepseek-v4-flash, 3 runs each:

VersionSystemPrecisionRecallF1CRITICAL recall$/audit
v1.0.0MCP server (model as MCP client, details)0.9050.8330.8651.000$0.0037
v0.2.1A (agent)0.8510.8180.8311.000$0.0044
v0.2.1B0 (single prompt)0.8100.8940.8491.000$0.0008
v0.2.0 (frozen, details)A (agent)0.7740.8030.7821.000$0.0024
v0.2.0 (frozen)B0 (single prompt)0.7950.7430.7660.889$0.0016
bothR0 (rules)0.4130.8640.5591.000$0

v0.2.1 fixes the crashes and timeouts seen in the v0.2.0 test run. The fixes were diagnosed on dev only, but they came from test failures, so v0.2.0 is the blind number (v0.2.1 details). A and B0 are within noise of each other. The agent is more precise, gives fewer false alarms on clean projects and verifies findings as anon, at ~5× the cost.

bash
pip install -e ".[dev]" && supabase start && python -m evals.run --split dev

F. Continuous monitoring (GitHub Actions)

Templates: github-action-supabase.yml and github-action-mongodb.yml. They run on migration, rule or IaC changes, weekly, or manually, then comment on the PR and fail the build on critical findings. Ask Claude: "Set up continuous security monitoring for this project."

G. Repo layout

SKILL.md, core/, backends/{supabase,mongodb}/, references/   Claude Skill (MIT)
database_sentinel/mcp_server/                                MCP server (AGPL)
database_sentinel/agent/                                     lite agent (AGPL)
bench/, evals/, tests/, supabase/                            benchmark, eval harness, local Supabase
docs/mcp.md                                                  MCP setup guide
compat/supabase-sentinel/                                    old skill name shim

H. Research sources

CVE-2025-48757 (170+ Lovable apps), Escape.tech (2,000+ vulns in 5,600 vibe-coded apps), Veracode (45% of AI code has OWASP Top 10 issues), CMU SusVibes, ModernPentest (20.1M rows, 107 YC startups), Supabase Splinter lints, CVE-2025-14847 MongoBleed, Mongoose CVE-2024-53900 / CVE-2025-23061, CIS MongoDB 7 Benchmark. Full list: vibe-coding-context.md, cve-feed.md.

I. Contributing

Most valuable: new anti-patterns with evidence (CVE, breach report, or lint), better fix templates, false-positive/negative reports from live use, and new backends following backends/supabase/. Fork, branch, and open a PR with the pattern and its source. Contributions to the AGPL directories need a CLA.

J. Naming history

Supabase Sentinel (v1) → Database Sentinel (v3, multi-backend). The supabase-sentinel name still works through compat/supabase-sentinel/.

Use o MCP de Database Sentinel com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar Database Sentinel, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione Database Sentinel como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de Database Sentinel.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "database-sentinel": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de Database Sentinel, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de Database Sentinel.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar Database Sentinel para me ajudar nesta tarefa?
Database Sentinel
Claro. Já li.
Veja o que encontrei usando Database Sentinel.

Perguntas frequentes

Para que serve o servidor MCP Database Sentinel?

Database Sentinel é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP Database Sentinel com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar Database Sentinel com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP Database Sentinel com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com Database Sentinel conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP Database Sentinel ao TypingMind?

Database Sentinel funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP Database Sentinel oferece no TypingMind?

Database Sentinel disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP Database Sentinel?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se Database Sentinel exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇