Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
sentinel-mcp — MCP, Gemini 2.0 Flash, Dynatrace observability 및 MongoDB를 사용하는 자율 AI 기반 사이버 방어 시스템. Google Cloud Hackathon 제출물. | Kitploit
도구/GitLabGitLab/reyjesusq/sentinel-mcp
Defensive ToolsCloud SecurityIntrusion DetectionIncident ResponseAI SecurityAnomaly Detection
GitLabreyjesusq/sentinel-mcp

sentinel-mcp

MCP, Gemini 2.0 Flash, Dynatrace observability 및 MongoDB를 사용하는 자율 AI 기반 사이버 방어 시스템. Google Cloud Hackathon 제출물.

저장소 보기
73개월 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

SentinelMCP — AI 기반 사이버 방어 시스템

Google Cloud Hackathon 제출작 — Google Cloud Agent Builder (Vertex AI Agent) 가 오케스트레이션하는 자동 위협 탐지 및 대응 시스템, Gemini 2.0 Flash, Model Context Protocol (MCP), Dynatrace 관찰 가능성 기반.

Agent Builder Gemini 2.0 Flash Dynatrace MongoDB MCP Protocol


문제점

보안 팀은 일반적인 사고에 대해 MTTD 30분 및 MTTR 4시간에 직면합니다. 인간 분석가가 공격을 탐지하고, 방화벽 규칙을 작성하고, 배포할 때쯤이면 피해는 이미 발생한 후입니다.

해결책

SentinelMCP는 Google Cloud Agent Builder 에이전트를 배포하여 MTTD를 <30초로, MTTR을 <30초로 단축합니다. 이 에이전트는 Dynatrace 이상 웹훅을 수신하고, Gemini 2.0 Flash를 통해 추론하며, MCP를 통해 실제 방어 도구를 호출하여 실시간 인프라에 조치를 취합니다(단순 알림이 아닌).

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

결과: 이전에는 인간 분석가와 4시간이 필요했던 사고 생애 주기가 이제 30초 미만으로 자동 완료되며, MongoDB에 전체 감사 추적이, Jaeger에 분산 추적이 저장됩니다.


아키텍처

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               │
                   └──────────────────────────────────────────────────┘

핵심 설계 원칙: 우아한 성능 저하 + 인간 개입 루프(HITL). Agent Builder 에이전트는 충분한 신뢰도로 결정을 내릴 수 없을 때 안전하게 중단하고 운영자에게 제어권을 넘깁니다 — 중요한 인프라에서 추측하지 않습니다.


라이브 데모 — Google Cloud Run

세 가지 서비스가 모두 Google Cloud Run에 배포되어 실행 중입니다.

프로덕션 환경에 라이브 공격 실행:

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

공격자 컨테이너는 로컬에서 실행되며 Cloud Run victim-service를 HTTPS로 대상으로 합니다. Command Center 대시보드에서 탐지 → 추론 → 무력화 사이클을 실시간으로 확인하세요.


Google Cloud Agent Builder 사용 방법

Google Cloud Agent Builder (Vertex AI ReasoningEngine) 는 SentinelMCP의 중앙 오케스트레이터입니다. 구현은 sentinel_mcp/agent/agent_builder.py에 있습니다.

SentinelAgent는 vertexai.preview.reasoning_engines.Queryable을 상속받습니다. 이는 공식 Agent Builder 프로그래매틱 인터페이스이며, 로컬에서 실행하거나 단일 명령으로 관리형 Agent Builder 서비스에 배포할 수 있습니다.

핵심 코드 — 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, ...}

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

Agent Builder를 활성 백엔드로 설정:

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

Dynatrace 및 MCP 사용 방법

Dynatrace

SentinelMCP는 세 가지 계층에서 Dynatrace 관찰 가능성을 통합합니다.

  1. OpenTelemetry 파이프라인 — sentinel-otel-collector는 FastAPI 코어에서 스팬과 메트릭을 수집하여 Dynatrace Mock 엔드포인트(OTLP/HTTP :14318)로 전달합니다. 모든 사고, 도구 실행, LLM 호출은 전체 상관 ID와 함께 종단 간 추적됩니다.

  2. 자동 트리거 이상 엔진 — dynatrace-mock는 백그라운드 루프를 실행하여 http_requests_total을 모니터링하고, 위협 위험 점수(dynatrace_mock_sentinel_risk_score, 0–10)를 계산하며, 점수가 임계 임계값을 초과하면 자동으로 POST /api/v1/alerts/simulate/{type}을 SentinelMCP로 전송합니다. 이는 프로덕션 Dynatrace Davis 이상 탐지 웹훅의 정확한 동작을 복제합니다.

  3. Dynatrace 메트릭을 사용하는 Grafana 대시보드 — 위험 점수 게이지와 타임라인은 dynatrace_mock_sentinel_risk_score를 직접 사용하므로, Dynatrace가 이상을 플래그한 정확한 순간과 SentinelMCP가 무력화를 달성한 순간을 시각화할 수 있습니다.

