Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
ツール/GitLabGitLab/centisgood/duo-agentflow-auditor
静的分析脆弱性スキャナーコード分析ウェブセキュリティDevSecOpsシークレット検出サプライチェーンセキュリティ機械学習学習と教育AIセキュリティラボと実践
GitLab
46ヶ月前未レビュー
centisgood/duo-agentflow-auditor

duo-agentflow-auditor

AI Code Security — 4つのエージェントがSASTが見逃すAI生成コードを捉えます。GitLab Duo Agent Platform上に構築。

リポジトリを見る

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

Duo AgentFlow Auditor

AIコードセキュリティ — SASTが見逃す脆弱性をAI生成コードから検出 GitLab Duo Agent プラットフォーム上に構築

License: MIT Platform AI Model Agents Detection Rules Semgrep Rules Tests Flow Schema Green Agent

GitLab AI Hackathon

AI生成コードの40〜62%にセキュリティ脆弱性が含まれています。
従来のSASTはCVEを検出します。私たちはSASTが見逃すもの — プロンプトインジェクション、LLM出力実行、安全でないMLデシリアライゼーションを検出します。

はじめに · アーキテクチャ · 検出ルール · セットアップガイド · 実装


問題点

AIはコード生成を加速させる一方で、新たなセキュリティのボトルネックを生み出します:

課題影響
セキュリティレビューがMRを数時間から数日ブロックするチームメンバー1人あたり週7時間の損失
AIがコンプライアンス管理を困難にするチームの70% がこれを報告
デプロイ後に発見されるコンプライアンス問題組織の76%
従来のSASTツールはAI固有のリスクを見逃すプロンプトインジェクション、LLM出力実行、安全でないMLデシリアライゼーション
AI生成コードの40〜62%に脆弱性がある既存のツールではAI固有の脅威パターンを検出できない

出典: GitLab 2025 Global DevSecOps Report

ソリューション

AgentFlow Auditor — 従来のSASTが見逃すAI生成コードのセキュリティリスクをキャッチする4つのAIエージェント。LLMプロンプトインジェクション、出力実行、安全でないデシリアライゼーション、SQLインジェクション、SSRF、パストラバーサルを含む41の検出ルール。スキャン可能なレポートを投稿し、修正パッチを生成し、リスクの変化を追跡します。1つの@mentionですべてをトリガーします。


