Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitLabGitLab/reyjesusq/sentinel-mcp
Defensive ToolsCloud SecurityIntrusion DetectionIncident ResponseAI SecurityAnomaly Detection
GitLabreyjesusq/sentinel-mcp

sentinel-mcp

Autonomous AI-powered cyber defense system using MCP, Gemini 2.0 Flash, Dynatrace observability and MongoDB. Google Cloud Hackathon submission.

View Repository
73 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

SentinelMCP — AI-Powered Cyber Defense System

Google Cloud Hackathon submission — Autonomous threat detection and remediation orchestrated by Google Cloud Agent Builder (Vertex AI Agent), powered by Gemini 2.0 Flash, Model Context Protocol (MCP), and Dynatrace observability.

Agent Builder Gemini 2.0 Flash Dynatrace MongoDB MCP Protocol


The Problem

Security teams face 30-minute MTTD and 4-hour MTTR for typical incidents. By the time a human analyst detects the attack, writes the firewall rule, and deploys it, the damage is done.

The Solution

SentinelMCP reduces MTTD to < 30 seconds and MTTR to < 30 seconds by deploying a Google Cloud Agent Builder agent that receives Dynatrace anomaly webhooks, reasons over them with Gemini 2.0 Flash, and invokes real defense tools via MCP — acting on live infrastructure, not just alerting.

root@kitploit:~
Dynatrace webhook  →  Agent Builder receives alert  →  Gemini reasons  →  MCP tools execute  →  Threat neutralized
       1 s                        2 s                      8 s                  15 s                  25 s total

The result: an incident lifecycle that previously required a human analyst and 4 hours now completes autonomously in under 30 seconds, with a full audit trail in MongoDB and distributed traces in Jaeger.


Architecture

