naveensajeendran/SentinelLog

GitHub: naveensajeendran/SentinelLog

一个轻量级的开源日志分析与威胁检测框架,通过 YAML 规则引擎扫描日志中的可疑活动并触发告警。

Stars: 0 | Forks: 0

# SentinelLog 一个为安全工程师、DevOps 团队和安全分析师设计的生产级、轻量级**日志分析与威胁检测框架**。SentinelLog 使用基于模式的规则以极低的开销检测日志中的可疑活动,并可在 AWS ECS Fargate 上进行水平扩展。 ## 主要特性 - **基于模式的检测** 使用 YAML 定义的规则,实现灵活的威胁检测 - **REST API** 提供 FastAPI 服务及 OpenAPI 文档 - **云原生** 容器化、无状态、可水平扩展 - **热重载规则** 无需重启即可更新检测规则 - **多种告警后端** 支持邮件、Slack、webhook(可扩展) - **全面的测试** 包含 16+ 个单元/集成测试 - **生产级就绪** 包含 CI/CD 流水线、Dockerfile 和 AWS 部署自动化 - **聚焦安全** 输入验证、错误处理、随时可审计 ## 文档 - **[DEPLOYMENT.md](DEPLOYMENT.md)** 完整的部署指南(本地、Docker、AWS ECS) - **[SCALING_SUMMARY.md](SCALING_SUMMARY.md)** 生产就绪检查清单与扩展策略 - **API 文档** 运行时可通过 `/docs` (Swagger) 和 `/openapi.json` 访问 ## API 端点 ### 健康检查 ``` curl http://localhost:8000/health # {"status": "healthy", "service": "sentinellog", "version": "1.0.0"} ``` ### 扫描日志 ``` curl -X POST http://localhost:8000/api/v1/scan \ -H "Content-Type: application/json" \ -d ''{"content": "Failed password for invalid user admin"}'' ``` ### 列出规则 ``` curl http://localhost:8000/api/v1/rules/list ``` ### 热重载规则 ``` curl -X POST http://localhost:8000/api/v1/rules/reload ``` ## 测试 运行测试套件: ``` cd src python -m pytest sentinellog/tests/ -v # 预期:16 passed ``` ## 部署 ### 本地 (Docker) ``` docker build -t sentinellog:latest . docker run -p 8000:8000 sentinellog:latest ``` ### AWS ECS Fargate (自动化) 详见 [DEPLOYMENT.md](DEPLOYMENT.md) 获取详细的设置说明。 ## 性能与扩展性 - **镜像大小**: ~400MB - **启动时间**: 2-3 秒 - **内存**: 512MB (Fargate) - **吞吐量**: 每实例 100+ req/s - **自动扩展**: 1 到 10+ 个实例 - **每月成本**: ~$20-40 (AWS 上的 MVP) ## 安全性 - 输入验证 (Pydantic) - TLS 支持 (AWS ALB) - 密钥管理 (AWS Secrets Manager) - 基于 IAM 角色的访问控制 - 镜像扫描 (ECR) - CI/CD 中的安全检查 (Bandit) ## CI/CD 流水线 包含两个 GitHub Actions 工作流: 1. **ci-cd.yml** 在每次推送时执行测试、lint、构建和推送 2. **deploy-aws.yml** 在推送到 main 分支时部署到 AWS ECS ## 开源协议 MIT License - 详见 [LICENSE](LICENSE) 文件。 ``` Copyright (c) 2025 SentinelLog Technologies Inc. A Gemra Ventures–Associated Company Authors and Co-Founders: Naveen Sajeendran and Midunan Sivasaravanan Permission is granted to licensed users to access and use this product under the terms set by SentinelLog Technologies Inc. No rights are granted to copy, modify, distribute, merge, publish, sublicense, sell, or otherwise transfer any portion of this product without explicit written authorization. All copies or substantial portions of this product must retain this copyright notice. This product is provided “AS IS,” without warranty of any kind, express or implied, including warranties of merchantability, fitness for a particular purpose, or non-infringement. In no event shall the authors, co-founders, or SentinelLog Technologies Inc. be liable for any damages arising from use of the product. Use of this product constitutes acceptance of these terms. All rights not expressly granted are reserved by SentinelLog Technologies Inc. ``` ## 支持 - **GitHub Issues**: [报告 Bug](https://github.com/naveensajeendran/SentinelLog/issues) - **API 文档**: http://localhost:8000/docs - **部署指南**: [DEPLOYMENT.md](DEPLOYMENT.md) **由 Naveen Sajeendran 制作** *安全威胁检测,化繁为简。*
标签:AMSI绕过, AV绕过, FastAPI, Python, YAML规则, 威胁检测, 安全规则引擎, 安全运营, 扫描框架, 无后门, 网络测绘, 请求拦截, 逆向工具