cognis-digital/ossaudit

GitHub: cognis-digital/ossaudit

ossaudit 是一款开源许可证合规审计工具,提供 AGPL 污染检测和 NOTICE 文件生成功能,可无缝集成至 CI/CD 流水线。

Stars: 0 | Forks: 0

OSSAUDIT # OSSAUDIT ### OSS 许可证合规审计工具 — AGPL 污染检测 + NOTICE 生成 [![PyPI](https://img.shields.io/pypi/v/cognis-ossaudit.svg?color=6b46c1)](https://pypi.org/project/cognis-ossaudit/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/375f8dc700080129.svg)](https://github.com/cognis-digital/ossaudit/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) *开发者 / 供应链 — secrets, SBOM, CI/CD 及许可证合规。*
``` pip install cognis-ossaudit ossaudit scan . # → prioritized findings in seconds ``` ## 使用说明 — 分步指南 `ossaudit` 用于审计依赖清单中的许可证策略违规情况,并生成 NOTICE 归属文件。控制台命令:`ossaudit`。 1. 从克隆的仓库中**安装**: pip install -e . 2. 根据分发策略预设**审计清单**(发现违规时退出码为 `2`): ossaudit audit deps.json --policy proprietary 3. 从同一清单**生成 NOTICE** 文件: ossaudit notice deps.json --project "Acme Server" -o NOTICE.txt 4. **查看输出** — `--format json` 可为流水线提供结构化报告: ossaudit --format json audit deps.json | jq '.violations, .passed' 退出码:`0` 通过,`2` 发现策略违规,`1` 错误。 5. **在 CI 中实现自动化** — 遇到 AGPL/copyleft 污染时中断: - run: pip install -e . - run: ossaudit audit deps.json --policy proprietary ## 目录 - [为什么选择 ossaudit?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献指南](#contributing) ## 为什么选择 ossaudit? OSS 许可证合规审计工具 — AGPL 污染检测 + NOTICE 生成 — 无需搭建繁重的基础设施。 `ossaudit` 具有单一用途、可脚本化且支持自托管:将其指向目标,以您的工作流已有的格式(table · JSON · SARIF)获取优先排序的结果,据此拦截 CI 流程,并允许代理通过 MCP 驱动它。
↑ 返回顶部
## 功能 - ✅ 规范化 License Id - ✅ 分类 License - ✅ 判断兼容性 - ✅ 审计 Dependencies - ✅ 加载 Dependencies - ✅ 生成 Notice - ✅ 支持 Linux/macOS/Windows · Docker · devcontainer 运行 - ✅ 提供 Python, JavaScript, Go 和 Rust 移植版本 (`ports/`)
↑ 返回顶部
## 快速开始 ``` pip install cognis-ossaudit ossaudit --version ossaudit scan . # scan current project ossaudit scan . --format json # machine-readable ossaudit scan . --fail-on high # CI gate (non-zero exit) ```
↑ 返回顶部
## 示例 ``` $ ossaudit scan . [HIGH ] OSS-001 example finding (./src/app.py) [MEDIUM ] OSS-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 返回顶部
## 架构 ``` flowchart LR IN[target / manifest] --> P[ossaudit
checks + rules] P --> OUT[findings (JSON / SARIF)] ```
↑ 返回顶部
## 从任意 AI 技术栈中使用 `ossaudit` 可与所有主流的 AI 使用方式互操作: - **MCP server** — `ossaudit mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 将 `ossaudit scan . --format json` 通过管道传递给任何代理或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码即可将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI 流水线提供退出码 + SARIF
↑ 返回顶部
## 对比 | | **Cognis ossaudit** | nexB | |---|:---:|:---:| | 可自托管,无需账号 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | 原生 MCP (AI 代理) | ✅ | ❌ | | 多语言移植 (JS/Go/Rust) | ✅ | ❌ | | 开源许可证 | ✅ COCL | 视情况而定 | *秉承 **nexB/scancode-toolkit** 的精神,以 Cognis 的方式进行重构。遗漏了致谢?欢迎提交 PR。*
↑ 返回顶部
## 集成 可无缝接入您的技术栈:用于代码扫描的 **SARIF**,用于一切的 **JSON**,用于 AI 代理的 **MCP server** (`ossaudit mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。详见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 返回顶部
## 安装 — 所有方式,所有平台 ``` pip install "git+https://github.com/cognis-digital/ossaudit.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/ossaudit.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/ossaudit.git" # uv pip install cognis-ossaudit # PyPI (when published) docker run --rm ghcr.io/cognis-digital/ossaudit:latest --help # Docker brew install cognis-digital/tap/ossaudit # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/ossaudit/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/ossaudit` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 返回顶部
## 相关 Cognis 工具 - [`depgraph`](https://github.com/cognis-digital/depgraph) — 依赖风险可视化工具 — Scorecard + OSV + typosquat + 维护者信号 - [`secretsweep`](https://github.com/cognis-digital/secretsweep) — 仓库密钥扫描器 + 跨提供商自动轮换 - [`pipewatch-pro`](https://github.com/cognis-digital/pipewatch-pro) — CI/CD 供应链审计工具 — GH Actions / GitLab CI / OWASP CI/CD Top 10 **探索全套工具 →** [🗂️ 所有 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
标签:LNA, Python, 云安全监控, 可视化界面, 开源合规, 数据可视化, 无后门, 日志审计, 许可证审计, 请求拦截, 逆向工具, 静态分析