MCP (Model Context Protocol)

Gemini 에이전트는 런타임에 동적으로 방어 기능을 검색합니다. 하드코딩된 도구 목록이 없으며, 기능이 변경될 때 프롬프트를 다시 작성할 필요가 없습니다.

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

각 도구는 라이브 카탈로그에서 REAL 또는 Audit-Only로 레이블이 지정됩니다. Gemini는 이 플래그를 읽고, 라이브 인프라에서 실제로 수행할 수 있는 작업을 이해하며, 추론 추적에서 각 도구 선택을 정당화합니다. 새로운 방어 기능을 추가하는 데 프롬프트 엔지니어링이 전혀 필요하지 않습니다.

라이브 인프라에서 작동하는 도구:


빠른 시작

요구 사항: Docker Desktop 24+, Google Cloud 자격 증명 또는 AI Studio API 키, 약 3GB 디스크, 약 2GB RAM.

1 — 스택 시작

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

첫 실행은 기본 이미지를 다운로드합니다(~3GB, 5–10분). 이후 실행은 1분 미만이 소요됩니다.

2 — 시뮬레이션 샌드박스 시작

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

3 — 모든 서비스가 실행 중인지 확인

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

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

4 — 공격을 시작하고 AI가 방어하는 모습을 확인

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

공격이 실행되는 동안 Command Center를 엽니다.

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

약 25초 동안 4단계를 확인하세요.

  1. THREAT DETECTED — Dynatrace가 알림을 발송
  2. DEFENDING — Gemini가 MCP 도구 카탈로그를 읽고, 작업을 선택하고, 추론을 기록
  3. 도구 실행 — IP 차단, WAF 활성화, 속도 제한 적용(모두 실제)
  4. NEUTRALIZED — 전체 감사 추적과 함께 MTTD 및 MTTR 표시

5 — Google Cloud (Vertex AI) 구성

SentinelMCP는 Gemini를 기반으로 구축되었습니다. 환경에 맞는 인증 방법을 선택하세요.

옵션 A — Google AI Studio (가장 빠른 설정):

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

옵션 B — Google Cloud의 Vertex AI:

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

그런 다음 AI 엔진을 다시 시작하세요. docker compose restart api


모든 인터페이스

프로덕션 (Google Cloud Run)

로컬 (Docker Compose)


공격 시나리오


MCP 도구 레지스트리(11개 도구)

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

SentinelMCP는 안전 장치 감사 모드(Fail-Safe Audit Mode) 를 사용합니다. 대상 인프라에 연결할 수 없는 경우 에이전트는 의도한 작업을 기록하여 파이프라인을 중단시키지 않으므로 우아한 성능 저하를 보장합니다. Gemini는 카탈로그에서 REAL/Audit-Only 플래그를 읽습니다. 실행할 수 있는 작업과 권장만 할 수 있는 작업을 정확히 알고 있습니다.


프로젝트 구조

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

기술 스택

