cognis-digital/panhound

GitHub: cognis-digital/panhound

在代码、日志和 S3 存储桶中扫描泄漏的银行卡号和 CVV,帮助团队在进入生产环境前拦截持卡人数据泄露。

Stars: 0 | Forks: 0

PANHOUND # PANHOUND ### 在代码、日志、fixtures 和 S3 buckets 进入生产环境之前,扫描其中泄漏的 PAN(通过 Luhn 算法验证的银行卡号)和 CVV。 [![PyPI](https://img.shields.io/pypi/v/cognis-panhound.svg?color=6b46c1)](https://pypi.org/project/cognis-panhound/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/5003f745c5053649.svg)](https://github.com/cognis-digital/panhound/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) *金融科技与支付安全 —— PCI、欺诈、AML 和支付网络。*
``` pip install cognis-panhound panhound scan . # → prioritized findings in seconds ``` ## 使用说明 —— 逐步指南 1. 安装 CLI(Python 3.9+): pip install git+https://github.com/cognis-digital/panhound.git 2. 扫描代码、日志和 fixtures 以查找泄漏的持卡人数据: panhound scan ./src ./logs 3. 获取用于分类处理工具的机器可读输出: panhound scan ./src --format json > pan-findings.json 4. 缩小扫描范围(例如:仅扫描 PAN,抑制噪音)并读取退出码: panhound scan ./logs --no-cvv --quiet; echo "exit=$?" 5. 基于泄漏的持卡人数据对 pipeline 进行拦截: - name: cardholder-data scan run: | pip install git+https://github.com/cognis-digital/panhound.git panhound scan . --format json ## 目录 - [为什么选择 panhound?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献指南](#contributing) ## 为什么选择 panhound? PCI-DSS Req 3 没有好的开源“持卡人数据泄漏”扫描器;Luhn + BIN 范围验证解决了导致密钥扫描器对卡数据产生大量噪音的误报问题。CI 拦截 + MCP 使其成为一行代码的 PR 检查。 `panhound` 具有单一用途、可脚本化且可自托管:将其指向目标,以您的工作流已有的格式(表格 · JSON · SARIF)获取优先级排序的结果,以此拦截 CI,并让 agents 通过 MCP 驱动它。
↑ 回到顶部
## 功能 - ✅ Luhn 验证 - ✅ 检测品牌 - ✅ 遮蔽 PAN - ✅ 扫描文本 - ✅ 扫描路径 - ✅ 扫描多个路径 - ✅ 将发现结果转换为字典 - ✅ 可在 Linux/macOS/Windows · Docker · devcontainer 上运行 - ✅ 提供 Python、JavaScript、Go 和 Rust 的移植版本(`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-panhound panhound --version panhound scan . # scan current project panhound scan . --format json # machine-readable panhound scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ panhound scan . [HIGH ] PAN-001 example finding (./src/app.py) [MEDIUM ] PAN-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[target / manifest] --> P[panhound
checks + rules] P --> OUT[findings (JSON / SARIF)] ```
↑ 回到顶部
## 从任何 AI 技术栈中使用 `panhound` 可与所有流行的 AI 使用方式互操作: - **MCP server** — `panhound mcp`(Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 将 `panhound scan . --format json` 管道传输给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 用一行代码将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI pipeline 提供退出码 + SARIF
↑ 回到顶部
## 对比 | | **Cognis panhound** | gitleaks | |---|:---:|:---:| | 可自托管,无需账户 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生(AI agents) | ✅ | ❌ | | 多语言移植(JS/Go/Rust) | ✅ | ❌ | | 开源许可 | ✅ COCL | 视情况而定 | *本着 **gitleaks / trufflehog** 的精神打造,以 Cognis 的方式重新构建。遗漏了致谢?提交一个 PR。*
↑ 回到顶部
## 集成 无缝接入您的技术栈:用于代码扫描的 **SARIF**,用于一切的 **JSON**,用于 AI agents 的 **MCP server**(`panhound mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。详见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 —— 各种方式,各个平台 ``` pip install "git+https://github.com/cognis-digital/panhound.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/panhound.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/panhound.git" # uv pip install cognis-panhound # PyPI (when published) docker run --rm ghcr.io/cognis-digital/panhound:latest --help # Docker brew install cognis-digital/tap/panhound # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/panhound/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | Cloud | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/panhound` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关的 Cognis 工具 - [`fraudlens`](https://github.com/cognis-digital/fraudlens) — 针对可插拔的欺诈规则和 ML 评分器重放交易流,并从终端输出精确率/召回率和警报数量。 - [`obscan`](https://github.com/cognis-digital/obscan) — 针对 Open Banking / FAPI API 的合规和安全 linter:验证 OAuth 流程、同意 scope 以及 PSD2 endpoints 是否符合规范。 - [`ledgerproof`](https://github.com/cognis-digital/ledgerproof) — 通过检查余额不变性和哈希链式日记账分录来验证复式记账法的完整性和防篡改性。 - [`iso20022`](https://github.com/cognis-digital/iso20022) — 验证、lint 并 diff ISO 20022 / pacs / camt 支付报文,并提供带有 schema 感知错误提示的旧版 MT 到 MX 的转换功能。 - [`tokenvault`](https://github.com/cognis-digital/tokenvault) — 可自托管的 PCI tokenization 微服务和 CLI,将 PAN 替换为保持格式的 token,并证明不会持久化存储原始卡数据。 - [`sanctscan`](https://github.com/cognis-digital/sanctscan) — 利用模糊名称匹配和可解释的命中评分,根据 OFAC/EU/UN 制裁名单筛选交易对手和交易。 **探索全套工具 →** [🗂️ 全部 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+ 工具之一 · 让明天在今天变得更美好
标签:PCI-DSS, Python, StruQ, 可视化界面, 安全合规, 敏感信息扫描, 数据可视化, 无后门, 日志审计, 网络代理, 请求拦截, 逆向工具