vy54kh/AWS-security-incident-response

GitHub: vy54kh/AWS-security-incident-response

一款专为AWS免费套餐用户设计的轻量级安全与计费监控仪表板,利用机器学习实现异常检测与事件分类。

Stars: 0 | Forks: 0

# AWS 免费套餐事件响应仪表板 ![Python](https://img.shields.io/badge/Python-3776AB?style=flat-square&logo=python&logoColor=white) ![AWS](https://img.shields.io/badge/AWS-232F3E?style=flat-square&logo=amazonwebservices&logoColor=white) ![Dash](https://img.shields.io/badge/Dash-008DE4?style=flat-square&logo=plotly&logoColor=white) ![Plotly](https://img.shields.io/badge/Plotly-3F4F75?style=flat-square&logo=plotly&logoColor=white) ![GuardDuty](https://img.shields.io/badge/GuardDuty-FF9900?style=flat-square&logo=amazonaws&logoColor=white) ## 概述 大多数云安全工具都是为企业预算构建的。本项目将企业级安全监控引入 AWS 免费套餐用户——包括个人开发者、学生和小型企业——且无需任何额外成本。 该仪表板实时监控 EC2 实例、GuardDuty 发现、CloudTrail 日志和计费阈值,使用轻量级 ML 模型检测异常并按严重程度对事件进行分类。所有操作均在 AWS 免费套餐限制内运行。 ## 功能 - **自动化事件检测** — 每 15 分钟(EC2)、30 分钟(GuardDuty)、12 小时(计费)进行一次计划检查 - **ML 异常检测** — 识别细微的安全模式并减少误报 - **严重性分类** — 自动确定事件的优先级,让您专注于重要事项 - **成本阈值监控** — 在超出免费套餐限制前提供预警 - **交互式仪表板** — 使用 Dash 和 Plotly 构建,可通过任何浏览器访问 - **事件日志记录** — 完整的历史记录,带有统计可视化和深度分析 ## 架构 ``` AWS Services (EC2, GuardDuty, CloudTrail, Billing) │ ▼ boto3 (AWS SDK) │ ▼ Scheduled Monitoring Engine ├── Rate-limited API calls ├── ML anomaly detection model └── Severity classifier │ ▼ JSON local storage (max 50 incidents) │ ▼ Dash / Plotly dashboard ``` 专为资源效率而设计:批处理计划任务保持较低的 API 调用量,基于文件的 JSON 存储避免了使用任何额外的数据库服务。 ## 技术栈 | 层级 | 技术 | |---|---| | 仪表板 | Python, Dash, Plotly | | AWS 集成 | boto3 | | ML / 检测 | scikit-learn (异常检测) | | 受监控的服务 | EC2, GuardDuty, CloudTrail, 计费 | | 存储 | 本地 JSON (无需数据库) | ## 入门指南 **前置条件** - Python 3.8+ - AWS 账户 (免费套餐) - 已配置 AWS 凭证 (`aws configure`) **安装依赖** ``` pip install -r requirements.txt ``` **运行仪表板** ``` python app.py ``` 在浏览器中打开 `http://localhost:8050`。 ## 所需的 AWS 权限 系统需要对以下服务的只读访问权限: ``` ec2:DescribeInstances ec2:DescribeSecurityGroups guardduty:ListFindings guardduty:GetFindings cloudtrail:LookupEvents ce:GetCostAndUsage ``` 无需写入权限 — 系统仅进行监控,从不修改资源。 ## 后续工作 - 集成 AWS Cost Explorer 以进行更深入的计费分析 - 扩展 ML 功能以实现预测性事件响应 - 支持多账户 - 增加服务覆盖范围 (S3, RDS, Lambda)
标签:Apex, AWS, AWS Free Tier, boto3, CloudTrail, Dash, DPI, EC2 监控, GuardDuty, Plotly, Python, 事件分类, 云计算安全, 安全告警, 安全态势感知, 安全监控大屏, 异常检测, 成本控制, 无后门, 机器学习, 漏洞利用检测, 自动化事件响应, 账单预警, 逆向工具