Su1ph3r/Nubicustos

GitHub: Su1ph3r/Nubicustos

多云安全情报平台,整合 24+ 款安全工具的扫描输出,通过攻击路径分析和合规映射将原始数据转化为可执行的安全情报。

Stars: 6 | Forks: 0

# Nubicustos [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Python 3.11+](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python&logoColor=white)](https://python.org) [![Docker](https://img.shields.io/badge/Docker-Required-2496ED?logo=docker&logoColor=white)](https://docker.com) [![Version](https://img.shields.io/badge/Version-1.0.4-green.svg)](CHANGELOG.md) [![GitHub stars](https://img.shields.io/github/stars/Su1ph3r/Nubicustos?style=social)](https://github.com/Su1ph3r/Nubicustos/stargazers) [![GitHub last commit](https://img.shields.io/github/last-commit/Su1ph3r/Nubicustos)](https://github.com/Su1ph3r/Nubicustos/commits/main) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![Cloud Support](https://img.shields.io/badge/Cloud-AWS%20%7C%20Azure%20%7C%20GCP%20%7C%20K8s-orange.svg)](#multi-cloud-support) *名称源自拉丁语:nubes (云) + custos (守护者)* ## 为什么选择 Nubicustos? 运行安全扫描器很容易。**理解结果的含义很难。** Nubicustos 不仅仅是运行工具 - 它将原始扫描器输出转化为**可执行的安全情报**: | 挑战 | Nubicustos 如何解决 | |-----------|--------------------------| | **24+ 种工具,24+ 种报告格式** | 统一的发现数据库,具有标准化的严重性、状态和资源映射 | | **成千上万条发现,缺乏上下文** | 攻击路径分析将发现关联为可利用的链条 | | “这真的可以被利用吗?” | 概念验证命令可在您的环境中验证发现 | | “我们合规吗?” | 自动映射到 29+ 个合规框架(CIS, SOC2, PCI-DSS, HIPAA, NIST 等) | | “自上次扫描以来有什么变化?” | 具有 MTTR 指标和趋势分析的历史追踪 | | “我该如何修复这个问题?” | 包含 AWS CLI 命令和分步指导的修复知识库 | ## 核心能力 ### 统一的安全情报 Nubicustos 将 24+ 种安全工具的输出标准化为一个单一的、可查询的数据库: - **所有发现的统一视图** - 无需在不同工具的仪表板之间切换 - **一致的严重性映射** - 无论来源工具如何,统一为 Critical/High/Medium/Low - **资源关联** - 查看特定资源在所有工具中的所有发现 - **去重** - 识别多个工具标记同一问题的情况 ### 攻击路径发现 超越单一的发现,理解**攻击者如何链接漏洞**: - **基于图的分析** - 识别通过您的基础设施的多步骤攻击链 - **入口点映射** - 显示攻击者可能获得初始访问权限的位置 - **MITRE ATT&CK 集成** - 将攻击路径映射到战术和技术 - **风险评分 (0-100)** - 根据可利用性和影响确定路径优先级 - **PoC 生成** - 用于验证每一步可利用性的 AWS CLI 命令 ### 合规映射 自动将发现映射到 **29+ 个合规框架**: - AWS CIS Benchmarks (1.4, 1.5, 2.0, 2.1, 3.0) - SOC 2, PCI-DSS 3.2.1, HIPAA - NIST 800-53 (Rev 4 & 5), NIST 800-171, NIST CSF - FedRAMP (Low & Moderate), CISA - GDPR, ISO 27001, MITRE ATT&CK - AWS Well-Architected Framework (Security & Reliability Pillars) - 更多... ### 概念验证验证 不要只报告发现 - **证明它们是可利用的**: - **PoC 命令** - 生成的 AWS CLI 命令用于验证发现 - **凭据验证** - TruffleHog 验证凭据是否实际处于活动状态 - **权限提升路径** - PMapper 精确显示如何提升权限 - **可利用性评分** - 根据现实世界的可利用性对发现进行评级 ### IAM 深度分析 通过专业分析了解您的 IAM 攻击面: - **权限提升路径** - PMapper 图分析显示所有通往管理员权限的路径 - **策略风险分析** - Cloudsplaining 识别权限过大的策略 - **代入角色链** - 跨账户追踪角色代入路径 - **Lambda 执行角色** - 识别具有危险权限的函数 - **IMDS 漏洞** - 查找易受元数据攻击的 EC2 实例 ### 历史追踪与趋势 安全态势的时间维度,而不仅仅是时间点快照: - **扫描比较** - 查看扫描之间新增、已修复或未更改的内容 - **MTTR 指标** - 平均修复时间追踪 - **趋势分析** - 按严重性追踪发现数量随时间的变化 - **修复速度** - 衡量您安全团队的有效性 ## 快速开始 ``` # 1. 克隆 repository git clone https://github.com/Su1ph3r/Nubicustos.git cd Nubicustos # 2. 启动 stack docker compose up -d # 3. 访问 web interface open http://localhost:8080 # 4. 添加 credentials (通过 UI 或 mount) mkdir -p credentials/aws cp ~/.aws/credentials credentials/aws/ cp ~/.aws/config credentials/aws/ # 5. 运行您的第一次扫描 curl -X POST http://localhost:8000/api/scans \ -H "Content-Type: application/json" \ -d '{"profile": "quick", "aws_profile": "default"}' ``` ## 架构概览 ``` ┌─────────────────────────────────────────────────────────────────────────────┐ │ NUBICUSTOS │ │ Cloud Security Intelligence Platform │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ │ │ SCAN ENGINE │ │ ANALYSIS │ │ PRESENTATION │ │ │ │ │ │ │ │ │ │ │ │ • 24+ Tools │───▶│ • Normalization │───▶│ • Vue.js UI │ │ │ │ • On-demand │ │ • Attack Paths │ │ • REST API │ │ │ │ • Parallel Exec │ │ • Compliance │ │ • MCP Server │ │ │ │ • Error Track │ │ • PoC Gen │ │ • Exports │ │ │ └─────────────────┘ └─────────────────┘ └─────────────────┘ │ │ │ │ │ │ │ └──────────────────────┼──────────────────────┘ │ │ ▼ │ │ ┌─────────────────────────┐ │ │ │ DATA LAYER │ │ │ │ │ │ │ │ PostgreSQL │ Neo4j │ │ │ │ (Findings) │ (Graph) │ │ │ └─────────────────────────┘ │ └─────────────────────────────────────────────────────────────────────────────┘ ``` ### 集成工具 | 类别 | 工具 | |----------|-------| | **云安全** | Prowler, ScoutSuite, CloudSploit, Pacu, CloudFox, Cloud Custodian | | **AWS 深度挖掘** | Enumerate-IAM, PMapper, Cloudsplaining, CloudMapper | | **Kubernetes** | kube-bench, Kubescape, kube-hunter, Trivy, Grype, Polaris, Falco | | **机密信息** | TruffleHog (700+ 探测器), Gitleaks | | **IaC 扫描** | Checkov, Terrascan, tfsec | | **资产映射** | Cartography (Neo4j graph) | ## 多云支持 ### AWS - **Prowler** - AWS 安全最佳实践和 CIS benchmarks - **ScoutSuite** - 多服务安全审计 - **Pacu** - 用于测试的 AWS 利用框架 - **CloudFox** - AWS 攻击面枚举 - **Enumerate-IAM** - 全面的 IAM 权限映射 - **CloudSploit** - 配置安全扫描 - **Cloud Custodian** - 基于策略的治理 - **CloudMapper** - AWS 账户可视化 ### Azure - **ScoutSuite** - Azure 安全配置审查 - **CloudSploit** - Azure 资源扫描 - **Cloud Custodian** - Azure 策略执行 ### GCP - **Prowler** - GCP 安全态势评估 - **ScoutSuite** - GCP 多服务审计 - **CloudSploit** - GCP 配置扫描 ### Kubernetes - **kube-bench** - CIS Kubernetes Benchmark - **Kubescape** - NSA, MITRE ATT&CK 框架 - **kube-hunter** - 渗透测试 - **Trivy** - 容器漏洞扫描 - **Falco** - 运行时威胁检测 - **Polaris** - 最佳实践验证 ### 基础设施即代码 - **Checkov** - Terraform, CloudFormation, Kubernetes, Helm - **Terrascan** - 策略即代码引擎 - **tfsec** - Terraform 安全扫描器 ### 机密信息扫描 - **TruffleHog** - 700+ 个带有 API 验证的秘密探测器 - **Gitleaks** - 具有广泛规则集的快速 git 机密扫描器 ### IAM 深度分析 - **PMapper** - IAM 权限提升路径分析 - **Cloudsplaining** - AWS 托管策略分析和最小权限违规 ## Web 前端 Nubicustos 包含一个现代 Vue.js 3 Web 界面,具有 22+ 个专用视图: | 视图 | 描述 | |------|-------------| | **仪表板** | 具有关键指标的安全态势概览 | | **发现** | 具有严重性过滤和导出功能的可搜索列表 | | **攻击路径** | 发现的攻击链的图形可视化 | | **合规性** | 框架合规状态 (CIS, SOC2, PCI-DSS) | | **合规详情** | 特定框架的控制细分 | | **扫描** | 扫描历史、编排、批量操作和监控 | | **公共暴露** | 暴露的资源和攻击面 | | **暴露的凭据** | 泄露的凭据检测 | | **权限提升** | IAM 横向移动路径 | | **Privesc Paths** | 详细的权限提升路径浏览器 | | **代入角色** | IAM 角色代入分析 | | **IMDS 检查** | EC2 元数据服务漏洞 | | **Lambda 分析** | Serverless 安全评估 | | **CloudFox** | AWS 枚举结果 | | **Pacu** | AWS 利用发现 | | **Enumerate IAM** | IAM 权限映射 | | **凭据** | 云凭据配置文件管理 | | **设置** | 配置管理 | 启动堆栈后,通过 `http://localhost:8080` 访问前端。 ## 扫描配置文件 | Profile | Duration | Description | |---------|----------|-------------| | `quick` | 5-10 min | 快速安全评估 - 仅 Prowler | | `comprehensive` | 30-60 min | 使用所有适用工具进行全面审计 | | `compliance-only` | 15-20 min | 侧重于合规性的检查 (Prowler + ScoutSuite) | | `secrets` | 2-5 min | TruffleHog + Gitleaks 机密扫描 | | `iam-analysis` | 10-15 min | PMapper + Cloudsplaining IAM 深度挖掘 | | `iac` | 2-5 min | 基础设施即代码扫描 | ``` # 通过 API curl -X POST http://localhost:8000/api/scans \ -H "Content-Type: application/json" \ -d '{"profile": "comprehensive", "aws_profile": "prod-audit"}' # 通过 UI # 导航到 Scans 页面 → Quick Actions → 选择 profile → 开始 ``` ## 使用示例 ### 运行扫描 ``` # 使用所有 tools 的完整审计 ./scripts/run-all-audits.sh # 快速扫描 (5-10 分钟) ./scripts/run-all-audits.sh --profile quick # 全面扫描 (30-60 分钟) ./scripts/run-all-audits.sh --profile comprehensive # 合规性聚焦扫描 ./scripts/run-all-audits.sh --profile compliance-only # 按 severity 筛选 ./scripts/run-all-audits.sh --severity critical,high # 预览而不执行 ./scripts/run-all-audits.sh --dry-run ``` ### 机密信息扫描 ``` # 使用 TruffleHog 和 Gitleaks 扫描暴露的 secrets curl -X POST http://localhost:8000/api/scans \ -H "Content-Type: application/json" \ -d '{"profile": "secrets", "target_path": "/path/to/code"}' # 查询 secrets findings curl "http://localhost:8000/api/findings?tool=trufflehog" curl "http://localhost:8000/api/findings?tool=gitleaks" ``` **机密信息扫描功能:** - **TruffleHog** - 700+ 个带有 API 验证的机密探测器,用于检测活动凭据 - **Gitleaks** - 具有广泛规则覆盖范围的快速基于模式的检测 - 发现中的自动机密编辑(仅显示前 4 个字符) - 严重性映射:已验证的机密 = Critical,云提供商密钥 = High ### IAM 深度分析 ``` # 分析 IAM privilege escalation 路径和 policy 风险 curl -X POST http://localhost:8000/api/scans \ -H "Content-Type: application/json" \ -d '{"profile": "iam-analysis", "aws_profile": "your-profile"}' # 查询 IAM findings curl "http://localhost:8000/api/findings?tool=pmapper" curl "http://localhost:8000/api/findings?tool=cloudsplaining" ``` **IAM 分析功能:** - **PMapper** - 基于图的 IAM 权限提升路径发现 - **Cloudsplaining** - 识别 IAM 策略中的最小权限违规 - 风险类别:权限提升、资源暴露、数据渗出、基础设施修改 ### 预检权限验证 ``` # 检查所有 cloud provider 权限 python scripts/check-permissions.py # 检查特定 provider python scripts/check-permissions.py --provider aws # 导出及 remediation 指导 python scripts/check-permissions.py --output report.md --remediation ``` ### 比较扫描 ``` # 使用 MTTR 指标比较两次扫描 python3 report-processor/compare_scans.py \ --baseline-id abc123 \ --current-id def456 \ --include-mttr ``` ### 批量操作 ``` # 删除多个扫描 curl -X DELETE http://localhost:8000/api/scans/bulk \ -H "Content-Type: application/json" \ -d '{"scan_ids": ["id1", "id2", "id3"]}' # 将扫描归档为可下载 ZIP curl -X POST http://localhost:8000/api/scans/bulk/archive \ -H "Content-Type: application/json" \ -d '{"scan_ids": ["id1", "id2"]}' # 列出可用 archives curl http://localhost:8000/api/scans/archives # 获取单次扫描的逐 tool 错误细分 curl http://localhost:8000/api/scans/{scan_id}/errors ``` ### 动态 AWS Profiles ``` # 使用特定 AWS credential profile 扫描 curl -X POST http://localhost:8000/api/scans \ -H "Content-Type: application/json" \ -d '{"profile": "comprehensive", "aws_profile": "prod-audit"}' # 列出可用的 AWS profiles curl http://localhost:8000/api/credentials/aws/profiles ``` ## API 亮点 ``` # 获取来自所有 tools 的统一 findings curl "http://localhost:8000/api/findings?severity=critical,high" # 查看带有风险评分的 attack paths curl http://localhost:8000/api/attack-paths # 检查合规性状态 curl http://localhost:8000/api/compliance # 导出 findings 及 remediation 指导 curl http://localhost:8000/api/exports/csv -o findings.csv # 使用 MTTR 指标比较扫描 curl "http://localhost:8000/api/scans/compare?baseline=abc123¤t=def456" # 获取 privilege escalation 路径 curl http://localhost:8000/api/privesc-paths ``` 完整的 API 文档可在 `http://localhost:8000/docs` (Swagger UI) 获取。 ## 用于 LLM 集成的 MCP Server 通过 Model Context Protocol 将 Nubicustos 与 Claude、GPT 或其他 LLM 集成: ``` { "mcpServers": { "nubicustos": { "command": "python", "args": ["-m", "nubicustos_mcp.server"], "env": { "NUBICUSTOS_MCP_API_URL": "http://localhost:8000" } } } } ``` 用自然语言询问有关您安全态势的问题: - *“我的 AWS 账户中最关键的发现是什么?”* - *“显示所有通往管理员的权限提升路径”* - *“我们是否符合 CIS 2.0?”* - *“从面向公共的资源存在哪些攻击路径?”* ### 可用的 MCP 工具 | 类别 | 工具 | |----------|-------| | **扫描管理** | list_scans, trigger_scan, get_scan_status, cancel_scan | | **发现查询** | search_findings, get_findings_summary, get_finding_details | | **攻击路径** | list_attack_paths, analyze_attack_paths, list_privesc_paths | | **AWS 安全** | get_imds_checks, get_lambda_analysis, run_cloudfox | | **导出** | export_findings, get_export_summary | | **批量操作** | bulk_delete_scans, bulk_archive_scans | | **错误分析** | get_scan_errors, get_tool_status | | **归档** | list_archives, download_archive | | **代入角色** | analyze_assumed_roles, list_role_chains | 请参阅 [MCP Server 指南](nubicustos-mcp/README.md) 获取设置说明。 ## 文档 | 文档 | 描述 | |----------|-------------| | [安装指南](INSTALL.md) | 详细的设置说明 | | [速查表](CHEATSHEET.md) | 常用命令快速参考 | | [MCP Server 指南](nubicustos-mcp/README.md) | 通过 Model Context Protocol 进行 LLM 集成 | | [架构](STRUCTURE.md) | 详细的架构文档 | | [贡献](CONTRIBUTING.md) | 如何为项目做出贡献 | | [更新日志](CHANGELOG.md) | 版本历史和发布说明 | ## 系统要求 | 要求 | 最低 | 推荐 | |-------------|---------|-------------| | Docker Engine | 20.10+ | 最新版 | | Docker Compose | 2.0+ | 最新版 | | RAM | 16GB | 32GB | | 磁盘空间 | 50GB | 100GB | ## 端 | 端口 | 服务 | 描述 | |------|---------|-------------| | 8080 | Nginx | Web 前端 | | 8000 | FastAPI | REST API | | 5432 | PostgreSQL | Findings 数据库 | | 7474 | Neo4j HTTP | Graph 浏览器 | | 7687 | Neo4j Bolt | Graph 查询 | ## 跨工具集成 Nubicustos 参与跨工具安全管道: ``` Nubicustos (cloud) ──containers──> Cepheus (container escape) Reticustos (network) ──endpoints──> Indago (API fuzzing) Indago (API fuzzing) ──WAF-blocked──> BypassBurrito (WAF bypass) Ariadne (attack paths) ──endpoints──> Indago (API fuzzing) All tools ──findings──> Vinculum (correlation) ──export──> Ariadne (attack paths) ``` ### 导出容器 导出容器清单以进行 Cepheus 容器逃逸分析: ``` curl -o containers.json "http://localhost:8000/api/exports/containers" cepheus analyze containers.json --from-nubicustos ``` ### 导出发现 导出发现以进行 Vinculum 关联: ``` curl -o findings.json "http://localhost:8000/api/exports/findings/json?scan_id=SCAN_ID" vinculum ingest findings.json --format ariadne --output correlated.json ``` 另请参阅:[Vinculum](https://github.com/Su1ph3r/vinculum) | [Reticustos](https://github.com/Su1ph3r/Reticustos) | [Indago](https://github.com/Su1ph3r/indago) | [BypassBurrito](https://github.com/Su1ph3r/bypassburrito) | [Cepheus](https://github.com/Su1ph3r/Cepheus) | [Ariadne](https://github.com/Su1ph3r/ariadne) ## 贡献 我们欢迎贡献!有关指南,请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。 ## 安全 发现了漏洞?请使用 GitHub 的私有漏洞报告或直接给维护者发邮件。不要为安全问题开启公开 issue。 ### 安全特性 - **路径遍历保护** - 所有文件操作均通过 `os.path.realpath()` 验证,以防止目录逃逸 - **Zip Slip 防护** - 归档提取已针对路径操纵攻击进行安全加固 - **ReDoS 缓解** - 对正则表达式模式进行输入长度限制,以防止拒绝服务 - **日志清洗** - 凭据、令牌和 IP 地址自动从日志中删除 - **错误信息控制** - 限制验证错误详情,以防止 schema 泄露 - **SQLAlchemy 错误处理** - 特定的异常处理以防止信息泄露 ## 许可证 MIT License - 详情请参阅 [LICENSE](LICENSE)。 ## 致谢 Nubicustos 构建于以下优秀的开源安全工具之上: | 工具 | 用途 | 许可证 | |------|---------|---------| | [Prowler](https://github.com/prowler-cloud/prowler) | 云安全态势管理 | Apache-2.0 | | [ScoutSuite](https://github.com/nccgroup/ScoutSuite) | 多云安全审计 | GPL-2.0 | | [Kubescape](https://github.com/kubescape/kubescape) | Kubernetes 安全平台 | Apache-2.0 | | [kube-bench](https://github.com/aquasecurity/kube-bench) | CIS Kubernetes Benchmark | Apache-2.0 | | [Trivy](https://github.com/aquasecurity/trivy) | 容器漏洞扫描器 | Apache-2.0 | | [Checkov](https://github.com/bridgecrewio/checkov) | IaC 安全扫描器 | Apache-2.0 | | [Falco](https://github.com/falcosecurity/falco) | 运行时威胁检测 | Apache-2.0 | | [Cartography](https://github.com/lyft/cartography) | 资产清单映射 | Apache-2.0 | | [TruffleHog](https://github.com/trufflesecurity/trufflehog) | 带验证的机密检测 | AGPL-3.0 | | [Gitleaks](https://github.com/gitleaks/gitleaks) | Git 机密扫描器 | MIT | | [PMapper](https://github.com/nccgroup/PMapper) | IAM 权限提升分析 | AGPL-3.0 | | [Cloudsplaining](https://github.com/salesforce/cloudsplaining) | AWS IAM 策略分析 | BSD-3-Clause | 完整归属说明请参阅 [NOTICE](NOTICE)。 ## 路线图 - [ ] IBM Cloud 支持 - [ ] SIEM 平台集成 - [ ] Slack/Teams 通知 - [ ] 自动化计划扫描 - [ ] 多租户支持

将安全扫描器的噪音转化为可执行的情报。

标签:CISA项目, CIS 基准, DevSecOps, Docker, GCP 安全, GPT, GraphQL安全矩阵, HIPAA, HTTP/HTTPS抓包, K8s 安全, Kubernetes 安全, LIDS, MTTR 分析, NIST, PCI-DSS, Python, SOC2, 上游代理, 安全合规, 安全工具集成, 安全态势管理, 安全情报, 安全扫描器, 安全防御评估, 态势感知, 攻击路径分析, 无后门, 模型鲁棒性, 测试用例, 漏洞修复, 漏洞管理, 网络代理, 网络安全培训, 自动化安全审计, 请求拦截, 逆向工具