carlosinfantes/cloudsecure

GitHub: carlosinfantes/cloudsecure

基于 AI 的无代理 AWS 安全评估平台,以 serverless 方式扫描多账户并提供 AI 综合分析与合规报告。

Stars: 6 | Forks: 1

CloudSecure

基于 AI 的 AWS 安全评估平台

License Version Python CDK AI

无代理、serverless 的安全评估平台,可扫描任何 AWS 账户并提供 AI 综合的分析结果——无需共享凭证、无需安装代理、无需管理基础设施。 ## 问题所在 传统的安全工具(Prowler、ScoutSuite、Steampipe)运行在工程师的笔记本电脑上: - 需要长期有效的凭证(access keys) - 凭证在网络中传输并存储在本地 - 没有关于谁在何时运行了什么的审计跟踪 - 扩展到多个账户 = 纯手工操作 ## CloudSecure 的不同之处 CloudSecure **100% 在 AWS 内以 serverless 方式运行**。没有 CLI,没有笔记本电脑,不需要共享凭证。 - **通过 IAM role 委派访问权限** — 客户通过 `STS AssumeRole` 和 `ExternalId` 授予只读 role。无需交换凭证,仅委派信任。 - **完全 serverless** — Lambda、Step Functions、DynamoDB、S3。无需安装、修补或维护任何东西。 - **AI 驱动的综合分析** — 7 个 analyzer 并行运行,Bedrock Claude 将原始发现综合为优先的、可操作的情报。 - **设计上即可审计** — 每次评估都会在 DynamoDB 中进行跟踪,并通过 Step Functions 提供完整的执行记录。 ## 报告演示 CloudSecure 生成专业的 HTML 报告,包含基于 AI 的执行摘要、风险评分以及涵盖所有安全领域的详细发现。 ### 评估标题与风险评分 ![报告标题](https://static.pigsec.cn/wp-content/uploads/repos/cas/c5/c554a733cfd6c83202b5deafae3d93ce7b22e8f16b3cc66dfff8ab71c19354c1.png) ### 发现摘要 ![发现摘要](https://static.pigsec.cn/wp-content/uploads/repos/cas/4d/4df7254b39680b953a2cec100d7e2d1426e252bd30d3adeb4e13613fc07d5b7e.png) ### AI 驱动的执行摘要 ![执行摘要](https://static.pigsec.cn/wp-content/uploads/repos/cas/e5/e591eb611f94985e12a5c7e9426ed28d5b5f78a16dafa003b3a2ae36e2f65d69.png) ### 按类别划分的详细发现 ![详细发现](https://static.pigsec.cn/wp-content/uploads/repos/cas/d9/d90d5429ae7ca0a9ce32f31b7e81044d9c6ca983103383d0995fd6fa6ebf83c3.png) ## 架构 ``` ┌──────────────────────────────────────────────────────────────┐ │ CloudSecure Platform │ │ │ │ ┌──────────┐ ┌───────────────┐ ┌────────────────────────┐ │ │ │ API │──│ Step Functions │──│ 7 Lambda Analyzers │ │ │ │ Gateway │ │ Orchestrator │ │ (parallel execution) │ │ │ └──────────┘ └───────────────┘ └────────────────────────┘ │ │ │ │ │ │ │ ┌──────────┐ ┌───────────────┐ ┌────────────────────────┐ │ │ │ DynamoDB │ │ Bedrock │ │ S3 Reports │ │ │ │ │ │ Claude AI │ │ (HTML/JSON/CSV) │ │ │ └──────────┘ └───────────────┘ └────────────────────────┘ │ └──────────────────────────────────────────────────────────────┘ │ STS AssumeRole (read-only) ▼ ┌──────────────────────┐ │ Customer Account │ │ (no agents needed) │ └──────────────────────┘ ``` ## Analyzers | Analyzer | 检查内容 | |----------|---------------| | **IAM** | Users、roles、policies、MFA、未使用的凭证、密码策略 | | **Network** | 安全组、VPC、Flow Logs、公开暴露情况 | | **S3** | 公开 bucket、加密、日志记录、版本控制 | | **Encryption** | EBS、RDS、EFS 静态加密 | | **CloudTrail** | Trail 配置、root 使用情况、metric filter | | **Native Services** | SecurityHub、GuardDuty、Config 发现(如果已启用) | | **Prowler** | CIS AWS 1.4 基准(17 项关键检查) | 所有 analyzer 都通过 Step Functions 并行运行。缺失的安全服务会被报告为发现,而不是阻碍因素。 ## 合规性映射 发现结果映射至:**CIS AWS 1.4** · **NIST 800-53** · **ISO 27001** · **GDPR** · **SOC2** ## 快速开始 ### 前置条件 - 配置了 IAM profile 的 AWS CLI - Node.js 18+ 和 Python 3.12+ - Docker 或 Podman(可选 — Prowler CIS 扫描器必需) ### 安装 CLI ``` pip install cloudsecure # 或 pipx install cloudsecure ``` 或使用安装脚本: ``` curl -fsSL https://raw.githubusercontent.com/carlosinfantes/cloudsecure/main/install.sh | bash ``` ### 部署基础设施 交互式引导部署: ``` git clone https://github.com/carlosinfantes/cloudsecure.git && cd cloudsecure ./deploy.sh ``` 或手动部署: ``` cp .env.example .env # Edit with your AWS profile, region, etc. make install && make deploy # 不使用 Docker/Podman 部署(跳过 Prowler) SKIP_PROWLER=true make deploy ``` ### 接入客户账户 ``` aws cloudformation deploy \ --template-file onboarding/cloudformation/cloudsecure-role.yaml \ --stack-name CloudSecure-AssessmentRole \ --capabilities CAPABILITY_NAMED_IAM \ --parameter-overrides ExternalId=your-external-id ``` ### 升级组件 ``` # 升级所有内容(基础设施 + Prowler + CLI) ./deploy.sh --upgrade # 仅升级特定组件 ./deploy.sh --upgrade infra # Redeploy CDK stacks ./deploy.sh --upgrade prowler # Pull latest Prowler image + redeploy ./deploy.sh --upgrade cli # Upgrade CLI from PyPI ``` ### 运行评估 ``` # 启动评估 — 默认扫描所有内容 cloudsecure --profile YOUR_PROFILE assess \ --account-id 123456789012 \ --role-arn arn:aws:iam::123456789012:role/CloudSecureAssessmentRole \ --external-id your-external-id # 仅扫描特定服务 cloudsecure --profile YOUR_PROFILE assess \ --account-id 123456789012 \ --role-arn arn:aws:iam::123456789012:role/CloudSecureAssessmentRole \ --external-id your-external-id \ --scope iam --scope s3 # 列出所有评估 cloudsecure --profile YOUR_PROFILE status # 检查特定评估 cloudsecure --profile YOUR_PROFILE status # 下载报告(HTML 在浏览器中打开) cloudsecure --profile YOUR_PROFILE report --format html --open # 导出为 JSON 或 CSV cloudsecure --profile YOUR_PROFILE report --format json -o report.json ``` ### 报告 ``` s3://cloudsecure-reports-ACCOUNT_ID/assessments/ASSESSMENT_ID/ ├── report.html # Executive report with AI synthesis ├── report.json # Full findings export └── report.csv # Spreadsheet format ``` ## 技术栈 | 组件 | 技术 | |-----------|-----------| | 基础设施 | AWS CDK (TypeScript) | | Analyzers | Python 3.12 (Lambda) | | 编排 | AWS Step Functions | | API | API Gateway REST (IAM auth) | | 数据库 | DynamoDB | | 存储 | S3 + KMS 加密 | | AI 综合 | AWS Bedrock (Claude) | | 安全扫描器 | Prowler 5.x (Lambda container,可选) | | 报告 | HTML、JSON、CSV (Jinja2 模板) | | CLI | Python (click、rich、boto3) — `pip install cloudsecure` | ## 文档 - [技术规范](./docs/cloudsecure-assessment-platform-spec.md) - [实施进度](./IMPLEMENTATION.md) - [架构图](./docs/diagrams/) - [CLI 文档](./cli/README.md) ## 许可证 Apache-2.0 — 参见 [LICENSE](./LICENSE)
标签:AI分析, AWS, DPI, XSS跨站脚本, 反取证, 安全评估, 对称加密, 自动化审计, 请求拦截, 逆向工具