loading…
Search for a command to run...
loading…
An automated security operations center MCP server that uses LLMs and network analysis tools like Tshark to detect threats in traffic data. It enables users to
An automated security operations center MCP server that uses LLMs and network analysis tools like Tshark to detect threats in traffic data. It enables users to automatically ingest PCAP files, query specific packets, and generate intelligent security analysis reports.
AutoSOC Agent 是一个基于 Agentic AI 技术的自动化安全运营中心系统,专注于网络流量分析和安全威胁检测。它采用先进的微内核 + 插件化架构,结合大语言模型的推理能力,实现了对网络流量的智能分析和安全威胁的自动检测。
AutoSOC Agent 采用 微内核 + 插件化架构,严格遵循开闭原则,确保新功能的扩展不会破坏现有核心。
src/app/
├── core/ # 🟢 [内核层] 系统的"不动产"
│ ├── server.py # FastMCP 启动入口 & 环境变量注入
│ ├── loader.py # 动态加载器:扫描 features 并注册
│ ├── context.py # 依赖注入容器 (DI Container)
│ └── database.py # SQLite 异步黑板与状态机
│
├── infrastructure/ # 🟡 [基建层] 屏蔽底层工具差异
│ ├── base_runner.py # 包含熔断与超时的执行引擎基类
│ ├── tshark_runner.py # Tshark 安全执行器 (防注入)
│ ├── watchdog.py # 目录监听黑洞服务
│ └── preprocessor/ # 流量预处理引擎
│
├── domain/ # 🟣 [领域层] 数据契约
│ ├── traffic.py # 流量相关数据模型
│ ├── workflow.py # 工作流相关数据模型
│ └── interaction.py # 交互相关数据模型
│
└── features/ # 🔴 [插件层] 业务逻辑游乐场
├── traffic_inspector/ # 流量分析插件
├── decoder/ # 数据解码插件
└── admin_tools/ # 管理工具插件
克隆项目
git clone <repository-url>
cd traffic_analysis
创建虚拟环境
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate
安装依赖
pip install -r requirements.txt
配置环境变量(可选)
# Windows
set APP_WORKSPACE=./workspace
set TSHARK_PATH=C:\Program Files\Wireshark\tshark.exe
# Linux/Mac
export APP_WORKSPACE=./workspace
export TSHARK_PATH=/usr/bin/tshark
python run.py
系统启动后,会自动监听 workspace/pcap_inbox/ 目录,当流量包放入该目录时,系统会自动开始分析。
流量分析
get_pcap_summary:获取流量包的全局统计信息inspect_packets:使用 Wireshark 语法查询特定数据包数据解码
decode_payload:解码各种编码格式的数据管理工具
run_garbage_collection:运行垃圾回收,清理过期数据AutoSOC Agent 支持自定义插件开发,只需按照以下步骤即可:
创建插件目录
mkdir -p src/app/features/my_plugin
创建插件初始化文件
# src/app/features/my_plugin/__init__.py
from mcp.server.fastmcp import FastMCP
from app.core.context import AppContext
def register(mcp: FastMCP, ctx: AppContext):
"""
插件注册函数
"""
# 注册工具
@mcp.tool(name="my_tool")
async def my_tool(param: str) -> str:
"""
我的工具
"""
return f"处理结果: {param}"
ctx.logger.info("plugin_registered", plugin="my_plugin")
重启系统
系统会自动发现并加载新的插件。
| 依赖 | 版本 | 用途 |
|---|---|---|
| Python | 3.10+ | 运行环境 |
| pydantic | 最新版 | 数据验证和序列化 |
| watchdog | 最新版 | 目录监听 |
| aiosqlite | 最新版 | 异步 SQLite 操作 |
| structlog | 最新版 | 结构化日志 |
| mcp | 最新版 | Agent 通信协议 |
| Wireshark | 3.0+ | 网络分析工具 |
| Zeek | 5.0+ | 流量日志提取 |
| 配置项 | 环境变量 | 默认值 | 说明 |
|---|---|---|---|
| 工作目录 | APP_WORKSPACE | ./workspace | 系统工作目录 |
| Tshark 路径 | TSHARK_PATH | 自动查找 | Tshark 可执行文件路径 |
| 数据库名称 | DB_NAME | blackboard.db | 数据库文件名称 |
| 监控目录 | DROPZONE_FOLDER | pcap_inbox | 流量包收件箱目录 |
| 最大包数限制 | MAX_PACKET_LIMIT | 1000 | 单次查询最大返回包数 |
| 默认超时时间 | DEFAULT_TIMEOUT | 30 | 子进程默认超时时间(秒) |
我们欢迎社区贡献,包括但不限于:
git checkout -b feature/your-featuregit commit -m "Add your feature"git push origin feature/your-feature本项目采用 MIT 许可证。详见 LICENSE 文件。
AutoSOC Agent - 让网络安全分析更加智能、高效!
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"autosoc-agent": {
"command": "npx",
"args": []
}
}
}