アーキテクチャ```

Developer opens MR │ ▼ @duo-agentflow-auditor review this MR │ ▼ ┌───────────────────────────────────────────────────────┐ │ │ │ ┌─────────────┐ ┌──────────────────┐ │ │ │ Scanner │──────▶│ Reporter │ │ │ │ Agent │ │ Agent │ │ │ │ │ │ │ │ │ │ Read diffs │ │ Grade risk │ │ │ │ Match 34 │ │ Risk heatmap │ │ │ │ rules │ │ Post MR comment │ │ │ │ Score risk │ │ Create issue │ │ │ └─────────────┘ └────────┬─────────┘ │ │ │ │ │ ┌───────┴────────┐ │ │ │ SAFE? │ │ │ │ ├─ Yes ──────────────┐ │ │ │ └─ No ───┐ │ │ │ │ └───────────┘ │ │ │ │ │ │ │ │ │ ┌─────────────┐ ┌────────▼───────┘┐ │ │ │ │ Metrics │◀──────│ Fixer │ │ │ │ │ Agent │ │ Agent │ │ │ │ │ │◀──────────────────────────────┘ │ │ │ Baseline │ │ Confidence-scored│ │ │ │ Cross-MR │ │ patches │ │ │ │ Green │ │ Fix branch + MR │ │ │ │ Posture │ │ │ │ │ └─────────────┘ └─────────────────┘ │ │ │ │ GitLab Duo Agent Platform (ambient) │ │ │ │ ┌───────────────────────────────────────────┐ │ │ │ External SAST Agent (CI/CD container) │ │ │ │ bandit + semgrep + custom rules merge │ │ │ └───────────────────────────────────────────┘ │ └───────────────────────────────────────────────────────┘

root@kitploit:~
### エージェント一覧

| エージェント | 役割 | ツール | 主要機能 |
|:------|:-----|:------|:---------------|
| **Scanner** | MRの差分を分析 | 10ツール | 41ルール (26 regex + 15 Semgrep)、AI特有の脅威検出、脆弱性統合 |
| **Reporter** | 監査レポートを投稿 | 7ツール | 10秒でスキャン可能 (グレード + ヒートマップ + トップ5)、脆弱性リンク、DANGER時に自動Issue作成 |
| **Fixer** | コード修正を生成 | 8ツール | 信頼度スコア付きパッチ (HIGH/MEDIUM/LOW)、自動修正MR作成 |
| **Metrics** | リスクベースラインを追跡 | 6ツール | MR横断学習、チームの姿勢、ベースラインのドリフト、エネルギー/カーボン追跡 |
| **SAST Scanner** | 外部SAST | CI/CD | bandit + semgrepを実行し、Pythonスクリプトでカスタムルールと統合 |

---

## 機能

<table>
<tr>
<td width="50%">

### セキュリティスキャン
- **41の検出ルール** — 26 regex + 15 Semgrepカスタムルール
- **8つのリスクカテゴリ** — 破壊的コマンドからプロンプトインジェクションまで
- **AI特有の検出** — LLMプロンプトインジェクション、output-to-exec、安全でないデシリアライゼーション
- **リスクスコアリング** — 発見ごとに0-100 (深刻度 x コンテキスト x カテゴリ)
- **グレードシステム** — SAFE / WARNING / DANGER

</td>
<td width="50%">

### 自動化
- **ワントリガー起動** — `@mention` またはレビュアー割り当て
- **条件付きルーティング** — SAFEスキャンはFixerをスキップし、トークンを節約
- **構造化MRコメント** — リスクテーブル、修正提案、折りたたみ可能な詳細
- **自動修正生成** — 新しいブランチにコードパッチ
- **Issue作成** — DANGERグレード時に自動

</td>
</tr>
<tr>
<td width="50%">

### ベースライン追跡
- **リスクドリフト検出** — 時間経過に伴うスキャンの比較
- **トレンド分析** — 改善 / 悪化 / 安定
- **修正採用率** — 適用された提案の数を追跡
- **履歴ログ** — スキャンごとにJSONL追記

</td>
<td width="50%">

### グリーンメトリクス
- **トークン追跡** — スキャンごとの使用量
- **エネルギー推定** — スキャンごとのkWh
- **カーボンフットプリント** — 実世界の例えと共にkg CO2
- **最適化提案** — スキャンスコープの削減、ベースラインのキャッシュ

</td>
</tr>
</table>

---

## 検出カテゴリ

### Semgrepカスタムルール

6カテゴリにわたる15の本番グレードのSemgrepルール:

| ルール | カテゴリ | 深刻度 | 検出 |
|:-----|:---------|:---------|:----------|
| `llm-prompt-injection` | AIセキュリティ | WARNING | LLM API呼び出しへのユーザー入力の流れ |
| `llm-output-code-exec` | AIセキュリティ | ERROR | LLM出力がexec/evalに渡される |
| `unsafe-deserialization-ml` | AIセキュリティ | WARNING | 信頼できないモデルでのpickle.load、torch.load |
| `sql-injection` | Webセキュリティ | ERROR | 文字列フォーマットされたSQLクエリ (f-string、.format、concat) |
| `path-traversal` | Webセキュリティ | ERROR | ファイルパス操作でのユーザー入力 (../ トラバーサル) |
| `ssrf-request-forgery` | Webセキュリティ | ERROR | HTTPリクエスト内のユーザー制御URL |
| `open-redirect` | Webセキュリティ | WARNING | リダイレクト関数でのユーザー入力 |
| `missing-input-validation` | Webセキュリティ | WARNING | スキーマ検証なしで使用されるリクエストデータ |
| `dangerous-eval-exec` | Python | WARNING | 動的コンテンツを使用したeval/exec |
| `subprocess-shell-true` | Python | WARNING | shell=True を使用したsubprocess |
| `dangerous-os-system` | Python | WARNING | os.system/popen (非推奨) |
| `insecure-random-python` | 暗号 | WARNING | セキュリティトークンにrandomモジュールを使用 |
| `insecure-random-javascript` | 暗号 | WARNING | セキュリティトークンにMath.random()を使用 |
| `hardcoded-credentials` | シークレット | WARNING | ハードコードされたパスワード、APIキー、トークン |
| `insecure-http` | ネットワーク | INFO | HTTP URL (autofixでHTTPSに修正) |

### 正規表現検出カテゴリ

| カテゴリ | 深刻度 | パターン例 |
|:---------|:---------|:-----------------|
| 破壊的コマンド | 🚨 Danger | `rm -rf /`, `mkfs`, `dd to disk` |
| 認証情報の流出 | 🚨 Danger | `curl` posting secrets to external URLs |
| プロンプトインジェクション (深刻) | 🚨 Danger | "前の指示を無視", ロールオーバーライド |
| 難読化された実行 | 🚨 Danger | `base64 -d \| bash`, リモートパイプからシェル |
| シェル実行 | ⚠️ Warning | `shell=True`, `eval()`, `exec()`, `os.system()` |
| ネットワーク呼び出し | ⚠️ Warning | `curl`/`wget`/`fetch` to external URLs |
| 安全でないトランスポート | ⚠️ Warning | `http://` を使用すべき箇所で `https://` |
| ハードコードされた認証情報 | ⚠️ Warning | ソース内のパスワード、APIキー、トークン |