root@kitploit:~
┌──────────────────────────────────────────────────────────────────────┐
│                         SANDBOX ENVIRONMENT                          │
│                                                                      │
│   ┌─────────────┐   100–1000 req/s   ┌──────────────────────────┐   │
│   │  attacker   │ ──────────────────►│    victim-service        │   │
│   │ (DDoS/SQLi) │                    │    port 8080             │   │
│   └─────────────┘                    │    /admin/* control API  │   │
│                                      └────────────┬─────────────┘   │
└───────────────────────────────────────────────────│──────────────────┘
                                                    │ metrics + anomaly webhook
                   ┌────────────────────────────────▼─────────────────┐
                   │         Dynatrace Mock  (anomaly engine)          │
                   │  Threat Risk Score → fires POST /alerts/simulate  │
                   └────────────────────────┬─────────────────────────┘
                                            │ webhook
          ┌─────────────────────────────────▼──────────────────────────┐
          │          Google Cloud Agent Builder  (Vertex AI Agent)      │
          │  ┌──────────────────────────────────────────────────────┐  │
          │  │  Gemini 2.0 Flash  ──  reasons over threat context   │  │
          │  │  Tool manifest  ──  dynamically fetched from MCP     │  │
          │  │  HITL gate  ──  halts if confidence < threshold      │  │
          │  └──────────────────────────────────────────────────────┘  │
          └──────────────┬─────────────────────────┬───────────────────┘
                         │ REST calls                │ audit write
         ┌───────────────▼──────┐      ┌────────────▼──────────┐
         │  MCP Server  :8001   │      │  MongoDB 7.0  Atlas   │
         │  11 real tools       │      │  incidents + traces   │
         └───────────┬──────────┘      └───────────────────────┘
                     │ acts on live infra
         ┌───────────▼──────────┐
         │  FastAPI  :8000      │
         │  victim-service :8080│
         └──────────────────────┘

                   ┌──────────────────────────────────────────────────┐
                   │              OBSERVABILITY STACK                  │
                   │  OTel Collector ──► Jaeger  (distributed traces)  │
                   │  Prometheus ──────────────► Grafana               │
                   └──────────────────────────────────────────────────┘

Key design principle: Graceful degradation + Human-in-the-Loop (HITL). The Agent Builder agent halts safely and hands control back to the operator when it cannot reach a decision with sufficient confidence — it never guesses on critical infrastructure.


Live Demo — Google Cloud Run

All three services are deployed and running on Google Cloud Run:

Run a live attack against production:

root@kitploit:~
.\attack.production.ps1 status   # verify all services healthy
.\attack.production.ps1 ddos     # DDoS — Gemini blocks IPs + rate limit
.\attack.production.ps1 sql      # SQL Injection — Gemini activates WAF
.\attack.production.ps1 brute    # Brute Force — Gemini blocks source IPs
.\attack.production.ps1 stop     # reset defenses

The attacker container runs locally and targets the Cloud Run victim-service over HTTPS. Watch the Command Center dashboard for the full detection → reasoning → neutralization cycle in real time.


How it uses Google Cloud Agent Builder

Google Cloud Agent Builder (Vertex AI ReasoningEngine) is the central orchestrator of SentinelMCP. The implementation lives in sentinel_mcp/agent/agent_builder.py.

SentinelAgent inherits from vertexai.preview.reasoning_engines.Queryable — the official Agent Builder programmatic interface — and can run locally or be deployed to the managed Agent Builder service with a single command.

Key code — sentinel_mcp/agent/agent_builder.py:

root@kitploit:~
class SentinelAgent(reasoning_engines.Queryable):

    def set_up(self):
        # MCP tools as Vertex AI FunctionDeclarations — Gemini selects at runtime
        mcp_tools = Tool(function_declarations=[
            FunctionDeclaration(name="block_ip_address", ...),
            FunctionDeclaration(name="activate_waf", ...),
            FunctionDeclaration(name="rate_limit_requests", ...),
            FunctionDeclaration(name="scale_service", ...),
            FunctionDeclaration(name="collect_forensic_logs", ...),
            FunctionDeclaration(name="analyze_attack_pattern", ...),
        ])
        self._model = GenerativeModel("gemini-2.0-flash-001", tools=[mcp_tools])
        self._chat = self._model.start_chat()

    def query(self, *, incident: dict) -> dict:
        # Entry point — Agent Builder calls this for every Dynatrace webhook
        response = self._chat.send_message(threat_prompt(incident))
        tool_calls = [{"name": p.function_call.name, "args": dict(p.function_call.args)}
                      for p in response.candidates[0].content.parts if p.function_call]
        return {"engine": "agent_builder", "tool_calls": tool_calls, ...}

Deploy to Google Cloud Agent Builder:

root@kitploit:~
# Test locally (no GCP needed with google_ai_studio backend)
python scripts/deploy_agent_builder.py --test-only

# Deploy to managed Agent Builder endpoint
python scripts/deploy_agent_builder.py --project my-gcp-project

Set Agent Builder as the active backend:

root@kitploit:~
# .env
GEMINI_BACKEND=agent_builder
GOOGLE_CLOUD_PROJECT=my-gcp-project
VERTEX_LOCATION=us-central1

How it uses Dynatrace & MCP

Dynatrace

SentinelMCP integrates Dynatrace observability at three layers:

  1. OpenTelemetry pipeline — The sentinel-otel-collector ingests spans and metrics from the FastAPI core and forwards them to the Dynatrace Mock endpoint (OTLP/HTTP :14318). Every incident, tool execution, and LLM call is traced end-to-end with full correlation IDs.

  2. Anomaly Engine with auto-trigger — dynatrace-mock runs a background loop that monitors http_requests_total, computes a Threat Risk Score (dynatrace_mock_sentinel_risk_score, 0–10), and fires POST /api/v1/alerts/simulate/{type} to SentinelMCP automatically when the score crosses the critical threshold — replicating the exact behavior of a production Dynatrace Davis anomaly detection webhook.

  3. Grafana dashboard fed by Dynatrace metrics — The Risk Score gauge and timeline consume dynatrace_mock_sentinel_risk_score directly, making it possible to visualize the precise moment Dynatrace flagged the anomaly versus the moment SentinelMCP achieved neutralization.

MCP (Model Context Protocol)

The Gemini agent discovers its defense capabilities dynamically at runtime — no hardcoded tool lists, no prompt rewriting when capabilities change:

root@kitploit:~
GET /mcp/tools  →  returns 11 tool descriptors  →  Gemini selects and invokes tools

Each tool is labeled REAL or Audit-Only in the live catalog. Gemini reads this flag, understands what it can actually do on live infrastructure, and justifies every tool selection in its reasoning trace. Adding a new defense capability requires zero prompt engineering.

Tools that act on live infrastructure:


Quick Start

Requirements: Docker Desktop 24+, Google Cloud credentials or AI Studio API key, ~3 GB disk, ~2 GB RAM.

1 — Start the stack

root@kitploit:~
docker compose up -d --build

First run downloads base images (~3 GB, 5–10 min). Subsequent runs take under 1 minute.

2 — Start the simulation sandbox

root@kitploit:~
cd simulacion
docker compose up -d victim-service
cd ..

3 — Verify everything is up

root@kitploit:~
docker compose ps
# Expected: 8 services running/healthy

curl http://localhost:8000/health
# Expected: {"status": "healthy", "service": "SentinelMCP", ...}

4 — Launch an attack and watch the AI defend

root@kitploit:~
.\attack.ps1 ddos        # DDoS attack (default)
.\attack.ps1 sql         # SQL Injection
.\attack.ps1 brute       # Brute Force
.\attack.ps1 stop        # Stop attack + reset defenses
.\attack.ps1 status      # Check system state

Open the Command Center while the attack runs:

root@kitploit:~
http://localhost:8000/dashboard

Watch the 4 phases in ~25 seconds:

  1. THREAT DETECTED — Dynatrace fires the alert
  2. DEFENDING — Gemini reads the MCP tool catalog, selects actions, logs reasoning
  3. Tool execution — IPs blocked, WAF enabled, rate limit applied (all real)
  4. NEUTRALIZED — MTTD and MTTR displayed with full audit trail

5 — Configure Google Cloud (Vertex AI)

SentinelMCP is built on Gemini. Choose the authentication method that fits your environment:

Option A — Google AI Studio (fastest setup):

root@kitploit:~
# Edit .env
GOOGLE_API_KEY=AIza...your_key_here
GEMINI_BACKEND=google_ai_studio

Option B — Vertex AI on Google Cloud:

root@kitploit:~
gcloud auth application-default login
.\scripts\setup_gcloud.ps1   # sets project, creates SA key, updates .env automatically

Then restart the AI engine: docker compose restart api


All Interfaces

Production (Google Cloud Run)

Local (Docker Compose)


Attack Scenarios


MCP Tool Registry (11 tools)

root@kitploit:~
GET http://localhost:8001/mcp/tools

SentinelMCP employs a Fail-Safe Audit Mode. If target infrastructure is unreachable, the agent records intended actions without breaking the pipeline, ensuring graceful degradation. Gemini reads the REAL / Audit-Only flag in the catalog — it knows precisely what it can execute versus what it can only recommend.


Project Structure

root@kitploit:~
sentinel_mcp/
├── api/              FastAPI core — routes, schemas, dashboard UI
├── agent/            Decision engine + LLM providers (Gemini 2.0 Flash, Vertex AI)
├── mcp_server/       MCP server + 11 tool implementations
├── services/         Incident service, remediation orchestrator, threat calculator
├── observability/    OTel / Dynatrace / SigNoz providers
└── core/             Config, logging, exceptions

simulacion/
├── victim-service/   FastAPI target service with /admin/* control plane
└── attacker/         Python attack engine (DDoS / SQLi / brute force)

docker/
├── prometheus.yml    Scrape config (victim-service at 5s interval)
└── grafana/          Auto-provisioned dashboard — 6-panel infrastructure witness

Tech Stack

Download Tool
ServiceURL
Command Center (Dashboard)https://sentinel-api-62d3d66zda-uc.a.run.app/dashboard
Swagger API Docshttps://sentinel-api-62d3d66zda-uc.a.run.app/docs
Health Checkhttps://sentinel-api-62d3d66zda-uc.a.run.app/health
MCP Tool Cataloghttps://sentinel-mcp-62d3d66zda-uc.a.run.app/mcp/tools
Victim Servicehttps://victim-service-62d3d66zda-uc.a.run.app
ResponsibilityImplementation
Webhook intakeSentinelAgent.query(incident=...) — called by Agent Builder on every Dynatrace alert
Tool declarations6 MCP tools registered as Vertex AI FunctionDeclaration objects in set_up()
ReasoningGemini 2.0 Flash reads threat context + tool catalog, selects the minimum tools, auto-invokes them
HITL gateIf Gemini returns no tool calls (confidence < threshold), escalate_to_humans=True is emitted
AuditEvery tool call logged in MongoDB Atlas + exported as OTel span to Jaeger
ToolWhat it does
block_ip_addressPOST /admin/block_ip — blocks attacker IPs in the running middleware
activate_wafPOST /admin/waf — enables WAF blocking mode in the running service
rate_limit_requestsPOST /admin/rate_limit — sliding-window rate limiter, active immediately
scale_serviceDocker SDK over socket — starts real replica containers under load
rollbackPOST /admin/reset_defenses — demonstrates full incident lifecycle: attack → defend → restore
collect_forensic_logsCaptures real evidence from running containers for post-incident review
build_attack_timelineChronological timeline from live container logs
analyze_attack_patternClassifies attack type with real incident context data
identify_iocsExtracts real IPs, user-agents, and payloads from live incident files
URLWhat it shows
https://sentinel-api-62d3d66zda-uc.a.run.app/dashboardCommand Center — main demo UI
https://sentinel-api-62d3d66zda-uc.a.run.app/docsSwagger — interactive API explorer
https://sentinel-api-62d3d66zda-uc.a.run.app/healthHealth check
https://sentinel-api-62d3d66zda-uc.a.run.app/api/v1/incidentsIncident history (JSON)
https://sentinel-mcp-62d3d66zda-uc.a.run.app/mcp/toolsLive MCP tool catalog as read by Gemini
https://victim-service-62d3d66zda-uc.a.run.appVictim service (the target under attack)
URLWhat it shows
http://localhost:8000/dashboardCommand Center — main demo UI
http://localhost:8000/docsSwagger — interactive API explorer
http://localhost:8000/api/v1/incidentsIncident history (JSON)
http://localhost:8000/api/v1/incidents/statistics/summaryMTTD / MTTR averages across all incidents
http://localhost:8001/mcp/toolsLive MCP tool catalog as read by Gemini
http://localhost:8080Victim service (the target under attack)
http://localhost:14499Dynatrace Mock — live metrics + anomaly engine
http://localhost:16686Jaeger — distributed traces
http://localhost:9090Prometheus — raw metrics
http://localhost:3000Grafana — infrastructure dashboard (admin / admin)
ScenarioScriptWhat happens
DDoS.\attack.ps1 ddos1000 req/s flood; Gemini blocks IPs + enables rate limit
SQL Injection.\attack.ps1 sqlPayload detection; Gemini activates WAF in blocking mode
Brute Force.\attack.ps1 bruteLogin hammering; Gemini blocks source IPs + enables WAF
Auto-modeDashboard 🎯 Auto ONRandom attacks every 45–90s, fully autonomous response
ToolCategoryMode
analyze_attack_patternanalysisREAL
identify_iocsanalysisREAL
block_ip_addressdefenseREAL → victim-service
activate_wafdefenseREAL → victim-service
rate_limit_requestsdefenseREAL → victim-service
scale_servicedefenseREAL → Docker SDK
collect_forensic_logsforensicREAL
build_attack_timelineforensicREAL
patch_vulnerabilitiesremediationAudit-Only
apply_hardeningremediationAudit-Only
rollbackremediationREAL → victim-service
LayerTechnology
Agent OrchestratorGoogle Cloud Agent Builder (Vertex AI Agent)
LLMGemini 2.0 Flash — via google-genai SDK
Tool protocolMCP (Model Context Protocol) — 11 real tools
APIFastAPI + Uvicorn (Python 3.11)
DatabaseMongoDB 7.0 Atlas (Motor async)
ObservabilityOpenTelemetry → Dynatrace
TracingJaeger
MetricsPrometheus + Grafana
HTTP clienthttpx (async)
Container orchestrationDocker Compose v2