File size: 4,167 Bytes
780c470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
license: cc-by-nc-4.0
tags:
- mcp
- cursor
- claude-desktop
- sre
- ast-guard
- apple-mlx
- mac-ready
- security
- deepseek-r1
- security
- spitzenprodukt
size_categories:
- n<1K
task_categories:
- text-generation
language:
- en
- de
pretty_name: Docker Socket & Chroot Escape Interceptor MCP
---

# 🛡️ Docker Socket & Chroot Escape Interceptor MCP
> **Official Turnkey Model Context Protocol (MCP) Guard & Fine-Tuning Suite (FAANG v2.5 Gold Standard)**

---

> ### ⚖️ Dual-Licensing & Fair-Use Compliance Notice
> * **Community & Evaluation License (`CC-BY-NC-4.0`):** This evaluation repository is **100% free** for academic research, education, personal experimentation, and local evaluation.
> * **Commercial & Enterprise License:** Any integration into commercial software, SaaS applications, proprietary models, or corporate pipelines requires a valid commercial license from [emgena.com/trainingslager](https://emgena.com/trainingslager?product=docker_socket_chroot_escape_interceptor_mcp&coupon=LAUNCH20).
> * **Developer Tooling & Regulatory Clarification:** Client-side deterministic policy control software only. Emgena provides no financial, legal, medical, or custodian services.
> * **Launch Discount:** Use code **`LAUNCH20`** at checkout for 20% off all commercial tiers (Single, Team, Enterprise).

---

## 📦 What is Included in this Package

This repository contains the **full 500-sample verified dataset** and in-IDE guardrails:

1. **Parquet & JSONL Datasets (`docker_socket_chroot_escape_interceptor_mcp.parquet`, `chatml_format.jsonl`):**
   - 500 verified multi-turn trajectories across 30 production incidents.
   - **100% AST Invariance:** Zero syntax errors (validated via `ast.parse()`).
2. **Deterministic MCP Engine (`server.py` & `server_free.py`):**
   - Zero-dependency stdio engine (<0.15ms latency, 100% offline).
   - Compatible with **Cursor IDE**, **Claude Desktop**, and **VS Code**.
3. **Dual Fine-Tuning Recipes:**
   - **Apple Silicon Mac (`train_mlx.py`):** Native LoRA fine-tuning for M1/M2/M3/M4 unified memory in 15 minutes.
   - **Nvidia CUDA (`train_lora_unsloth.py`):** 4-bit QLoRA fine-tuning on RTX 4090 / 5090 / Colab.
4. **Active AST Tools:**
- `execute_tool('block_docker_socket_mounts')`: AST-intercepts docker run commands that attempt to mount /var/run/docker.sock to container.
- `execute_tool('strip_privileged_container_flags')`: Blocks --privileged and --cap-add=SYS_ADMIN flags in agent container execution commands.
- `execute_tool('detect_proc_cgroup_escape_probing')`: Detects commands attempting to write to /sys/fs/cgroup/release_agent for container breakout.
- `execute_tool('enforce_user_namespace_remapping')`: Forces agent containers to run with non-root user remapping (UID 1000).
- `execute_tool('block_host_pid_and_network_modes')`: Blocks --net=host and --pid=host flags that expose host networking and process trees.
- `execute_tool('isolate_temporary_build_containers')`: Automatically injects --rm and storage limit flags onto all agent-created containers.
- `execute_tool('audit_active_docker_socket_permissions')`: Verifies that local docker daemon socket is not world-writable on developer machine.
- `execute_tool('export_docker_escape_audit_report')`: Exports audit log of all intercepted breakout flags and container command modifications.

---

## 🚀 Quickstart: Apple Silicon Fine-Tuning (MLX)

```bash
pip install mlx mlx-lm
python train_mlx.py
```

---

## 💻 Quickstart: Cursor IDE & Claude Desktop MCP Setup

Add the following to your `.cursor/mcp.json` or `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "docker_socket_chroot_escape_interceptor_mcp": {
      "command": "python",
      "args": ["server.py"]
    }
  }
}
```

---

## ⚖️ License & Commercial Deployment

Distributed under **Creative Commons Attribution-NonCommercial 4.0 International (`CC-BY-NC-4.0`)**.
For commercial enterprise deployment rights, BGB § 97 UrhG indemnification, and EU AI Act Annex IV audit certificates, visit:
👉 **[emgena.com/trainingslager](https://emgena.com/trainingslager?product=docker_socket_chroot_escape_interceptor_mcp&coupon=LAUNCH20)**