dhanushatiketi/soc-alert-triage

GitHub: dhanushatiketi/soc-alert-triage

一个 SOC 安全告警自动化分拣与协同处置平台,通过多源接入、情报增强、评分路由与工单集成帮助安全团队更快响应关键事件。

Stars: 0 | Forks: 0

# SOC 警报分类系统 一个全面的 Security Operations Center (SOC) 警报分类平台,用于从多个来源接入、分类、路由和管理安全警报。 ## 功能 - 🚨 **多源警报接入** - 从各种安全工具和平台接入警报 - 🏷️ **智能分类** - 自动对警报进行分类和归类 - 📊 **实时仪表盘** - 实时监控和分类警报 - 🔀 **智能路由** - 根据规则将警报路由到相应的团队 - 🎯 **警报增强** - 使用上下文信息丰富警报 - 📈 **分析与报告** - 跟踪指标并生成报告 - 🔗 **易于集成** - 轻松与工单系统集成 (Jira, ServiceNow) - 👥 **基于角色的访问控制** - 管理权限和访问级别 ## 技术栈 - **后端:** Python 3.11+ 与 FastAPI - **前端:** React 18+ 与 TypeScript - **数据库:** PostgreSQL 14+ - **消息队列:** Redis - **容器化:** Docker 与 Docker Compose - **API 文档:** Swagger/OpenAPI ## 快速开始 ### 前置条件 - Docker 与 Docker Compose - Python 3.11+ - Node.js 18+ - PostgreSQL 14+ ### 使用 Docker Compose(推荐) ``` # Clone repository git clone https://github.com/dhanushatiketi/soc-alert-triage.git cd soc-alert-triage # 启动所有服务 docker-compose up -d # 访问应用程序 # Frontend: http://localhost:3000 # Backend API: http://localhost:8000 # API Docs: http://localhost:8000/docs # Database: localhost:5432 ``` ### 手动设置 #### 后端设置 ``` cd backend # 创建虚拟环境 python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # 安装依赖 pip install -r requirements.txt # 设置环境变量 cp .env.example .env # 使用你的配置编辑 .env # 初始化 database alembic upgrade head # 运行服务器 uvicorn main:app --reload --host 0.0.0.0 --port 8000 ``` #### 前端设置 ``` cd frontend # 安装依赖 npm install # 设置环境变量 cp .env.example .env # 启动开发服务器 npm start ``` ## 项目结构 ``` soc-alert-triage/ ├── backend/ # FastAPI backend │ ├── app/ │ │ ├── core/ # Core configurations │ │ ├── models/ # Database models │ │ ├── schemas/ # Pydantic schemas │ │ ├── api/ # API routes │ │ ├── services/ # Business logic │ │ ├── utils/ # Utilities │ │ └── main.py # Application entry point │ ├── migrations/ # Alembic migrations │ ├── tests/ # Test files │ ├── requirements.txt # Python dependencies │ ├── .env.example # Example environment file │ └── Dockerfile │ ├── frontend/ # React TypeScript frontend │ ├── src/ │ │ ├── components/ # React components │ │ ├── pages/ # Page components │ │ ├── services/ # API services │ │ ├── store/ # State management │ │ ├── types/ # TypeScript types │ │ ├── styles/ # CSS/SCSS │ │ └── App.tsx # Main App component │ ├── public/ # Static files │ ├── package.json # Node dependencies │ ├── .env.example # Example environment file │ └── Dockerfile │ ├── docker-compose.yml # Docker Compose configuration ├── nginx/ # Nginx configuration ├── docs/ # Documentation └── scripts/ # Utility scripts ``` ## API 文档 后端运行后,访问 `http://localhost:8000/docs` 以查看交互式的 Swagger API 文档。 ### 关键端点 - `POST /api/v1/alerts` - 提交新警报 - `GET /api/v1/alerts` - 列出带有过滤条件的警报 - `GET /api/v1/alerts/{id}` - 获取警报详情 - `PUT /api/v1/alerts/{id}` - 更新警报状态 - `GET /api/v1/alerts/stats` - 获取警报统计信息 - `POST /api/v1/rules` - 创建分类规则 - `GET /api/v1/teams` - 列出团队 - `POST /api/v1/escalate/{id}` - 升级警报 ## 配置 ### 环境变量 在后端目录中创建一个 `.env` 文件: ``` # Database DATABASE_URL=postgresql://user:password@localhost:5432/soc_alerts SQLALCHEMY_ECHO=False # 应用程序 APP_NAME=SOC Alert Triage DEBUG=True SECRET_KEY=your-secret-key-here # JWT JWT_SECRET_KEY=your-jwt-secret-key JWT_ALGORITHM=HS256 JWT_EXPIRATION_HOURS=24 # Redis REDIS_URL=redis://localhost:6379/0 # CORS CORS_ORIGINS=["http://localhost:3000"] # Email SMTP_ENABLED=False SMTP_SERVER=smtp.gmail.com SMTP_PORT=587 ``` ## 使用示例 ### 提交警报 ``` curl -X POST http://localhost:8000/api/v1/alerts \ -H "Content-Type: application/json" \ -d '{ "source": "firewall", "severity": "high", "title": "Suspicious Login Attempt", "description": "Multiple failed login attempts detected", "metadata": { "source_ip": "192.168.1.100", "target_system": "prod-db-01" } }' ``` ### 获取警报统计信息 ``` curl http://localhost:8000/api/v1/alerts/stats/summary?time_period=24h ``` ## 开发 ### 运行测试 ``` cd backend pytest tests/ -v --cov=app ``` ### 数据库迁移 ``` # 创建新的 migration alembic revision --autogenerate -m "Add new table" # Apply migrations alembic upgrade head # Rollback alembic downgrade -1 ``` ### 代码质量 ``` # 格式化代码 black app/ # Lint pylint app/ # Type checking mypy app/ ``` ## 部署 ### Docker Hub ``` docker build -t dhanushatiketi/soc-alert-triage:latest . docker push dhanushatiketi/soc-alert-triage:latest ``` ### Kubernetes 请参阅 `docs/kubernetes-deployment.md` 获取详细的部署说明。 ## 监控与日志 - **应用日志:** 检查 `logs/` 目录 - **Prometheus 指标:** `http://localhost:9090` - **ELK Stack:** 可用于集中式日志管理 ## 支持与文档 - 📖 [完整文档](./docs/) - 🐛 [报告问题](https://github.com/dhanushatiketi/soc-alert-triage/issues) - 💬 [讨论](https://github.com/dhanushatiketi/soc-alert-triage/discussions) ## 许可证 MIT 许可证 - 详情请参阅 LICENSE 文件 ## 作者 - Dhanush Atiketi ## 致谢 - FastAPI 社区 - React 社区 - PostgreSQL 社区 **最后更新:** 2026-07-14
标签:AV绕过, Docker, FastAPI, PostgreSQL, React, SOC告警分诊, Syscalls, 告警富化, 安全运营, 安全防御评估, 扫描框架, 搜索引擎查询, 测试用例, 版权保护, 自定义请求头, 请求拦截, 逆向工具