cognis-digital/sanctscan

GitHub: cognis-digital/sanctscan

一款可自托管的制裁名单筛查 CLI 工具,通过模糊名称匹配和可解释评分帮助企业对照 OFAC/EU/UN 制裁名单完成交易对手和交易的 AML 合规筛查。

Stars: 0 | Forks: 0

SANCTSCAN # SANCTSCAN ### 通过模糊名称匹配和可解释的命中评分,对照 OFAC/EU/UN 制裁名单筛查交易对手和交易。 [![PyPI](https://img.shields.io/pypi/v/cognis-sanctscan.svg?color=6b46c1)](https://pypi.org/project/cognis-sanctscan/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/c630c994fe060218.svg)](https://github.com/cognis-digital/sanctscan/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-sanctscan sanctscan scan . # → prioritized findings in seconds ``` ## 目录 - [为什么使用 sanctscan?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献指南](#contributing) ## 用法 — 分步指南 `sanctscan` 通过可解释的模糊匹配,对照 OFAC/EU/UN 风格的观察名单(CSV 或 JSON)筛查名称。当任何名称被标记为达到或超过阈值时,将以非零状态退出 —— 因此它可以作为 pipeline 的门控。 1. **安装** pip install sanctscan 2. **筛查单个名称**,对照观察名单: sanctscan screen --watchlist watchlist.csv --name "Vladmir Putin" 3. **从 CSV 筛查一列名称**(自动检测名称列,或设置 `--column`): sanctscan screen -w watchlist.csv --input customers.csv --column full_name 4. **读取 JSON 输出**并调整匹配 `--threshold`(0–1,默认 0.80): sanctscan screen -w watchlist.csv -i customers.csv --format json --threshold 0.85 \ | jq '.flagged' 5. **在 CI / 批处理中使用** — 被标记的退出代码将作为运行门控: sanctscan screen -w wl.csv -n "Some Name" || echo "FLAGGED" ## 为什么使用 sanctscan? AML 名称筛查被 $$ 供应商主导;一个能够拉取实时 OFAC SDN 数据、提供确定性且可审计的匹配分数并处理音译的 CLI 是非常值得 fork 的。 `sanctscan` 是单一用途、可脚本化且可自托管的:将其指向目标,以您的工作流已有的格式(表格 · JSON · SARIF)获取优先级排序的结果,将其作为 CI 的门控,并让代理通过 MCP 驱动它。
↑ 返回顶部
## 功能 - ✅ 名称标准化 (Normalize Name) - ✅ 分词 (Tokenize) - ✅ 名称相似度 (Name Similarity) - ✅ 加载观察名单 (Load Watchlist) - ✅ 筛查名称 (Screen Name) - ✅ 筛查记录 (Screen Records) - ✅ 运行于 Linux/macOS/Windows · Docker · devcontainer - ✅ 支持 Python, JavaScript, Go 和 Rust 移植版本 (`ports/`)
↑ 返回顶部
## 快速开始 ``` pip install cognis-sanctscan sanctscan --version sanctscan scan . # scan current project sanctscan scan . --format json # machine-readable sanctscan scan . --fail-on high # CI gate (non-zero exit) ```
↑ 返回顶部
## 示例 ``` $ sanctscan scan . [HIGH ] SAN-001 example finding (./src/app.py) [MEDIUM ] SAN-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 返回顶部
## 架构 ``` flowchart LR IN[target / manifest] --> P[sanctscan
checks + rules] P --> OUT[findings (JSON / SARIF)] ```
↑ 返回顶部
## 从任何 AI 技术栈中使用 `sanctscan` 与所有主流的 AI 使用方式实现了互操作: - **MCP server** — `sanctscan mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **OpenAI 兼容 / JSON** — 通过管道将 `sanctscan scan . --format json` 传给任何代理或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码将 CLI/JSON 封装为工具 - **CI / 脚本** — 退出代码 + SARIF 用于非 AI pipeline
↑ 返回顶部
## 对比 | | **Cognis sanctscan** | OpenSanctions | |---|:---:|:---:| | 可自托管,无需账号 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生 (AI 代理) | ✅ | ❌ | | 多语言移植 (JS/Go/Rust) | ✅ | ❌ | | 开源许可 | ✅ COCL | 视情况而定 | *秉承 **OpenSanctions / yenta** 的精神,以 Cognis 的方式重新构建。遗漏了致谢?欢迎提交 PR。*
↑ 返回顶部
## 集成 融入您的技术栈:用于代码扫描的 **SARIF**,用于任何场景的 **JSON**,用于 AI 代理的 **MCP server** (`sanctscan mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。详见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 返回顶部
## 安装 — 覆盖所有方式与平台 ``` pip install "git+https://github.com/cognis-digital/sanctscan.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/sanctscan.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/sanctscan.git" # uv pip install cognis-sanctscan # PyPI (when published) docker run --rm ghcr.io/cognis-digital/sanctscan:latest --help # Docker brew install cognis-digital/tap/sanctscan # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/sanctscan/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/sanctscan` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 返回顶部
## 相关的 Cognis 工具 - [`panhound`](https://github.com/cognis-digital/panhound) — 在代码、日志、测试数据和 S3 存储桶进入生产环境之前,扫描其中泄露的 PAN(通过 Luhn 算法验证的卡号)和 CVV。 - [`fraudlens`](https://github.com/cognis-digital/fraudlens) — 针对可插拔的欺诈规则和 ML 评分器重放交易流,并从终端输出精确率/召回率和警报数量。 - [`obscan`](https://github.com/cognis-digital/obscan) — 针对 Open Banking / FAPI API 的一致性和安全 Linter:验证 OAuth 流程、同意范围以及 PSD2 endpoint 是否符合规范。 - [`ledgerproof`](https://github.com/cognis-digital/ledgerproof) — 通过检查余额不变量和哈希链式日记账分录,验证复式记账账本的完整性和防篡改性。 - [`iso20022`](https://github.com/cognis-digital/iso20022) — 验证、Lint 和比对 ISO 20022 / pacs / camt 支付消息,并通过具备 schema 感知的错误提示,将旧版 MT 转换为 MX。 - [`tokenvault`](https://github.com/cognis-digital/tokenvault) — 可自托管的 PCI tokenization 微服务和 CLI,用保留格式的 token 替换 PAN,并证明不存在持久化的原始卡数据。 **探索整个套件 →** [🗂️ 所有 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 · 包含 170+ 件工具的 Cognis Neural Suite 之一 · 让明天在今天更美好
标签:Python, 制裁名单筛查, 反洗钱, 可视化界面, 合规科技, 数据可视化, 无后门, 日志审计, 模糊匹配, 请求拦截, 逆向工具, 金融科技