openshield-org/openshield

GitHub: openshield-org/openshield

一款开源的 Azure 云安全态势管理工具,提供配置错误扫描、后量子密码学风险检测、合规映射与一键修复能力。

Stars: 54 | Forks: 64

# OpenShield [![GitHub Repo stars](https://img.shields.io/github/stars/openshield-org/openshield?style=flat-square)](https://github.com/openshield-org/openshield/stargazers) [![GitHub forks](https://img.shields.io/github/forks/openshield-org/openshield?style=flat-square)](https://github.com/openshield-org/openshield/network/members) [![GitHub contributors](https://img.shields.io/github/contributors/openshield-org/openshield?style=flat-square)](https://github.com/openshield-org/openshield/graphs/contributors) [![GitHub last commit](https://img.shields.io/github/last-commit/openshield-org/openshield?style=flat-square)](https://github.com/openshield-org/openshield/commits/main) [![GitHub issues](https://img.shields.io/github/issues/openshield-org/openshield?style=flat-square)](https://github.com/openshield-org/openshield/issues) [![GitHub license](https://img.shields.io/github/license/openshield-org/openshield?style=flat-square)](LICENSE) [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3110/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/cas/55/55a85deec4bc9bfc6351cfcb46ea2ec26099f3fdc6568fbebddd87504c384319.svg)](https://github.com/openshield-org/openshield/actions/workflows/ci.yml) [![Deploy](https://static.pigsec.cn/wp-content/uploads/repos/cas/bf/bf94870d299ff68a77a7f77d9716734b8ca82059d879a7050ea4d95831288f23.svg)](https://github.com/openshield-org/openshield/actions/workflows/deploy.yml) [![Security Policy](https://img.shields.io/badge/security-policy-green.svg)](.github/SECURITY.md) [![OWASP](https://img.shields.io/badge/OWASP-listing%20review-orange.svg)](https://owasp.org) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289da)](https://discord.gg/openshield) ## 问题所在 像 **Wiz**、**Prisma Cloud** 和 **Microsoft Defender for Cloud** 这样的企业云安全工具,每年的成本高达 **50,000 至 500,000 美元**。 初创公司、中小企业、大学和学生团队对其 Azure 的安全状况**完全缺乏可见性**。配置错误的存储 blob、权限过高的服务主体,或开放的 NSG 规则可能会连续数月处于未被发现的状态。 **OpenShield 旨在改变这一现状。** ## 为什么后量子密码学现在至关重要** 对手正在收集当前的 Azure 加密流量,以便在量子计算机可用时对其进行解密。这被称为“先收集,后解密”攻击,并且这种攻击正在发生。 OpenShield 会扫描 Azure 中需要在为时已晚之前进行迁移的经典密码资产: - App Services 上使用 RSA 或 ECDH 密钥交换的 TLS 配置 - Key Vault 中使用易受 Shor 算法攻击的 RSA 或 ECC 算法的密钥 - 使用经典签名算法的证书 扫描结果会映射到 NIST FIPS 203 (ML-KEM)、FIPS 204 (ML-DSA) 和 FIPS 205 (SLH-DSA),并直接输入到后量子迁移规划中。 ## OpenShield 的功能 | 功能 | 描述 | |---|---| | **配置错误扫描器** | 对存储、网络、身份、数据库、计算、Key Vault 和后量子密码学运行 39 条 Azure 安全规则 | | **合规映射器** | 将扫描结果映射到 CIS Benchmarks、NIST CSF、ISO 27001 和 SOC 2 框架的 JSON 文件中 | | **扫描历史 API** | 将扫描和结果存储在 PostgreSQL 中,并通过 REST 暴露扫描结果、评分、扫描历史、合规状况、偏差和资源清单 | | **修复手册** | 每条规则都附带匹配的 Azure CLI 修复脚本(共 36 个手册) | | **安全仪表板** | 部署在 Vercel 上的全功能 React 仪表板 —— 提供实时监控、扫描结果、合规状况、偏差、优先级排序和 AI 层视图 | | **项目网站** | 提供文档和参考网站的 [openshield-website.vercel.app](https://openshield-website.vercel.app) —— 包含博客、规则库、文档、路线图、版本发布和交互式演练场 | | **Sentinel 集成** | 规范化扫描结果,并通过 Log Analytics 自定义表和 KQL 分析规则将其推送到 Microsoft Sentinel | ## 架构 ``` flowchart TD A["React Dashboard\nVercel · Live"] B["Flask REST API\nJWT · CORS · Blueprints"] C["Scanner Engine\n39 Python rules"] D["Azure Subscription\nScanned via Azure SDK + Graph"] E["Compliance Framework JSON\nCIS · NIST · ISO 27001 · SOC 2"] F["PostgreSQL Database\nFindings · Scans"] G["Azure CLI Playbooks\n39 remediation scripts"] H["sentinel/ingest.py\nNormalise + HMAC upload"] I["Microsoft Sentinel\nOpenShieldFindings_CL · KQL rules"] A -->|REST calls| B B -->|trigger scans| C B -->|read/write| F B -->|compliance score| E C -->|Azure SDK + Graph| D C -->|findings| F C -->|scan output JSON| H G -->|manual fixes| D H -->|Data Collector API| I I -->|alerts| A ``` ## 在线演示 | 服务 | URL | |---|---| | **安全仪表板** (Vercel) | `https://openshield-gules.vercel.app` | | **REST API** (Render) | `https://openshield-api.onrender.com` | | **项目网站** | `https://openshield-website.vercel.app` | ## 技术栈 | 层级 | 技术 | 成本 | |---|---|---| | 项目网站 | 静态 HTML + Tailwind CDN,部署在 Vercel | 免费 | | 安全仪表板 | React + Vite + Tailwind,部署在 Vercel | 免费 | | 后端 API | Python + Flask | 免费 | | 数据库 | PostgreSQL | Render 托管的 PostgreSQL | | 云扫描器 | Python + Azure SDK | 免费 | | 修复 | Azure CLI 手册 | 免费 | | SIEM | Microsoft Sentinel | 90 天免费试用 | | CI/CD | GitHub Actions | 免费 | | 仓库 | GitHub | 免费 | ## 项目结构 ``` openshield/ ├── scanner/ # Azure misconfiguration rule engine │ ├── rules/ # Individual scan rules (contribute here!) │ ├── engine.py # Core scanning orchestration │ └── azure_client.py # Azure SDK wrapper ├── compliance/ # Framework mapping engine │ └── frameworks/ # CIS, NIST, ISO 27001, SOC 2 mappings ├── playbooks/ # Remediation playbooks │ ├── arm/ # Reserved for future ARM templates │ ├── terraform/ # Reserved for future Terraform fixes │ └── cli/ # Azure CLI scripts ├── api/ # Flask REST API │ ├── routes/ │ └── models/ ├── frontend/ # React security dashboard (Vercel) ├── website/ # Project website — docs, blog, rules gallery (Vercel) ├── sentinel/ # Sentinel integration & KQL rules ├── .github/workflows/ # CI checks ├── docs/ # Documentation ├── CONTRIBUTING.md └── README.md ``` ## 快速开始 **后端(Flask API + 扫描器)** ``` # Clone repo git clone https://github.com/openshield-org/openshield.git cd openshield # 安装 Python dependencies pip install -r requirements.txt # 设置你的 Azure credentials export AZURE_SUBSCRIPTION_ID=your-subscription-id export AZURE_CLIENT_ID=your-client-id export AZURE_CLIENT_SECRET=your-client-secret export AZURE_TENANT_ID=your-tenant-id export JWT_SECRET=your-strong-secret # used to protect write endpoints (scan trigger, AI) # 运行扫描 python -c " from scanner.engine import ScanEngine import json, os result = ScanEngine(os.environ['AZURE_SUBSCRIPTION_ID']).run_scan() print(json.dumps(result, indent=2)) " # 启动 API FLASK_APP=api/app.py flask run ``` **前端(React 仪表板)** ``` cd frontend npm install # 本地开发 — 默认指向 http://localhost:5000 npm run dev # 针对 live Render backend 进行开发: VITE_API_URL=https://openshield-api.onrender.com npm run dev ``` 无需 token —— 所有读取端点都是公开的。只有扫描触发器和 AI 端点需要 JWT(仅限 POST 请求)。 ## 路线图 - [x] 项目脚手架搭建 - [x] 核心扫描器引擎(Azure SDK 集成) - [x] 30+ 扫描规则 - [x] Flask API + PostgreSQL schema - [x] 后量子密码学扫描器(AZ-PQC-001 至 AZ-PQC-003) - [x] React 仪表板(已在 Vercel 上线) - [x] CIS Benchmark 合规映射 - [x] SOC 2 合规映射 - [x] Sentinel 告警集成 - [x] 记录真实的漏洞场景 - [x] 合并首个外部贡献者的 PR - [x] Azure CLI 修复手册库 - [x] NIST CSF + ISO 27001 映射 - [x] GitHub Actions CI 流水线 - [x] 包含文档、博客、规则库和演练场的项目网站 - [x] 端到端实时数据对接(所有 API 端点均提供真实数据) - [ ] 多云支持(AWS、GCP) ## 许可证 MIT —— 可免费使用、修改和分发. ## 学习 OpenShield “学习 OpenShield”涵盖以下内容: - Azure CSPM 基础知识 - OpenShield 架构 - 合规映射 - 修复工作流 - 贡献者入门指南 - 文档导航 在线学习门户:https://openshieldlearn.netlify.app/learn/ 完整的文档、安全规则库、博客和交互式演练场可在项目网站上获取: **[openshield-website.vercel.app](https://openshield-website.vercel.app)**
标签:Azure, CSPM, Python, TinkerPop, 无后门, 测试用例, 逆向工具, 配置扫描