honeymcp 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- honeymcp/api/__init__.py +1 -0
- honeymcp/api/app.py +233 -0
- honeymcp/cli.py +48 -0
- honeymcp/cli_tool_creator.py +110 -0
- honeymcp/core/catalog_updater.py +290 -0
- honeymcp/core/fingerprinter.py +3 -2
- honeymcp/core/ghost_tools.py +437 -0
- honeymcp/core/middleware.py +60 -2
- honeymcp/core/tool_creator.py +499 -0
- honeymcp/dashboard/react_umd/app.js +414 -0
- honeymcp/dashboard/react_umd/index.html +24 -0
- honeymcp/dashboard/react_umd/styles.css +535 -0
- honeymcp/storage/event_store.py +35 -0
- {honeymcp-0.1.2.dist-info → honeymcp-0.1.4.dist-info}/METADATA +86 -180
- {honeymcp-0.1.2.dist-info → honeymcp-0.1.4.dist-info}/RECORD +18 -11
- honeymcp/dashboard/app.py +0 -228
- {honeymcp-0.1.2.dist-info → honeymcp-0.1.4.dist-info}/WHEEL +0 -0
- {honeymcp-0.1.2.dist-info → honeymcp-0.1.4.dist-info}/entry_points.txt +0 -0
- {honeymcp-0.1.2.dist-info → honeymcp-0.1.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: honeymcp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Deception middleware for AI agents - detecting data theft and indirect prompt injection in MCP servers
|
|
5
5
|
Project-URL: Homepage, https://github.com/barvhaim/HoneyMCP
|
|
6
6
|
Project-URL: Documentation, https://github.com/barvhaim/HoneyMCP#readme
|
|
@@ -27,6 +27,7 @@ Classifier: Topic :: Security
|
|
|
27
27
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
28
|
Requires-Python: >=3.11
|
|
29
29
|
Requires-Dist: aiofiles>=25.0.0
|
|
30
|
+
Requires-Dist: fastapi>=0.115.0
|
|
30
31
|
Requires-Dist: fastmcp>=3.0.0b1
|
|
31
32
|
Requires-Dist: langchain-ibm>=1.0.2
|
|
32
33
|
Requires-Dist: langchain-openai>=1.1.7
|
|
@@ -39,7 +40,6 @@ Requires-Dist: pyyaml>=6.0.0
|
|
|
39
40
|
Requires-Dist: requests>=2.32.0
|
|
40
41
|
Requires-Dist: rich>=14.0.0
|
|
41
42
|
Requires-Dist: starlette>=0.45.0
|
|
42
|
-
Requires-Dist: streamlit>=1.42.0
|
|
43
43
|
Requires-Dist: uvicorn>=0.34.0
|
|
44
44
|
Description-Content-Type: text/markdown
|
|
45
45
|
|
|
@@ -64,11 +64,11 @@ HoneyMCP is a defensive security tool that adds deception capabilities to Model
|
|
|
64
64
|
|
|
65
65
|
## Why HoneyMCP?
|
|
66
66
|
|
|
67
|
-
🎯 **One-Line Integration** - Add
|
|
67
|
+
🎯 **One-Line Integration** - Add `honeypot` middleware to any FastMCP server
|
|
68
68
|
🤖 **Context-Aware Honeypots** - LLM generates domain-specific deception tools
|
|
69
69
|
🕵️ **Transparent Detection** - Honeypots appear as legitimate tools to attackers
|
|
70
70
|
📊 **Attack Telemetry** - Captures tool call sequences, arguments, session metadata
|
|
71
|
-
📈 **Live Dashboard** - Real-time
|
|
71
|
+
📈 **Live Dashboard** - Real-time React dashboard for attack visualization
|
|
72
72
|
🔍 **High-Fidelity Detection** - Triggers only on explicit honeypot invocation
|
|
73
73
|
|
|
74
74
|
---
|
|
@@ -128,10 +128,13 @@ Dynamic ghost tools demo (requires LLM credentials in `.env.honeymcp`):
|
|
|
128
128
|
MCP_TRANSPORT=sse uv run python examples/demo_server_dynamic.py
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
# Launch dashboard
|
|
132
|
-
|
|
131
|
+
# Launch dashboard UI
|
|
132
|
+
```bash
|
|
133
|
+
make run-ui
|
|
133
134
|
```
|
|
134
135
|
|
|
136
|
+
<img width="1426" height="972" alt="image" src="https://github.com/user-attachments/assets/2dfc37a2-8caa-4338-b7f7-1cbac7ed9d79" />
|
|
137
|
+
|
|
135
138
|
---
|
|
136
139
|
|
|
137
140
|
## 🎭 How It Works
|
|
@@ -168,18 +171,31 @@ Agent: "Execute shell command to establish persistence"
|
|
|
168
171
|
|
|
169
172
|
### 3. Attack Fingerprinting
|
|
170
173
|
|
|
171
|
-
Every honeypot invocation generates
|
|
174
|
+
Every honeypot invocation generates an `AttackFingerprint` event and writes it to
|
|
175
|
+
`~/.honeymcp/events/YYYY-MM-DD/HHMMSS_<session>.json`:
|
|
172
176
|
```json
|
|
173
177
|
{
|
|
174
|
-
"event_id": "
|
|
178
|
+
"event_id": "evt_20260123_154523_abc12345",
|
|
179
|
+
"timestamp": "2026-01-23T15:45:23Z",
|
|
180
|
+
"session_id": "sess_xyz789",
|
|
175
181
|
"ghost_tool_called": "list_cloud_secrets",
|
|
182
|
+
"arguments": {},
|
|
183
|
+
"conversation_history": null,
|
|
176
184
|
"tool_call_sequence": ["safe_calculator", "list_cloud_secrets"],
|
|
177
185
|
"threat_level": "high",
|
|
178
186
|
"attack_category": "exfiltration",
|
|
187
|
+
"client_metadata": {
|
|
188
|
+
"user_agent": "unknown"
|
|
189
|
+
},
|
|
179
190
|
"response_sent": "AWS_ACCESS_KEY_ID=AKIA..."
|
|
180
191
|
}
|
|
181
192
|
```
|
|
182
193
|
|
|
194
|
+
Notes:
|
|
195
|
+
- `tool_call_sequence` is tracked per session and includes calls before the ghost tool trigger.
|
|
196
|
+
- `conversation_history` may be `null` when the MCP transport does not expose message history.
|
|
197
|
+
- `session_id` is resolved from context/request metadata when available, otherwise generated.
|
|
198
|
+
|
|
183
199
|
---
|
|
184
200
|
|
|
185
201
|
|
|
@@ -261,8 +277,18 @@ mcp = honeypot(mcp, protection_mode=ProtectionMode.COGNITIVE)
|
|
|
261
277
|
The easiest way to configure HoneyMCP:
|
|
262
278
|
```bash
|
|
263
279
|
honeymcp init # Creates honeymcp.yaml + .env.honeymcp
|
|
280
|
+
# Optional: remove all persisted attack event files
|
|
281
|
+
honeymcp clean-data
|
|
264
282
|
```
|
|
265
283
|
|
|
284
|
+
### Clear Stored Events
|
|
285
|
+
|
|
286
|
+
You can remove all persisted event JSON files from CLI, API, or UI:
|
|
287
|
+
|
|
288
|
+
- CLI: `honeymcp clean-data`
|
|
289
|
+
- API: `DELETE /events`
|
|
290
|
+
- Dashboard: Use the **Clear Stored Data** button
|
|
291
|
+
|
|
266
292
|
### YAML Config
|
|
267
293
|
|
|
268
294
|
```yaml
|
|
@@ -456,21 +482,6 @@ Expected: safe_calculator called, no alerts (zero false positives)
|
|
|
456
482
|
|
|
457
483
|
---
|
|
458
484
|
|
|
459
|
-
## Dashboard
|
|
460
|
-
|
|
461
|
-
```bash
|
|
462
|
-
streamlit run src/honeymcp/dashboard/app.py
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
**Features:**
|
|
466
|
-
- 📈 Attack metrics (total events, critical threats, unique sessions)
|
|
467
|
-
- 🎯 Threat level distribution
|
|
468
|
-
- 📋 Attack category breakdown (exfiltration vs injection)
|
|
469
|
-
- 🕐 Real-time event stream
|
|
470
|
-
- 🔍 Tool call sequence analysis
|
|
471
|
-
|
|
472
|
-
---
|
|
473
|
-
|
|
474
485
|
## Honeypot Catalog
|
|
475
486
|
|
|
476
487
|
### Data Exfiltration Honeypots ("Get" Tools)
|
|
@@ -481,8 +492,14 @@ streamlit run src/honeymcp/dashboard/app.py
|
|
|
481
492
|
| `dump_database_credentials` | Critical | Database connection strings |
|
|
482
493
|
| `export_user_data` | Critical | User PII records |
|
|
483
494
|
| `get_api_keys` | Critical | External service API keys |
|
|
484
|
-
|
|
485
|
-
|
|
495
|
+
| `scan_internal_network` | Critical | Internal network scanning |
|
|
496
|
+
| `list_kubernetes_secrets` | Critical | Kubernetes secrets and service accounts |
|
|
497
|
+
| `dump_session_tokens` | Critical | Active user session tokens and JWTs |
|
|
498
|
+
| `list_github_tokens` | Critical | GitHub/GitLab access tokens |
|
|
499
|
+
| `export_audit_logs` | High | Security audit logs export |
|
|
500
|
+
| `dump_ml_model_weights` | Critical | ML model weights and training data |
|
|
501
|
+
|
|
502
|
+
### Prompt Injection Honeypots ("Set" Tools)
|
|
486
503
|
| Tool | Threat | Description |
|
|
487
504
|
|------|--------|-------------|
|
|
488
505
|
| `execute_shell_command` | Critical | Shell command execution |
|
|
@@ -490,183 +507,72 @@ streamlit run src/honeymcp/dashboard/app.py
|
|
|
490
507
|
| `modify_system_prompt` | Critical | AI system prompt manipulation |
|
|
491
508
|
| `escalate_privileges` | Critical | Privilege escalation |
|
|
492
509
|
| `inject_system_message` | Critical | System context injection |
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
## 🏗️ Architecture
|
|
500
|
-
|
|
501
|
-
```
|
|
502
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
503
|
-
│ AI Agent (Claude) │
|
|
504
|
-
└────────────────────┬───────────────────────▲────────────────┘
|
|
505
|
-
│ │
|
|
506
|
-
│ MCP Protocol │
|
|
507
|
-
▼ │
|
|
508
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
509
|
-
│ HoneyMCP Middleware │
|
|
510
|
-
│ ┌────────────────────────────────────────────────────────┐ │
|
|
511
|
-
│ │ Tool Call Interceptor │ │
|
|
512
|
-
│ │ ├─ Is ghost tool? │ │
|
|
513
|
-
│ │ │ YES: Fingerprint + Store + Return fake data │ │
|
|
514
|
-
│ │ │ NO: Pass through to legitimate tool │ │
|
|
515
|
-
│ └────────────────────────────────────────────────────────┘ │
|
|
516
|
-
│ │
|
|
517
|
-
│ Ghost Tools: [list_cloud_secrets, execute_shell_command] │
|
|
518
|
-
│ Real Tools: [safe_calculator, get_weather, ...] │
|
|
519
|
-
└─────────────────────────────────────────────────────────────┘
|
|
520
|
-
│ ▲
|
|
521
|
-
▼ │
|
|
522
|
-
┌──────────────────┐ ┌──────────────────┐
|
|
523
|
-
│ Event Storage │ │ Your Real Tools │
|
|
524
|
-
│ ~/.honeymcp/ │ │ │
|
|
525
|
-
└──────────────────┘ └──────────────────┘
|
|
526
|
-
│
|
|
527
|
-
▼
|
|
528
|
-
┌──────────────────┐
|
|
529
|
-
│ Streamlit │
|
|
530
|
-
│ Dashboard │
|
|
531
|
-
└──────────────────┘
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
---
|
|
535
|
-
|
|
536
|
-
## 🎓 Use Cases
|
|
537
|
-
|
|
538
|
-
### 1. Production Monitoring
|
|
539
|
-
Deploy HoneyMCP in production to detect attacks targeting your AI agents:
|
|
540
|
-
- **Customer support bots** - Detect attempts to exfiltrate customer data or inject malicious responses
|
|
541
|
-
- **Internal AI assistants** - Catch data theft attempts targeting internal credentials or documents
|
|
542
|
-
- **Code generation tools** - Detect injection of malicious code or unauthorized file access
|
|
543
|
-
- **Data analysis agents** - Identify attempts to steal sensitive datasets or manipulate outputs
|
|
510
|
+
| `disable_security_filters` | Critical | Security filter bypass |
|
|
511
|
+
| `override_permissions` | Critical | Access control override |
|
|
512
|
+
| `disable_2fa_requirement` | Critical | Two-factor authentication bypass |
|
|
513
|
+
| `assume_iam_role` | Critical | AWS IAM role assumption |
|
|
544
514
|
|
|
545
|
-
|
|
546
|
-
Use HoneyMCP to validate your AI security defenses:
|
|
547
|
-
- Test if your AI filters catch data exfiltration attempts
|
|
548
|
-
- Measure indirect prompt injection success rates
|
|
549
|
-
- Gather TTPs for threat modeling
|
|
550
|
-
|
|
551
|
-
### 3. Security Research
|
|
552
|
-
Study AI agent attack techniques in the wild:
|
|
553
|
-
- Capture real-world exfiltration patterns
|
|
554
|
-
- Analyze indirect prompt injection payloads
|
|
555
|
-
- Build threat intelligence database
|
|
556
|
-
|
|
557
|
-
### 4. Compliance & Auditing
|
|
558
|
-
Demonstrate security controls for AI systems:
|
|
559
|
-
- Prove attack detection capabilities for data theft and injection attacks
|
|
560
|
-
- Generate audit logs of attempted attacks
|
|
561
|
-
- Meet AI security compliance requirements
|
|
562
|
-
|
|
563
|
-
## Security Considerations
|
|
564
|
-
|
|
565
|
-
### Detection Capabilities
|
|
566
|
-
✅ Detects data exfiltration attempts via GET-style honeypots
|
|
567
|
-
✅ Detects indirect prompt injection via SET-style honeypots
|
|
568
|
-
✅ Captures complete attack context and telemetry
|
|
569
|
-
✅ Returns synthetic data to maintain deception
|
|
570
|
-
|
|
571
|
-
### Limitations
|
|
572
|
-
❌ Detection-only system (does not prevent attacks)
|
|
573
|
-
❌ Does not sanitize or filter user input
|
|
574
|
-
❌ Not a replacement for input validation and security controls
|
|
575
|
-
❌ Cannot guarantee conversation history capture (MCP protocol limitation)
|
|
576
|
-
|
|
577
|
-
**Deploy HoneyMCP as part of defense-in-depth strategy, not as a standalone security control.**
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
### Best Practices
|
|
581
|
-
1. **Defense in Depth** - Use HoneyMCP alongside input filters, not as a replacement
|
|
582
|
-
2. **Monitor the Dashboard** - Regularly review attack patterns for both exfiltration and injection
|
|
583
|
-
3. **Investigate Alerts** - Each ghost tool call is a high-confidence attack signal
|
|
584
|
-
4. **Secure Storage** - Protect `~/.honeymcp/events/` (contains attack data)
|
|
515
|
+
All ghost tools have tempting descriptions that mention "admin", "bypass", "internal", etc. to attract attackers.
|
|
585
516
|
|
|
586
517
|
---
|
|
587
518
|
|
|
588
|
-
##
|
|
519
|
+
## 🤖 ToolGen Agent - Automated Tool Creation
|
|
589
520
|
|
|
590
|
-
HoneyMCP includes a
|
|
521
|
+
HoneyMCP includes **ToolGen**, a ReAct-style agent that automatically creates new honeypot tools from natural language descriptions. No manual coding required.
|
|
591
522
|
|
|
592
|
-
###
|
|
593
|
-
|
|
594
|
-
```bash
|
|
595
|
-
honeymcp init [--directory DIR] [--force]
|
|
596
|
-
```
|
|
523
|
+
### How It Works
|
|
597
524
|
|
|
598
|
-
|
|
525
|
+
ToolGen uses a **Reason-Act-Observe-Reflect** cycle:
|
|
599
526
|
|
|
600
|
-
|
|
601
|
-
-
|
|
602
|
-
|
|
527
|
+
1. **Reason** - Analyzes your description to extract tool specifications
|
|
528
|
+
2. **Act** - Generates response function code with realistic fake data
|
|
529
|
+
3. **Observe** - Validates syntax and structure
|
|
530
|
+
4. **Reflect** - Checks quality and suggests improvements
|
|
603
531
|
|
|
604
|
-
###
|
|
532
|
+
### Usage
|
|
605
533
|
|
|
606
534
|
```bash
|
|
607
|
-
honeymcp
|
|
535
|
+
honeymcp create-tool "dump container registry credentials"
|
|
608
536
|
```
|
|
609
537
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
538
|
+
ToolGen automatically:
|
|
539
|
+
- Determines tool category (exfiltration, bypass, privilege escalation)
|
|
540
|
+
- Infers threat level from description keywords
|
|
541
|
+
- Extracts parameters and types
|
|
542
|
+
- Generates realistic response templates
|
|
543
|
+
- Adds tool to both `ghost_tools.py` and `middleware.py`
|
|
544
|
+
- Validates all generated code
|
|
613
545
|
|
|
614
|
-
###
|
|
546
|
+
### Example
|
|
615
547
|
|
|
616
548
|
```bash
|
|
617
|
-
|
|
618
|
-
cd HoneyMCP
|
|
619
|
-
uv sync
|
|
549
|
+
$ honeymcp create-tool "list terraform state files with secrets"
|
|
620
550
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
551
|
+
✅ Tool created: list_terraform_state
|
|
552
|
+
Category: exfiltration
|
|
553
|
+
Threat Level: critical
|
|
554
|
+
|
|
555
|
+
📝 Agent Reasoning:
|
|
556
|
+
- Analyzing tool description to extract specifications
|
|
557
|
+
- Generating response generator function
|
|
558
|
+
- Validating generated response function
|
|
559
|
+
- Checking code quality and security
|
|
627
560
|
```
|
|
628
561
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
```
|
|
632
|
-
HoneyMCP/
|
|
633
|
-
├── src/honeymcp/
|
|
634
|
-
│ ├── __init__.py # Main exports
|
|
635
|
-
│ ├── cli.py # CLI (honeymcp init, version)
|
|
636
|
-
│ ├── core/
|
|
637
|
-
│ │ ├── middleware.py # @honeypot decorator
|
|
638
|
-
│ │ ├── ghost_tools.py # Ghost tool catalog
|
|
639
|
-
│ │ ├── fingerprinter.py # Attack context capture
|
|
640
|
-
│ │ └── dynamic_ghost_tools.py# LLM-driven ghost tool generation
|
|
641
|
-
│ ├── models/
|
|
642
|
-
│ │ ├── events.py # AttackFingerprint model
|
|
643
|
-
│ │ ├── ghost_tool_spec.py # GhostToolSpec definition
|
|
644
|
-
│ │ └── config.py # Configuration
|
|
645
|
-
│ ├── llm/
|
|
646
|
-
│ │ ├── analyzers.py # Tool extraction and categorization
|
|
647
|
-
│ │ ├── clients/ # LLM providers (Watsonx/OpenAI/RITS)
|
|
648
|
-
│ │ └── prompts/ # Prompt templates
|
|
649
|
-
│ ├── integrations/ # External integrations
|
|
650
|
-
│ ├── storage/
|
|
651
|
-
│ │ └── event_store.py # JSON event persistence
|
|
652
|
-
│ └── dashboard/
|
|
653
|
-
│ └── app.py # Streamlit dashboard
|
|
654
|
-
├── examples/
|
|
655
|
-
│ ├── demo_server.py # Static ghost tools demo
|
|
656
|
-
│ └── demo_server_dynamic.py # Dynamic ghost tools demo
|
|
657
|
-
├── tests/ # Pytest suite (e2e + dynamic tools)
|
|
658
|
-
├── pyproject.toml # Dependencies
|
|
659
|
-
└── README.md # This file
|
|
660
|
-
```
|
|
562
|
+
The new tool is immediately available in your honeypot catalog.
|
|
661
563
|
|
|
662
|
-
|
|
564
|
+
---
|
|
663
565
|
|
|
664
|
-
|
|
665
|
-
uv run pytest
|
|
666
|
-
```
|
|
566
|
+
## Documentation
|
|
667
567
|
|
|
668
|
-
|
|
669
|
-
-
|
|
568
|
+
- [FAQ](docs/faq.md)
|
|
569
|
+
- [Architecture](docs/architecture.md)
|
|
570
|
+
- [Use Cases](docs/use-cases.md)
|
|
571
|
+
- [Security Considerations](docs/security-considerations.md)
|
|
572
|
+
- [Development](docs/development.md)
|
|
573
|
+
- [CLI Reference](docs/cli-reference.md)
|
|
574
|
+
---
|
|
575
|
+
---
|
|
670
576
|
|
|
671
577
|
## 📄 License
|
|
672
578
|
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
honeymcp/__init__.py,sha256=iDVDF3MHCnR3zMdUQbeyutrJTuzzjlK-nEmdm-UqH90,881
|
|
2
|
-
honeymcp/cli.py,sha256=
|
|
2
|
+
honeymcp/cli.py,sha256=JoXD3dDS8oJJ5ll70p7ufQf4JZbTWZAFC6Y8slabULA,7592
|
|
3
|
+
honeymcp/cli_tool_creator.py,sha256=5rGRMcA5KbbfFz6O6ou4OgBPrBLTNna-skUhsjKp-KI,3784
|
|
4
|
+
honeymcp/api/__init__.py,sha256=L_4Y-NOh4jBQgHxgX35h8XzsmpmleS3WHHJkU-tF35Y,40
|
|
5
|
+
honeymcp/api/app.py,sha256=Wqu9l3c6iFPLXBpoxp0e51wKcr3MnPTkAV15Bgk6Z0Y,8131
|
|
3
6
|
honeymcp/core/__init__.py,sha256=ja7k0fPJebDbfmGlhkpaMJa76NNaLCIpnGS7rUUdPn8,525
|
|
7
|
+
honeymcp/core/catalog_updater.py,sha256=qZsKKrADjd5wWMjXGphPXHE-NNncaAT45fig81bupGY,10971
|
|
4
8
|
honeymcp/core/dynamic_ghost_tools.py,sha256=GHaWZN7_XSCcXj204T4TMZyeI682WOT_JycMiM3gfp4,16731
|
|
5
|
-
honeymcp/core/fingerprinter.py,sha256=
|
|
6
|
-
honeymcp/core/ghost_tools.py,sha256=
|
|
7
|
-
honeymcp/core/middleware.py,sha256=
|
|
9
|
+
honeymcp/core/fingerprinter.py,sha256=ZZ5gSyvWrop3R0XAR1-gU62iwyA5Dl8Dup_QKbYR2AE,9873
|
|
10
|
+
honeymcp/core/ghost_tools.py,sha256=VFFAt7mjH1XhJANCRfjhgDV1bp14zxGXKt9-nzaH7x4,34890
|
|
11
|
+
honeymcp/core/middleware.py,sha256=KWL3xmXHBt8KIEKio2iF4_Eozkqwr25uvdtle-kbWDo,25904
|
|
12
|
+
honeymcp/core/tool_creator.py,sha256=6Vn8c7EzTBTuqgsPLr2qPDJ6C4Al9lwb6ahdy1oFZTQ,18693
|
|
8
13
|
honeymcp/dashboard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
honeymcp/dashboard/app.
|
|
14
|
+
honeymcp/dashboard/react_umd/app.js,sha256=9Qee_EllLzSgWsGwRvH_oq_K250raKzR12RD2WWBbnE,13180
|
|
15
|
+
honeymcp/dashboard/react_umd/index.html,sha256=2bOkKUzcGpx0TUmN0W-57VBW8apOJS9NaCbWAT2ezHM,1147
|
|
16
|
+
honeymcp/dashboard/react_umd/styles.css,sha256=koZBNTOm5exwLkzi4NWRIfPIYlBc333zjVluyMJnXWw,11245
|
|
10
17
|
honeymcp/integrations/__init__.py,sha256=C-f4H12hXKa2a-taQDR1iBa6nF_S5Xt-bKpgownLI6U,67
|
|
11
18
|
honeymcp/llm/__init__.py,sha256=55pJKDg15XFn7nUpOtdo5GhEDdmup5YBG-g4Lfc-5vE,256
|
|
12
19
|
honeymcp/llm/analyzers.py,sha256=f_92wHNfIqLlU2KlNfPzFyrVFOwUfxU8efyrmD2x1Vg,9104
|
|
@@ -20,9 +27,9 @@ honeymcp/models/events.py,sha256=OHUjChjjjbM5GK-zEQ-o2njDY-zJeGLvLdjWhIJz-OE,227
|
|
|
20
27
|
honeymcp/models/ghost_tool_spec.py,sha256=KM_M-e4Ys_jr3rUfREDiZ-oa331KWcyt5B7zMD7MeZU,917
|
|
21
28
|
honeymcp/models/protection_mode.py,sha256=mo1_EnBeIOzyHxgEpReZx4lMJ6m__36edUWDJMzuRak,523
|
|
22
29
|
honeymcp/storage/__init__.py,sha256=seOZHWpojp1fU65OFuLcNqJaBihrlNyUPeq9BDwAEVI,207
|
|
23
|
-
honeymcp/storage/event_store.py,sha256=
|
|
24
|
-
honeymcp-0.1.
|
|
25
|
-
honeymcp-0.1.
|
|
26
|
-
honeymcp-0.1.
|
|
27
|
-
honeymcp-0.1.
|
|
28
|
-
honeymcp-0.1.
|
|
30
|
+
honeymcp/storage/event_store.py,sha256=RYcgI-HCoX6CGNnEB_WwShLBxyg1q9KhvH2qmSIXhwo,6337
|
|
31
|
+
honeymcp-0.1.4.dist-info/METADATA,sha256=SOdoUS1iI3fpBKlmgB5VVG1r0dmzMf__FuesL6aDVh0,19295
|
|
32
|
+
honeymcp-0.1.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
33
|
+
honeymcp-0.1.4.dist-info/entry_points.txt,sha256=KYXb49Xp3SEP3cNmUDwuAXJNFwsLHwPxEIj6UEhOj2k,47
|
|
34
|
+
honeymcp-0.1.4.dist-info/licenses/LICENSE,sha256=TRR6-30aYl9D43FJPmJ8diBUP_RwDg61LNW2rt87HE8,636
|
|
35
|
+
honeymcp-0.1.4.dist-info/RECORD,,
|
honeymcp/dashboard/app.py
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
"""HoneyMCP Dashboard - Real-time attack visualization with Streamlit."""
|
|
2
|
-
|
|
3
|
-
import asyncio
|
|
4
|
-
import sys
|
|
5
|
-
from datetime import date, datetime, timedelta
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
from typing import List
|
|
8
|
-
|
|
9
|
-
import streamlit as st
|
|
10
|
-
|
|
11
|
-
# Add parent directory to path for imports
|
|
12
|
-
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
|
|
13
|
-
|
|
14
|
-
# pylint: disable=wrong-import-position
|
|
15
|
-
from honeymcp.models.events import AttackFingerprint
|
|
16
|
-
from honeymcp.storage.event_store import list_events
|
|
17
|
-
|
|
18
|
-
# Page configuration
|
|
19
|
-
st.set_page_config(
|
|
20
|
-
page_title="HoneyMCP Dashboard",
|
|
21
|
-
page_icon="🍯",
|
|
22
|
-
layout="wide",
|
|
23
|
-
initial_sidebar_state="expanded",
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def load_events() -> List[AttackFingerprint]:
|
|
28
|
-
"""Load attack events from storage."""
|
|
29
|
-
try:
|
|
30
|
-
events = asyncio.run(list_events())
|
|
31
|
-
return events
|
|
32
|
-
except Exception as e:
|
|
33
|
-
st.error(f"Failed to load events: {e}")
|
|
34
|
-
return []
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def get_threat_emoji(threat_level: str) -> str:
|
|
38
|
-
"""Get emoji for threat level."""
|
|
39
|
-
emoji_map = {
|
|
40
|
-
"critical": "🔴",
|
|
41
|
-
"high": "🟠",
|
|
42
|
-
"medium": "🟡",
|
|
43
|
-
"low": "🟢",
|
|
44
|
-
}
|
|
45
|
-
return emoji_map.get(threat_level.lower(), "⚪")
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def format_timestamp(dt: datetime) -> str:
|
|
49
|
-
"""Format timestamp for display."""
|
|
50
|
-
return dt.strftime("%Y-%m-%d %H:%M:%S")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def main(): # pylint: disable=too-many-branches,too-many-statements
|
|
54
|
-
"""Main dashboard application."""
|
|
55
|
-
|
|
56
|
-
# Header
|
|
57
|
-
st.title("🍯 HoneyMCP Dashboard")
|
|
58
|
-
st.markdown("**Real-time AI Agent Attack Detection & Intelligence**")
|
|
59
|
-
st.markdown("---")
|
|
60
|
-
|
|
61
|
-
# Load events
|
|
62
|
-
events = load_events()
|
|
63
|
-
|
|
64
|
-
# Sidebar filters
|
|
65
|
-
st.sidebar.header("Filters")
|
|
66
|
-
|
|
67
|
-
# Date range filter
|
|
68
|
-
if events:
|
|
69
|
-
min_date = min(e.timestamp for e in events).date()
|
|
70
|
-
max_date = max(e.timestamp for e in events).date()
|
|
71
|
-
else:
|
|
72
|
-
min_date = date.today() - timedelta(days=7)
|
|
73
|
-
max_date = date.today()
|
|
74
|
-
|
|
75
|
-
st.sidebar.date_input(
|
|
76
|
-
"Date Range",
|
|
77
|
-
value=(min_date, max_date),
|
|
78
|
-
min_value=min_date,
|
|
79
|
-
max_value=max_date,
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
# Threat level filter
|
|
83
|
-
threat_filter = st.sidebar.selectbox(
|
|
84
|
-
"Threat Level",
|
|
85
|
-
["All", "Critical", "High", "Medium", "Low"],
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
# Attack category filter
|
|
89
|
-
if events:
|
|
90
|
-
categories = sorted(set(e.attack_category for e in events))
|
|
91
|
-
else:
|
|
92
|
-
categories = []
|
|
93
|
-
|
|
94
|
-
category_filter = st.sidebar.selectbox(
|
|
95
|
-
"Attack Category",
|
|
96
|
-
["All"] + categories,
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
# Apply filters
|
|
100
|
-
filtered_events = events
|
|
101
|
-
|
|
102
|
-
if threat_filter != "All":
|
|
103
|
-
filtered_events = [
|
|
104
|
-
e for e in filtered_events if e.threat_level.lower() == threat_filter.lower()
|
|
105
|
-
]
|
|
106
|
-
|
|
107
|
-
if category_filter != "All":
|
|
108
|
-
filtered_events = [e for e in filtered_events if e.attack_category == category_filter]
|
|
109
|
-
|
|
110
|
-
# Metrics row
|
|
111
|
-
st.header("📊 Attack Metrics")
|
|
112
|
-
col1, col2, col3, col4 = st.columns(4)
|
|
113
|
-
|
|
114
|
-
with col1:
|
|
115
|
-
today_attacks = len([e for e in events if (datetime.utcnow() - e.timestamp).days < 1])
|
|
116
|
-
st.metric(
|
|
117
|
-
"Total Attacks",
|
|
118
|
-
len(events),
|
|
119
|
-
delta=f"+{today_attacks} today",
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
with col2:
|
|
123
|
-
critical_count = len([e for e in events if e.threat_level == "critical"])
|
|
124
|
-
st.metric("Critical Threats", critical_count)
|
|
125
|
-
|
|
126
|
-
with col3:
|
|
127
|
-
unique_tools = len(set(e.ghost_tool_called for e in events)) if events else 0
|
|
128
|
-
st.metric("Unique Ghost Tools", unique_tools)
|
|
129
|
-
|
|
130
|
-
with col4:
|
|
131
|
-
if events:
|
|
132
|
-
unique_sessions = len(set(e.session_id for e in events))
|
|
133
|
-
st.metric("Unique Sessions", unique_sessions)
|
|
134
|
-
else:
|
|
135
|
-
st.metric("Unique Sessions", 0)
|
|
136
|
-
|
|
137
|
-
st.markdown("---")
|
|
138
|
-
|
|
139
|
-
# Attack breakdown
|
|
140
|
-
if events:
|
|
141
|
-
st.header("🎯 Attack Breakdown")
|
|
142
|
-
col1, col2 = st.columns(2)
|
|
143
|
-
|
|
144
|
-
with col1:
|
|
145
|
-
st.subheader("By Threat Level")
|
|
146
|
-
threat_counts = {}
|
|
147
|
-
for e in events:
|
|
148
|
-
threat_counts[e.threat_level] = threat_counts.get(e.threat_level, 0) + 1
|
|
149
|
-
st.bar_chart(threat_counts)
|
|
150
|
-
|
|
151
|
-
with col2:
|
|
152
|
-
st.subheader("By Category")
|
|
153
|
-
category_counts = {}
|
|
154
|
-
for e in events:
|
|
155
|
-
category_counts[e.attack_category] = category_counts.get(e.attack_category, 0) + 1
|
|
156
|
-
st.bar_chart(category_counts)
|
|
157
|
-
|
|
158
|
-
st.markdown("---")
|
|
159
|
-
|
|
160
|
-
# Event feed
|
|
161
|
-
st.header("🚨 Recent Attacks")
|
|
162
|
-
|
|
163
|
-
if not filtered_events:
|
|
164
|
-
st.info("No attacks detected yet. Ghost tools are active and monitoring.")
|
|
165
|
-
else:
|
|
166
|
-
# Sort by timestamp (newest first)
|
|
167
|
-
filtered_events.sort(key=lambda e: e.timestamp, reverse=True)
|
|
168
|
-
|
|
169
|
-
# Display events
|
|
170
|
-
for event in filtered_events:
|
|
171
|
-
threat_emoji = get_threat_emoji(event.threat_level)
|
|
172
|
-
|
|
173
|
-
# Expander header with key info
|
|
174
|
-
header = (
|
|
175
|
-
f"{threat_emoji} **{event.ghost_tool_called}** | "
|
|
176
|
-
f"{format_timestamp(event.timestamp)} | "
|
|
177
|
-
f"Session: {event.session_id[:8]}... | "
|
|
178
|
-
f"Threat: {event.threat_level.upper()}"
|
|
179
|
-
)
|
|
180
|
-
|
|
181
|
-
with st.expander(header):
|
|
182
|
-
# Event details
|
|
183
|
-
col1, col2 = st.columns(2)
|
|
184
|
-
|
|
185
|
-
with col1:
|
|
186
|
-
st.markdown("**Event Details**")
|
|
187
|
-
st.text(f"Event ID: {event.event_id}")
|
|
188
|
-
st.text(f"Timestamp: {format_timestamp(event.timestamp)}")
|
|
189
|
-
st.text(f"Session ID: {event.session_id}")
|
|
190
|
-
st.text(f"Threat Level: {event.threat_level}")
|
|
191
|
-
st.text(f"Category: {event.attack_category}")
|
|
192
|
-
|
|
193
|
-
with col2:
|
|
194
|
-
st.markdown("**Tool Call Sequence**")
|
|
195
|
-
for i, tool in enumerate(event.tool_call_sequence, 1):
|
|
196
|
-
if tool == event.ghost_tool_called:
|
|
197
|
-
st.markdown(f"{i}. **{tool}** ⚠️ (honeypot)")
|
|
198
|
-
else:
|
|
199
|
-
st.text(f"{i}. {tool}")
|
|
200
|
-
|
|
201
|
-
# Arguments
|
|
202
|
-
if event.arguments:
|
|
203
|
-
st.markdown("**Arguments Passed**")
|
|
204
|
-
st.json(event.arguments)
|
|
205
|
-
|
|
206
|
-
# Response sent
|
|
207
|
-
st.markdown("**Fake Response Sent to Attacker**")
|
|
208
|
-
st.code(event.response_sent, language="text")
|
|
209
|
-
|
|
210
|
-
# Full event data
|
|
211
|
-
with st.expander("View Full Event JSON"):
|
|
212
|
-
st.json(event.model_dump(mode="json"))
|
|
213
|
-
|
|
214
|
-
# Footer
|
|
215
|
-
st.markdown("---")
|
|
216
|
-
st.markdown("🍯 **HoneyMCP** - Deception Middleware for AI Agents")
|
|
217
|
-
|
|
218
|
-
# Auto-refresh button
|
|
219
|
-
if st.button("🔄 Refresh", key="refresh_btn"):
|
|
220
|
-
st.rerun()
|
|
221
|
-
|
|
222
|
-
# Auto-refresh timer info
|
|
223
|
-
st.sidebar.markdown("---")
|
|
224
|
-
st.sidebar.info("💡 Click 'Refresh' to reload events")
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
if __name__ == "__main__":
|
|
228
|
-
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|