AmarjeetkaurDhillon/aws-security-audit-tool

GitHub: AmarjeetkaurDhillon/aws-security-audit-tool

一款基于 Python 的 AWS 安全审计工具,自动检测云环境中的配置错误并生成带有修复指南的严重性分级报告。

Stars: 0 | Forks: 0

# AWS 安全态势审计工具 一款基于 Python 的自动化安全审计工具,可扫描 AWS 环境中的配置错误,并生成带有修复指南的严重性分级 HTML 报告。 ## 演示 ### 审计报告 ![AWS 安全审计报告](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/b7525549ba235534.png) ### 测试结果 ![测试套件](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/5edef4503b235539.png) ## 检测内容 | 检查项 | 严重性 | |-------|----------| | 通过 ACL 公开访问的 S3 存储桶 | CRITICAL | | 禁用 CloudTrail 日志记录 | CRITICAL | | 未启用 MFA 的 IAM 用户 | HIGH | | 超过 90 天的 IAM 访问密钥 | HIGH | | 未加密的 EBS 卷 | MEDIUM | ## 技术栈 - Python 3.11 - boto3 — AWS SDK - moto — 用于测试的 AWS mocking - jinja2 — HTML 报告生成 - pytest — 测试套件 ## 项目结构 ``` aws-security-audit-tool/ ├── src/ │ ├── main.py # Entry point and report generator │ └── checkers.py # All security check functions ├── templates/ │ └── report.html # Jinja2 HTML report template ├── images/ │ ├── aws-report.png │ └── aws-tests.png ├── tests/ │ └── test_checkers.py # Full test suite (6 tests) ├── requirements.txt └── README.md ``` ## 设置 ``` pip install -r requirements.txt aws configure ``` ## 使用方法 ``` # 审计默认 region python src/main.py # 审计特定 region python src/main.py --region us-east-1 # 指定输出文件 python src/main.py --output my-report.html ``` ## 运行测试 ``` pytest tests/ -v ``` ## 测试结果 所有 6 项测试均已通过: - S3 公开存储桶检测 - S3 私有存储桶安全检查 - 未启用 MFA 的 IAM 用户检测 - 禁用 CloudTrail 检测 - 未加密的 EBS 卷检测 - 已加密 EBS 卷安全检查 ## 示例报告 该工具会生成一个清晰的 HTML 报告,显示: - 包含严重性统计的发现总数摘要 - 每项发现的资源名称、问题描述和修复指南 - 颜色编码的严重性指示器 (CRITICAL/HIGH/MEDIUM) ## 作者 Amarjeet Kaur Dhillon — 南安普顿大学网络安全理学硕士 Amazon AWS DC 安全专家实习生 (2026 年 9 月) [LinkedIn](https://www.linkedin.com/in/amarjeet-kaur-dhillon-545672214) [GitHub](https://github.com/AmarjeetkaurDhillon)
标签:AWS, DPI, Python, 关系图谱, 后端开发, 基线检查, 安全规则引擎, 无后门, 逆向工具