### リスクスコア計算式```
score = severity_weight + category_weight + executable_context + actionable + risk_modifier
      = clamp(0, 100)

severity_weight:    danger=50, warning=25
category_weight:    destructive-command=15, credential-exfil=15, prompt-injection=10, ...
executable_context: +20 if file is .sh/.py/.js/.ts
actionable:         +15 if executable AND not in trusted domain allowlist
risk_modifier:      per-rule adjustment (0-15)

グレード分類

グレード条件アクション
🚨 危険max_risk >= 90 OR high_risk_findings >= 3マージをブロック+Issueを作成
⚠️ 警告max_risk >= 70 OR high_risk_findings >= 1マージ前にレビュー必須
✅ 安全有意なリスクシグナルなし安全にマージ可能

クイックスタート

前提条件

  • Duo Agent Platform が有効な GitLab プロジェクト(GitLab 18.8+)
  • GitLab AI Hackathon グループ へのアクセス(ハッカソン提出用)

1. GitLab にプッシュ```bash

git clone https://gitlab.com/centisgood/duo-agentflow-auditor.git cd duo-agentflow-auditor

root@kitploit:~
> 📖 完全なミラーリングガイド(3つの方法、CI設定、同期戦略): [`docs/GITLAB_MIRROR_GUIDE.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/docs/GITLAB_MIRROR_GUIDE.md)

### 2. エージェントとフローの自動公開

