cognis-digital/piiscan

GitHub: cognis-digital/piiscan

PIISCAN 是一款面向数据仓库和数据湖的 PII 扫描工具,帮助团队在数据流水线中自动发现和管理个人身份信息。

Stars: 0 | Forks: 0

PIISCAN # PIISCAN ### 跨仓库和数据湖的 PII 发现(数据侧扫描器) [![PyPI](https://img.shields.io/pypi/v/cognis-piiscan.svg?color=6b46c1)](https://pypi.org/project/cognis-piiscan/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/29c0fd911c075735.svg)](https://github.com/cognis-digital/piiscan/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) *数据与数据集 —— 零配置的质量、血缘和治理。*
``` pip install cognis-piiscan piiscan scan . # → prioritized findings in seconds ``` ## 使用 —— 分步指南 1. 安装 CLI(Python 3.9+): pip install git+https://github.com/cognis-digital/piiscan.git 2. 扫描 CSV 提取文件(例如仓库导出)中的 PII: piiscan scan customers.csv 3. 调整采样和置信度,并输出 JSON 用于目录编制: piiscan scan customers.csv --sample 5000 --format json > pii.json 4. 在表格视图中隐藏低置信度列: piiscan scan customers.csv --min-confidence 0.7 5. 在流水线中分析导出文件的 PII: - name: pii discovery run: | pip install git+https://github.com/cognis-digital/piiscan.git piiscan scan export.csv --format json ## 目录 - [为什么选择 piiscan?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比分析](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献指南](#contributing) ## 为什么选择 piiscan? 数据治理 `piiscan` 是单一目的、可脚本化且可自托管的:将其指向目标,以您的工作流已有的格式(表格 · JSON · SARIF)获取优先级排序的结果,在 CI 中将其作为门禁,并让 agent 通过 MCP 驱动它。
↑ 回到顶部
## 功能 - ✅ Luhn 验证 - ✅ Ssn 验证 - ✅ Ipv4 验证 - ✅ 分类风险 - ✅ 扫描列 - ✅ 扫描数据集 - ✅ 加载 Csv - ✅ 运行于 Linux/macOS/Windows · Docker · devcontainer - ✅ 支持 Python、JavaScript、Go 和 Rust 移植版 (`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-piiscan piiscan --version piiscan scan . # scan current project piiscan scan . --format json # machine-readable piiscan scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ piiscan scan . [HIGH ] PII-001 example finding (./src/app.py) [MEDIUM ] PII-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[target / manifest] --> P[piiscan
checks + rules] P --> OUT[findings (JSON / SARIF)] ```
↑ 回到顶部
## 从任何 AI 技术栈中使用 `piiscan` 可以与所有流行的 AI 使用方式互操作: - **MCP 服务器** — `piiscan mcp`(Claude Desktop、Cursor、Cognis.Studio、[uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 将 `piiscan scan . --format json` 通过管道传递给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI 流水线提供退出代码 + SARIF
↑ 回到顶部
## 对比分析 | | **Cognis piiscan** | Presidio | |---|:---:|:---:| | 可自托管,无需账户 | ✅ | 视情况而定 | | 单条命令,零配置 | ✅ | ⚠️ | | 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | 原生 MCP(AI agent) | ✅ | ❌ | | 多语言移植(JS/Go/Rust) | ✅ | ❌ | | 开放许可证 | ✅ COCL | 视情况而定 | *本着 **Presidio** 的精神打造,以 Cognis 的方式重新构建。遗漏了致谢?欢迎提交 PR。*
↑ 回到顶部
## 集成 接入您的技术栈:用于代码扫描的 **SARIF**,用于任何场景的 **JSON**,用于 AI agent 的 **MCP 服务器**(`piiscan mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。参见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 —— 全方式,全平台 ``` pip install "git+https://github.com/cognis-digital/piiscan.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/piiscan.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/piiscan.git" # uv pip install cognis-piiscan # PyPI (when published) docker run --rm ghcr.io/cognis-digital/piiscan:latest --help # Docker brew install cognis-digital/tap/piiscan # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/piiscan/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/piiscan` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关 Cognis 工具 - [`duckprobe`](https://github.com/cognis-digital/duckprobe) — 通过 DuckDB 对任何文件或仓库进行零配置的数据质量检查 - [`schemadrift`](https://github.com/cognis-digital/schemadrift) — Schema 变更检测器和数据契约测试 - [`csvlens`](https://github.com/cognis-digital/csvlens) — 用于分析和清理超大 CSV / Parquet 文件的快速 CLI - [`lineagemap`](https://github.com/cognis-digital/lineagemap) — 从 SQL 和 dbt 提取的列级血缘 - [`datasetcard`](https://github.com/cognis-digital/datasetcard) — 自动生成带有 Croissant + 溯源的 Dataset Cards / datasheets - [`seedforge`](https://github.com/cognis-digital/seedforge) — 具有参照完整性的合成测试数据生成器
↑ 回到顶部
## 互操作性 `{}` 与包含 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+ 工具之一 · 让明天在今天更美好
标签:PII扫描, Python, 可视化界面, 敏感数据发现, 数据可视化, 数据合规, 数据治理, 无后门, 日志审计, 请求拦截, 逆向工具