Dirgha-AI/arniko
GitHub: Dirgha-AI/arniko
面向 AI 时代技术栈的一站式安全扫描编排平台,整合 36 款工具并生成统一报告。
Stars: 0 | Forks: 0
# Arniko
**AI 安全扫描器。汇聚所有工具,生成统一报告。**
[](./LICENSE)
[](./tests)
[](https://dirgha.ai/contribute)
Arniko 是一款专为 AI 时代技术栈打造的安全扫描器。只需运行一条命令,它就会调度 **36 款顶尖工具** —— gitleaks、semgrep、trivy、bandit、checkov、snyk、grype、falco、deepteam、garak、llm-guard、purple llama、rebuff、promptfoo 等 22 款其他工具 —— 全面覆盖 LLM、代码、容器、基础设施和供应链。扫描结果将以统一的标准化数据流返回;Agent 会对其进行分诊、分级并提出修复建议。
一个控制台。一份 SARIF 导出。开源。作为 [Dirgha AI OS](https://github.com/Dirgha-AI/Rama-I-Dirgha-AI-OS) 的一部分。
## 扫描范围
| 领域 | 扫描器 | 检查目标 |
|---|---|---|
| **LLM** | DeepTeam, Garak, Promptfoo, LlmGuard, NeMo Guardrails, Rebuff, Purple Llama, OWASP-LLM-Top-10, indirect-injection, prompt-injection, agentic-security | 越狱、提示注入、数据泄露、PII 泄露、间接提示攻击、工具调用滥用 |
| **代码** | Semgrep, Bandit, CodeQL, Snyk-Code | SAST —— 危险模式、CWE 覆盖范围 |
| **机密信息** | Gitleaks, Trufflehog | 提交至 git 的 API 密钥、token、凭证 |
| **容器** | Trivy, Grype, Falco | 镜像中的 CVE、运行时配置错误 |
| **基础设施** | Checkov | IaC 配置错误 (Terraform, K8s, CloudFormation) |
| **供应链** | OWASP Dependency-Check, Socket, Snyk-OSS, SLSA-provenance, Tool-Attestation, Model-Provenance | 存在漏洞的依赖项、恶意软件包、构建链攻击、SBOM 校验 |
## 安装
```
pnpm install @dirgha/arniko # or: npm install -g @dirgha/arniko
```
需要 Node 20+。外部扫描器 CLI(gitleaks、trivy、semgrep、bandit 等)为**可选项** —— Arniko 会自动检测已安装的工具并跳过
未安装的部分。每个适配器都具有优雅降级机制。
## 快速开始
```
# 启动 API server
arniko start
# 或以编程方式
import { ArnikoOrchestrator } from '@dirgha/arniko';
const orchestrator = new ArnikoOrchestrator({ db: { connectionString: '…' } });
const result = await orchestrator.scan({
targetType: 'repo',
targetId: '/path/to/repo',
tools: ['gitleaks', 'semgrep', 'trivy'],
});
console.log(result.findings);
```
## 架构
```
┌──────────────────────────────────────────────────────────────┐
│ HTTP API (Hono) │
│ /api/scans · /api/dashboard · /api/health · /api/sif │
└───────────────────────────┬──────────────────────────────────┘
│
┌───────────────────────────▼──────────────────────────────────┐
│ ArnikoOrchestrator │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
│ │ queue │→ │ scanners │→ │detectors │→ │ agents │ │
│ │ parallel │ │ 36 tools │ │ ML + rule│ │ triage / fix │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────────┘ │
│ │ │ │ │
│ └───────────▼────────────┘ │
│ findings │
│ │ │
│ ┌────────────────┴──────────────┐ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌────────────┐ │
│ │ postgres │ │ exporters │ │
│ │ (drizzle) │ │ SARIF · │ │
│ │ scans + │ │ JUnit · │ │
│ │ findings + │ │ JSON · │ │
│ │ trends │ │ SIEM │ │
│ └──────────────┘ └────────────┘ │
└──────────────────────────────────────────────────────────────┘
```
## 源码目录
```
src/
├── orchestrator.ts # Scan queue, parallel execution, dedup
├── server.ts # Hono HTTP server
├── cli.ts # CLI entry point
├── index.ts # Public API
│
├── scanners/ # 36 scanner adapters (one file per tool)
│ ├── baseScanner.ts # Abstract base + CLI-detection helper
│ ├── llm/ # LLM-oriented scanners
│ ├── code/ # SAST scanners
│ ├── secrets/ # Secret detection
│ ├── containers/ # Image + runtime
│ ├── infra/ # IaC
│ └── supply-chain/ # SBOM + provenance
│
├── detectors/ # Higher-level heuristics
│ ├── mlDetector.ts # ML model that scores findings
│ ├── riskCalculator.ts # CVSS-aware scoring
│ ├── ruleEngine.ts # Rule DSL for custom detections
│ └── supplyChainGuard.ts
│
├── agents/ # AI-assisted triage
│ ├── fixAgent.ts # Proposes fixes
│ └── triageAgent.ts # Ranks and groups findings
│
├── api/ # HTTP routes
│ ├── routes.ts # /api/scans, /api/findings
│ ├── dashboard.ts # /api/dashboard/*
│ └── dashboard-real.ts # Live metrics
│
├── db/ # Drizzle ORM, Postgres
├── compliance/ # SOC 2, ISO 27001, PCI-DSS mappings
├── dashboard/ # Dashboard data layer
├── exporters/ # SARIF, JUnit, JSON, SIEM formats
├── monitors/ # Real-time scan monitors
├── performance/ # Parallel executor, rate limiting
├── security/ # Arniko's own hardening (auth, CSRF, SAST)
├── middleware/ # Auth, rate-limit, logging
├── ci/ # GitHub Actions + GitLab CI integrations
├── integrations/ # Alerts (email, Slack), SIEM push
├── services/ # LLM scan service, Lightning billing
└── types/ # Shared types
```
**总计:** 72 个 TypeScript 文件,约 18,000 行代码,56 个通过的测试。
## API
### 启动扫描
```
POST /api/scans
Authorization: Bearer
Content-Type: application/json
{
"targetType": "repo",
"targetId": "/path/to/repo",
"tools": ["gitleaks", "semgrep", "trivy"],
"config": { "severity": ["high", "critical"] }
}
```
返回 `{ scanId, status: "queued" }`。扫描异步运行。
### 获取扫描状态
```
GET /api/scans/:id
```
返回扫描状态、发现的问题和各项指标。
### 仪表板
```
GET /api/dashboard/summary # Current counts by severity
GET /api/dashboard/trends # Historical trend data
GET /api/dashboard/top-risks # Highest-scoring open findings
```
### 健康检查
```
GET /api/health
```
返回扫描器可用性、数据库健康状态和队列深度。
## 配置
```
# 必填
DATABASE_URL=postgres://user:pass@host:5432/arniko
# Auth
ARNIKO_API_KEYS=key1,key2,key3 # Comma-separated allowlist
# 可选 integrations
RESEND_API_KEY=… # Email alerts via Resend
GITHUB_TOKEN=… # GitHub Actions integration
# Lightning (实验性 billing)
LND_TLS_CERT=…
LND_MACAROON=…
LND_HOST=…
# Runtime
PORT=3010 # Default 3010
ARNIKO_DEBUG=1 # Verbose logging
ARNIKO_MAX_CONCURRENT_SCANS=4 # Parallel scan cap
```
## 运行扫描器
每个适配器都会自动检测是否安装了相应的外部 CLI:
```
# 预安装你希望 Arniko 使用的 CLI
brew install gitleaks semgrep trivy bandit checkov grype
# 或
apt-get install gitleaks …
# Arniko 会自动识别它们
arniko scan --target /path/to/repo
```
如果未安装某个 CLI,Arniko 将跳过它并记录一条警告日志 —— 不会导致严重错误。
## 开发
```
git clone https://github.com/dirghaai/arniko.git
cd arniko
pnpm install
pnpm typecheck # 0 errors
pnpm test # 56 tests passing
pnpm dev # Server with hot-reload (tsx)
pnpm build # tsc → dist/
```
## 致谢
Arniko 的 LLM 漏洞分类体系和若干攻击原语可追溯至
Confident AI Inc. 的 **DeepTeam**
(Apache-2.0, https://github.com/confident-ai/deepteam)。完整的版权声明
存放于 [`NOTICE`](./NOTICE)。在此感谢 DeepTeam 的维护者们。
## Dirgha OS 的姊妹项目
本仓库是 [Dirgha AI OS](https://github.com/Dirgha-AI/Rama-I-Dirgha-AI-OS) 体系下多款产品之一。每个仓库均可独立运作;将它们组合在一起,便能为开发者构成一个完整的全栈。
| 仓库 | 功能说明 | 许可证 |
|---|---|---|
| [`Rama-I-Dirgha-AI-OS`](https://github.com/Dirgha-AI/Rama-I-Dirgha-AI-OS) | 用于我们自主代理型 AI 操作系统的愿景与路线图。 | Apache-2.0 |
| [`dirgha-code`](https://github.com/Dirgha-AI/dirgha-code) | 用于您终端的 AI 编程代理。您的密钥,您的机器,任意模型。 | FSL-1.1-MIT |
| [`writer-studio`](https://github.com/Dirgha-AI/writer-studio) | 长篇写作工作室 —— 科学、小说、剧本、研究。 | Apache-2.0 |
| [`creator-studio`](https://github.com/Dirgha-AI/creator-studio) | 创作者工作区 —— 用于内容制作、发布、商业化的代理。 | Apache-2.0 |
| [`abundance-protocol`](https://github.com/Dirgha-AI/abundance-protocol) | 去中心化算力与劳动力网络。租用 GPU,运行代理,基于 Bitcoin 结算。 | Apache-2.0 |
欢迎访问我们的总组织 [github.com/Dirgha-AI](https://github.com/Dirgha-AI) 或产品官网 [dirgha.ai](https://dirgha.ai)。
## 许可证
**Apache License 2.0** —— 可免费用于任何用途:个人、商业、研究、托管和再分发。无任何隐藏限制。完整文本详见 [`LICENSE`](./LICENSE)。
**Dirgha LLC 拥有“Dirgha”名称、标志和产品家族的注册商标权**。代码是开源的 —— 但品牌不是。本仓库的 Fork 分支在分发前必须重命名产品并移除 Dirgha 品牌。合理的指示性使用(如“Arniko 的一个 fork”)是允许的。
完整法律文本请参阅 [`LICENSE`](./LICENSE)。相关文档:
- [`SECURITY.md`](./SECURITY.md) —— 漏洞披露策略。
- [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md) —— 贡献者公约 2.1。
- [`SUPPORT.md`](./SUPPORT.md) —— 寻求帮助的渠道。
- [`CONTRIBUTING.md`](./CONTRIBUTING.md) —— 如何提交 PR。
## 链接
| | |
|---|---|
| 网站 | [https://dirgha.ai/arniko](https://dirgha.ai/arniko) |
| 仓库 | [github.com/dirghaai/arniko](https://github.com/dirghaai/arniko) |
| 问题追踪 | [github.com/dirghaai/arniko/issues](https://github.com/dirghaai/arniko/issues) |
| 讨论区 | [github.com/dirghaai/arniko/discussions](https://github.com/dirghaai/arniko/discussions) |
| 安全问题 | `security@dirgha.ai` |
| 企业合作 | `enterprise@dirgha.ai` |
| 媒体 / 综合 | `hello@dirgha.ai` |
**Arniko** 是 Dirgha OS 的一部分 —— 这是一个由精简的自举团队为开发者交付的开源基础设施。
以尼泊尔的 Arniko 命名 —— 这位 13 世纪的杰出工匠将宝塔建筑带到了西藏和中国。一位跨越时代的扫描者,审视着他人所忽视的细节。
由位于印度的 [Dirgha LLC](https://dirgha.ai) 构建。向全世界开放。
基于 **Apache-2.0** 发布 · 版权所有 © 2026 Dirgha LLC · 所有第三方商标均归其各自所有者所有。
## 🌐 Dirgha 生态系统
**[Dirgha AI OS](https://github.com/Dirgha-AI/Rama-I-Dirgha-AI-OS)** —— 代理型操作系统。*加速丰盛。*
| 仓库 | 功能说明 |
|---|---|
| [Rama-I-Dirgha-AI-OS](https://github.com/Dirgha-AI/Rama-I-Dirgha-AI-OS) | 用于我们自主代理型 AI 操作系统的愿景与路线图 |
| [dirgha-code](https://github.com/Dirgha-AI/dirgha-code) | 用于您终端的 AI 编程代理 |
| [writer-studio](https://github.com/Dirgha-AI/writer-studio) | 长篇写作工作室 —— 科学、小说、剧本、研究 |
| [creator-studio](https://github.com/Dirgha-AI/creator-studio) | 创作者工作区 —— 用于内容制作、发布、商业化的代理 |
| [abundance-protocol](https://github.com/Dirgha-AI/abundance-protocol) | 去中心化算力与劳动力网络 |
| [arniko](https://github.com/Dirgha-AI/arniko) | AI 安全扫描器 —— 汇聚所有工具,生成统一报告 |
| [.github](https://github.com/Dirgha-AI/.github) | 组织资料与社区配置 |
- **在线平台:** [dirgha.ai](https://dirgha.ai) —— 聊天、IDE、写作、研究、文库、市场、创作者、教育、制造业
- **组织:** [github.com/Dirgha-AI](https://github.com/Dirgha-AI)
- **合作洽谈:** [partner@dirgha.ai](mailto:partner@dirgha.ai)
*Dirgha —— 加速丰盛。在印度构建,为全世界服务。*
标签:Agent, AI安全, AI扫描器, Chat Copilot, CICD安全, DAST, DevSecOps, DNS 反向解析, DNS 解析, FTP漏洞扫描, GNU通用公共许可证, MITM代理, Node.js, pnpm, SARIF, SAST, SBOM, StruQ, Web截图, Web报告查看器, 上游代理, 大模型安全, 子域名变形, 安全扫描, 安全编排, 容器安全, 恶意软件分析, 提示词注入检测, 文档安全, 时序注入, 测试用例, 盲注攻击, 硬件无关, 自动化攻击, 软件供应链安全, 远程方法调用