ハッカソングループは、[セキュリティポリシー](https://gitlab.com/gitlab-ai-hackathon/security-policies) を介して[中央CIパイプライン](https://gitlab.com/gitlab-ai-hackathon/ci) を適用しています。GitLabにプッシュすると、`catalog-sync`ジョブが**自動的に**すべての `agents/*.yml` と `flows/*.yml` をAIカタログに公開します。手動設定やGitタグは不要です。

> プロジェクトの `.gitlab-ci.yml` はハッカソンの中央パイプラインによって上書きされます。含まれている `.gitlab-ci.yml` は参照のみを目的としています。

| # | エージェント | カタログファイル | プロンプトドキュメント | ツール |
|---|----------|-------------|-----------------|------|
| 1 | Scanner | [`agents/scanner.yml`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/agents/scanner.yml) | [`agents/scanner.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/agents/scanner.md) | 8ツール |
| 2 | Reporter | [`agents/reporter.yml`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/agents/reporter.yml) | [`agents/reporter.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/agents/reporter.md) | 6ツール |
| 3 | Fixer | [`agents/fixer.yml`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/agents/fixer.yml) | [`agents/fixer.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/agents/fixer.md) | 8ツール |
| 4 | Metrics | [`agents/metrics.yml`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/agents/metrics.yml) | [`agents/metrics.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/agents/metrics.md) | 5ツール |

フロー: [`flows/security-audit.yml`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/flows/security-audit.yml) — Scanner → Reporter → Fixer → Metrics のルーティングによる4エージェントパイプライン。

<details>
<summary>代替方法: GitLab UIによる手動設定</summary>

**エージェント**: Automate → Agents → New agent → `.md` ファイルからシステムプロンプトを貼り付け

**フロー**: Automate → Flows → New flow → [`flows/security-audit.yml`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/flows/security-audit.yml) から定義を貼り付け
</details>

### 3. トリガーの有効化

| トリガー | 方法 |
|---------|------|
| メンション | 任意のMRで `@duo-agentflow-auditor` とコメント |
| レビュアー割り当て | サービスアカウントをMRレビュアーとして割り当て |

### 4. 試してみる```bash
# Create test branch with vulnerable code
git checkout -b test/security-audit
cp examples/vulnerable-mr/* .
git add . && git commit -m "test: add vulnerable code for audit"
git push origin test/security-audit

# Open MR → Comment: @duo-agentflow-auditor please review this MR

詳細な手順書: docs/SETUP_GUIDE.md を参照してください


出力例

MRコメント (DANGERグレード)```markdown

🛡️ AgentFlow Auditor — Security Report

Grade: 🚨 DANGER Recommendation: FAIL — do not merge without fixes

🗺️ Risk Heatmap

RiskFileFindingsMax Score
🟥🟥🟥🟥🟥unsafe_script.py595
🟥🟥🟥🟧⬜risky_config.yaml378
🟧🟧⬜⬜⬜insecure_fetch.js262

Top Findings

🚨 unsafe_script.py:55 — rm -rf (95/100) 🚨 unsafe_script.py:13 — shell=True (88/100) 🚨 unsafe_script.py:27 — eval() (85/100) ⚠️ insecure_fetch.js:41 — HTTP (62/100)

root@kitploit:~
### グリーンメトリクス```markdown
### 🌱 Sustainability Report
| Metric              | Value               |
|---------------------|---------------------|
| Tokens Used         | 12,450              |
| Energy              | 0.0037 kWh          |
| CO₂ Footprint       | 0.0014 kg           |
| Efficiency          | 2.4 findings/1K tok |

💡 LED bulb for 13 seconds  |  🚗 Car driving 5.6 meters

プロジェクト構造```

duo-agentflow-auditor/ │ ├── agents/ │ ├── scanner.yml # Catalog agent — security scanner │ ├── reporter.yml # Catalog agent — report generator │ ├── fixer.yml # Catalog agent — auto-fix patches │ ├── metrics.yml # Catalog agent — green metrics │ ├── scanner.md # Detailed prompt documentation │ ├── reporter.md # Detailed prompt documentation │ ├── fixer.md # Detailed prompt documentation │ └── metrics.md # Detailed prompt documentation │ ├── flows/ │ └── security-audit.yml # Catalog flow — conditional routing pipeline │ ├── scripts/ │ ├── merge_sast_results.py # SAST result merger (bandit + semgrep + custom rules) │ └── demo.sh # E2E demo automation (glab CLI) │ ├── tests/ │ └── test_merge_sast_results.py # 76 pytest tests — scoring, grading, parsing │ ├── .gitlab/ │ └── duo/ │ └── flows/ │ └── sast-scanner.yaml # External SAST agent (CI/CD container) │ ├── rules/ │ ├── danger_rules.json # 11 high-severity detection patterns │ ├── warning_rules.json # 15 medium-severity detection patterns │ └── semgrep/ # 15 Semgrep custom rules │ ├── ai-security/ # LLM prompt injection, output exec, unsafe deser │ ├── web-security/ # SQL injection, path traversal, SSRF, open redirect, input validation │ ├── python-security/ # eval/exec, subprocess, os.system │ ├── crypto/ # Insecure random (Python + JavaScript) │ ├── secrets/ # Hardcoded credentials │ └── network/ # Insecure HTTP (with autofix) │ ├── Dockerfile # Production SAST container (python:3.11-slim) ├── requirements.txt # bandit + semgrep dependencies │ ├── examples/ │ ├── vulnerable-mr/ # Intentionally risky code (demo) │ │ ├── unsafe_script.py # shell=True, eval(), rm -rf, cred leak │ │ ├── risky_config.yaml # Prompt injection, hardcoded secrets │ │ └── insecure_fetch.js # HTTP, exec(), token exposure │ └── safe-mr/ # Secure code for contrast (demo) │ ├── safe_script.py │ ├── safe_config.yaml │ └── safe_script.js # HTTPS, execFile, env vars │ ├── docs/ │ ├── SETUP_GUIDE.md # Step-by-step setup │ ├── EXECUTION_PLAN.md # Implementation plan │ ├── WOW_MOMENTS.md # Visual impact & demo choreography │ ├── DEVPOST_SUBMISSION.md # Devpost submission draft │ └── GITLAB_MIRROR_GUIDE.md # GitHub → GitLab mirroring │ ├── .gitlab-ci.yml # CI — catalog-sync + validation ├── AGENTS.md # Project-level agent customization ├── IMPLEMENTATION.md # Architecture & design document ├── CONTRIBUTING.md # Contribution guidelines ├── LICENSE # MIT License └── README.md # This file

root@kitploit:~
---

## Technology

| コンポーネント | 技術 |
|:----------|:-----------|
| **Platform** | GitLab Duo Agent プラットフォーム (GitLab 18.8 で GA) |
| **AI Model** | Anthropic Claude Sonnet |
| **Flow Schema** | Flow Registry v1 (`ambient` 環境) |
| **Triggers** | Mention, Assign, Assign Reviewer |
| **Agent Tools** | 30以上の GitLab 組み込みツール (脆弱性リンクを含む) を4つのエージェントで |
| **Detection** | 41 ルール: 26 の正規表現 + 15 の Semgrep (AI セキュリティ、ウェブセキュリティ、暗号、シークレット、ネットワーク) |
| **External SAST** | Docker化された bandit + semgrep パイプラインと結果マージャー |
| **Testing** | スコアリング、グレーディング、パースをカバーする 76 の pytest テスト |
| **Output** | Markdown MR コメント、GitLab Issue、Fix MR |

---

## Documentation

| ドキュメント | 説明 |
|:---------|:-----------|
| [`IMPLEMENTATION.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/IMPLEMENTATION.md) | アーキテクチャ、スコアリング式、デモスクリプト、審査基準の調整 |
| [`docs/SETUP_GUIDE.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/docs/SETUP_GUIDE.md) | トラブルシューティングを含む7ステップのウォークスルー |
| [`docs/EXECUTION_PLAN.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/docs/EXECUTION_PLAN.md) | 約35の詳細タスクを含む6フェーズ計画 |
| [`docs/WOW_MOMENTS.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/docs/WOW_MOMENTS.md) | ビジュアルインパクトデザインとデモ振り付け |
| [`docs/DEVPOST_SUBMISSION.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/docs/DEVPOST_SUBMISSION.md) | コピーペースト用の提出フォームテキスト |
| [`AGENTS.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/AGENTS.md) | プロジェクトレベルのスキャンカスタマイズ |
| [`docs/GITLAB_MIRROR_GUIDE.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/docs/GITLAB_MIRROR_GUIDE.md) | GitHub → GitLab ミラーリング (3つの方法) |
| [`CONTRIBUTING.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/CONTRIBUTING.md) | コントリビューション方法 |

---

## Testing```bash
# Run the full test suite (76 tests)
python -m pytest tests/ -v

# Run with coverage
python -m pytest tests/ --cov=scripts --cov-report=term-missing

テストでカバーされる内容: JSON loading、rule parsing、severity/category normalization、risk scoring formula、grade classification、bandit/semgrep output parsing、finding deduplication、およびCLI entry point。


デモ```bash

Run the E2E demo (requires glab CLI + GitLab remote)

scripts/demo.sh

Use a custom remote name

scripts/demo.sh --gitlab-remote origin

Clean up demo branches and MRs

scripts/demo.sh --cleanup

root@kitploit:~
デモスクリプトは、脆弱なコードを含むテストMRを作成し、`@mention`を介してオーディターをトリガーし、結果をポーリングします。

---

## コントリビューション

ガイドラインについては[`CONTRIBUTING.md`](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/CONTRIBUTING.md)を参照してください。

**クイックサマリー:**
1. リポジトリをフォークする
2. フィーチャーブランチを作成する (`git checkout -b feature/amazing`)
3. 変更をコミットする (`git commit -m 'feat: add amazing feature'`)
4. ブランチにプッシュする (`git push origin feature/amazing`)
5. マージリクエストを開く

---

## AIのパラドックス — なぜこれが重要なのか

<div align="center">

| AgentFlow Auditorなし | AgentFlow Auditorあり |
|:--------------------------|:----------------------|
| レビューに2日以上待つ | **45秒**で完全監査 |
| SASTはAI固有のリスクを見逃す | **41ルール**(AI固有3 + Webセキュリティ脅威7を含む) |
| 修正提案なし | **信頼度スコア付きパッチ**(HIGH/MED/LOW) |
| SAFEスキャンが修正トークンを無駄にする | **条件付きルーティング**で修正器をスキップ |
| 経時的な追跡なし | **MR間学習** + チームの姿勢 |
| エネルギー意識なし | **グリーンメトリクス**(スキャンごと) |

</div>

---

## ライセンス

このプロジェクトは[MITライセンス](https://gitlab.com/centisgood/duo-agentflow-auditor/-/blob/main/LICENSE)の下でライセンスされています。

---

<div align="center">

**一つのトリガー。四つのエージェント。ゼロのAIブラインドスポット。**

[GitLab Duo Agent Platform](https://docs.gitlab.com/user/duo_agent_platform/)と[Anthropic Claude](https://www.anthropic.com/)で構築

</div>
ツールをダウンロード