도구 다운로드
서비스URL
커맨드 센터(대시보드)https://sentinel-api-62d3d66zda-uc.a.run.app/dashboard
Swagger API 문서https://sentinel-api-62d3d66zda-uc.a.run.app/docs
상태 확인https://sentinel-api-62d3d66zda-uc.a.run.app/health
MCP 도구 카탈로그https://sentinel-mcp-62d3d66zda-uc.a.run.app/mcp/tools
Victim 서비스https://victim-service-62d3d66zda-uc.a.run.app
책임구현
웹훅 수신SentinelAgent.query(incident=...) — 모든 Dynatrace 알림에 대해 Agent Builder가 호출
도구 선언set_up()에서 Vertex AI FunctionDeclaration 객체로 등록된 6개의 MCP 도구
추론Gemini 2.0 Flash가 위협 컨텍스트 + 도구 카탈로그를 읽고 최소 도구를 선택하여 자동 호출
HITL 게이트Gemini가 도구 호출을 반환하지 않으면(신뢰도 < 임계값) escalate_to_humans=True를 내보냄
감사모든 도구 호출이 MongoDB Atlas에 기록되고 OTel 스팬으로 Jaeger에 내보내짐
도구기능
block_ip_addressPOST /admin/block_ip — 실행 중인 미들웨어에서 공격자 IP 차단
activate_wafPOST /admin/waf — 실행 중인 서비스에서 WAF 차단 모드 활성화
rate_limit_requestsPOST /admin/rate_limit — 슬라이딩 윈도우 속도 제한기, 즉시 활성화
scale_service소켓을 통한 Docker SDK — 부하가 걸리면 실제 복제 컨테이너 시작
rollbackPOST /admin/reset_defenses — 전체 사고 생애 주기 시연: 공격 → 방어 → 복원
collect_forensic_logs사후 분석을 위해 실행 중인 컨테이너에서 실제 증거 수집
build_attack_timeline라이브 컨테이너 로그에서 시간순 타임라인 구축
analyze_attack_pattern실제 사고 컨텍스트 데이터로 공격 유형 분류
identify_iocs라이브 사건 파일에서 실제 IP, 사용자 에이전트, 페이로드 추출
URL표시 내용
https://sentinel-api-62d3d66zda-uc.a.run.app/dashboard커맨드 센터 — 주요 데모 UI
https://sentinel-api-62d3d66zda-uc.a.run.app/docsSwagger — 대화형 API 탐색기
https://sentinel-api-62d3d66zda-uc.a.run.app/health상태 확인
https://sentinel-api-62d3d66zda-uc.a.run.app/api/v1/incidents사고 기록 (JSON)
https://sentinel-mcp-62d3d66zda-uc.a.run.app/mcp/toolsGemini가 읽는 라이브 MCP 도구 카탈로그
https://victim-service-62d3d66zda-uc.a.run.appVictim 서비스 (공격 대상)
URL표시 내용
http://localhost:8000/dashboard커맨드 센터 — 주요 데모 UI
http://localhost:8000/docsSwagger — 대화형 API 탐색기
http://localhost:8000/api/v1/incidents사고 기록 (JSON)
http://localhost:8000/api/v1/incidents/statistics/summary모든 사고에 대한 MTTD / MTTR 평균
http://localhost:8001/mcp/toolsGemini가 읽는 라이브 MCP 도구 카탈로그
http://localhost:8080Victim 서비스 (공격 대상)
http://localhost:14499Dynatrace Mock — 라이브 메트릭 + 이상 엔진
http://localhost:16686Jaeger — 분산 추적
http://localhost:9090Prometheus — 원시 메트릭
http://localhost:3000Grafana — 인프라 대시보드 (admin / admin)
시나리오스크립트발생 상황
DDoS.\attack.ps1 ddos1000 req/s 플러드; Gemini가 IP 차단 + 속도 제한 활성화
SQL 인젝션.\attack.ps1 sql페이로드 탐지; Gemini가 WAF를 차단 모드로 활성화
무차별 대입.\attack.ps1 brute로그인 공격; Gemini가 소스 IP 차단 + WAF 활성화
자동 모드대시보드 🎯 Auto ON45–90초마다 무작위 공격, 완전 자율 대응
도구카테고리모드
analyze_attack_pattern분석REAL
identify_iocs분석REAL
block_ip_address방어REAL → victim-service
activate_waf방어REAL → victim-service
rate_limit_requests방어REAL → victim-service
scale_service방어REAL → Docker SDK
collect_forensic_logs포렌식REAL
build_attack_timeline포렌식REAL
patch_vulnerabilities수정Audit-Only
apply_hardening수정Audit-Only
rollback수정REAL → victim-service
계층기술
에이전트 오케스트레이터Google Cloud Agent Builder (Vertex AI Agent)
LLMGemini 2.0 Flash — google-genai SDK 사용
도구 프로토콜MCP (Model Context Protocol) — 11개 실제 도구
APIFastAPI + Uvicorn (Python 3.11)
데이터베이스MongoDB 7.0 Atlas (Motor async)
관찰 가능성OpenTelemetry → Dynatrace
추적Jaeger
메트릭Prometheus + Grafana
HTTP 클라이언트httpx (async)
컨테이너 오케스트레이션Docker Compose v2