cognis-digital/certpatrol

GitHub: cognis-digital/certpatrol

基于证书透明度日志监控 TLS 证书生命周期并检测可疑签发的自托管命令行工具。

Stars: 0 | Forks: 0

CERTPATROL # CERTPATROL ### 通过证书透明度监控 TLS 证书生命周期及恶意签发 [![PyPI](https://img.shields.io/pypi/v/cognis-certpatrol.svg?color=6b46c1)](https://pypi.org/project/cognis-certpatrol/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/2679991966082118.svg)](https://github.com/cognis-digital/certpatrol/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) *网络 / 基础设施 — DNS、TLS 和出口暴露面。*
``` pip install cognis-certpatrol certpatrol scan . # → prioritized findings in seconds ``` ## 使用说明 — 逐步指南 `certpatrol` 通过将证书透明度导出数据与监控名单进行比对,来监控 TLS 证书生命周期和恶意签发。 1. **安装**: pip install -e . 2. **运行监控**,针对 CT 导出文件(JSON / NDJSON)和监控名单文件: certpatrol watch --certs ct-monitor.ndjson --watchlist watchlist.json 3. **读取输出**为 JSON 格式以用于告警: certpatrol watch --certs ct-monitor.ndjson --watchlist watchlist.json --format json 4. **使用退出码** — 当发现违反监控名单的情况(例如恶意签发)时,命令将返回非零值。 5. **在 cron/CI 中自动化运行**: certpatrol watch --certs ct-monitor.ndjson --watchlist watchlist.json --format json > findings.json ## 目录 - [为什么选择 certpatrol?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献指南](#contributing) ## 为什么选择 certpatrol? 通过证书透明度监控 TLS 证书生命周期及恶意签发 — 无需搭建繁重的基础设施。 `certpatrol` 具备单一目的、可脚本化且支持自托管:将其指向目标,以您的工作流已使用的格式(表格 · JSON · SARIF)获取优先级排序的结果,并以此为 CI 把关,同时允许 agent 通过 MCP 驱动它。
↑ 回到顶部
## 功能 - ✅ 剩余天数 - ✅ 名称覆盖 - ✅ 解析证书 - ✅ 加载监控名单 - ✅ 分析 - ✅ 可在 Linux/macOS/Windows · Docker · devcontainer 上运行 - ✅ 提供 Python、JavaScript、Go 和 Rust 移植版本 (`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-certpatrol certpatrol --version certpatrol scan . # scan current project certpatrol scan . --format json # machine-readable certpatrol scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ certpatrol scan . [HIGH ] CER-001 example finding (./src/app.py) [MEDIUM ] CER-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[target / export] --> P[certpatrol
collect + correlate] P --> OUT[ranked findings] ```
↑ 回到顶部
## 从任何 AI 技术栈中使用 `certpatrol` 与所有流行的 AI 使用方式兼容: - **MCP server** — `certpatrol mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 将 `certpatrol scan . --format json` 通过管道传递给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 用一行代码将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI 流水线提供退出码 + SARIF
↑ 回到顶部
## 对比 | | **Cognis certpatrol** | sslmate | |---|:---:|:---:| | 可自托管,无需账号 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生(AI agent) | ✅ | ❌ | | 多语言移植(JS/Go/Rust) | ✅ | ❌ | | 开源许可证 | ✅ COCL | 视情况而定 | *秉承 **sslmate/certspotter** 的精神,以 Cognis 的方式重新构建。遗漏了致谢?欢迎提交 PR。*
↑ 回到顶部
## 集成 可接入您的技术栈:用于代码扫描的 **SARIF**,适用于任何场景的 **JSON**,面向 AI agent 的 **MCP server**(`certpatrol mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。请参阅 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 — 各种方式,所有平台 ``` pip install "git+https://github.com/cognis-digital/certpatrol.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/certpatrol.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/certpatrol.git" # uv pip install cognis-certpatrol # PyPI (when published) docker run --rm ghcr.io/cognis-digital/certpatrol:latest --help # Docker brew install cognis-digital/tap/certpatrol # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/certpatrol/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/certpatrol` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关 Cognis 工具 - [`dnsaudit`](https://github.com/cognis-digital/dnsaudit) — DNS 态势及配置错误扫描器 — SPF/DKIM/DMARC/DNSSEC/CAA - [`egresswatch`](https://github.com/cognis-digital/egresswatch) — 服务器端出站连接审计器 — eBPF/Falco 封装器 **探索套件 →** [🗂️ 全部 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+ 工具之一 · Making Tomorrow Better Today
标签:IP 地址批量处理, Python, StruQ, TLS证书, 可视化界面, 威胁情报, 开发者工具, 数据可视化, 无后门, 日志审计, 网络安全, 证书透明度, 请求拦截, 逆向工具, 配置审计, 隐私保护