cognis-digital/graphqlmap

GitHub: cognis-digital/graphqlmap

一款用于分析 GraphQL introspection 数据、自动发现危险字段、深度风险和授权漏洞的轻量级安全审计工具。

Stars: 0 | Forks: 0

GRAPHQLMAP # GRAPHQLMAP ### 分析 GraphQL introspection 中的危险字段、深度和 authz 漏洞 [![PyPI](https://img.shields.io/pypi/v/cognis-graphqlmap.svg?color=6b46c1)](https://pypi.org/project/cognis-graphqlmap/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/38674060e0082202.svg)](https://github.com/cognis-digital/graphqlmap/actions) [![License: COCL 1.0](https://img.shields.io/badge/License-COCL%201.0-2b6cb0.svg)](LICENSE) [![Suite](https://img.shields.io/badge/Cognis-Neural%20Suite-6b46c1.svg)](https://github.com/cognis-digital) *Cognis Neural Suite 的一部分。*
``` pip install cognis-graphqlmap graphqlmap scan . # → prioritized findings in seconds ``` ## 使用说明 — 分步指南 1. 安装 (Python 3.9+): pip install graphqlmap 2. 将目标 introspection 的结果(即 `__schema` 查询响应)捕获并保存到 JSON 文件中,然后分析其攻击面: graphqlmap analyze introspection.json 3. 调整深度阈值和严重级别门控,或生成独立的 HTML 报告: graphqlmap analyze introspection.json --depth-threshold 8 --fail-on MEDIUM graphqlmap analyze introspection.json --format html -o report.html 4. 查看输出:表格列出了每项发现(严重程度、id、标题、 位置、修复建议)。对于工具集成,请使用 `--format json` 并解析 `findings[]` 和 `severity_counts`。当发现的问题达到或超过 `--fail-on` 指定的级别时,进程将以非零状态码退出。 5. 基于 schema 对 CI 任务设置门控(遇到 MEDIUM+ 级别即失败): graphqlmap analyze introspection.json --format json --fail-on MEDIUM > gql.json ## 目录 - [为什么选择 graphqlmap?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI stack](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献指南](#contributing) ## 为什么选择 graphqlmap? 分析 GraphQL introspection 中的危险字段、深度和 authz 漏洞 —— 无需搭建繁重的基础设施。 `graphqlmap` 是单一用途、可脚本化且可自托管的:将其指向目标,即可通过您工作流中已有的格式(表格 · JSON · SARIF)获取按优先级排序的结果,基于它对 CI 进行门控,并让 agent 通过 MCP 驱动它。
↑ 回到顶部
## 功能 - ✅ 加载 Introspection - ✅ 分析 Introspection - ✅ 可在 Linux/macOS/Windows · Docker · devcontainer 上运行 - ✅ 提供 Python, JavaScript, Go 和 Rust 版本移植 (`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-graphqlmap graphqlmap --version graphqlmap scan . # scan current project graphqlmap scan . --format json # machine-readable graphqlmap scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ graphqlmap scan . [HIGH ] GRA-001 example finding (./src/app.py) [MEDIUM ] GRA-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[input] --> P[graphqlmap
analyze + score] P --> OUT[report] ```
↑ 回到顶部
## 从任何 AI stack 中使用 `graphqlmap` 可与所有主流的 AI 使用方式互操作: - **MCP 服务器** — `graphqlmap mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 将 `graphqlmap scan . --format json` 通过管道传递给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码即可将 CLI/JSON 封装为工具 - **CI / 脚本** — 提供退出代码 + SARIF 用于非 AI pipeline
↑ 回到顶部
## 对比 | | **Cognis graphqlmap** | 典型工具 | |---|:---:|:---:| | 可自托管,无需账号 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 为 CI 提供 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生支持 (AI agent) | ✅ | ❌ | | 多语言移植 (JS/Go/Rust) | ✅ | ❌ | | 开放许可协议 | ✅ COCL | 视情况而定 |
↑ 回到顶部
## 集成 可无缝接入您的技术栈:代码扫描使用 **SARIF**,任何场景使用 **JSON**,AI agent 使用 **MCP 服务器** (`graphqlmap mcp`),并包含用于 SIEM/Slack/Jira 的 webhook 转发器。详见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 — 各种方式,所有平台 ``` pip install "git+https://github.com/cognis-digital/graphqlmap.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/graphqlmap.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/graphqlmap.git" # uv pip install cognis-graphqlmap # PyPI (when published) docker run --rm ghcr.io/cognis-digital/graphqlmap:latest --help # Docker brew install cognis-digital/tap/graphqlmap # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/graphqlmap/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | 云平台 | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/graphqlmap` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关 Cognis 工具 **探索整个套件 →** [🗂️ 全部 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram)
↑ 回到顶部
## 互操作性 `{}` 可与包含 300+ 工具的 Cognis 套件组合使用 —— 统一的 JSON 输入/输出和共享的 兼容 OpenAI 的 `/v1` 骨干网络。有关套件图谱、组合模式和参考技术栈,请参阅 **[INTEROP.md](INTEROP.md)**。 ## 许可协议 在 **Cognis Open Collaboration License (COCL) v1.0** 下提供源代码 —— 个人、内部评估、研究和教育用途免费;**商业 / 生产环境使用需要获得许可** (licensing@cognis.digital)。请参阅 [LICENSE](LICENSE)。
Cognis Digital · Cognis Neural Suite 中 170+ 工具之一 · 让明天在今天更美好
标签:CISA项目, GraphQL, 云安全监控, 可视化界面, 开源框架, 持续集成, 授权审计, 数据可视化, 日志审计, 请求拦截, 逆向工具, 静态分析