◀ 用語一覧
NO.19.7

Dependabot

更新: 2026.10.26

一言で

Dependabot は、リポジトリの依存関係を監視する GitHub 公式 bot。

脆弱性が見つかれば アラート を出し、可能なら 修正 PR を自動作成。古くなった依存も定期的に新バージョンへ更新してくれる。

Alerts と Updates の違い

Dependabot は 3 つの機能 に分かれている。よく混同されるが、役割が異なる。

機能何をする?トリガー出力
🚨 Security alerts既存依存の脆弱性を通知(opt-in で npm の malware alerts ↗ も含む)GitHub Advisory Database に新規 CVE が登録された時Security タブ + メール
🔧 Security updates脆弱性を直す PR を自動作成アラート発生時(自動的に)PR(脆弱性 → 修正版に上げる)
⏰ Version updates脆弱性に関係なく新バージョンへ追従する PR設定ファイルのスケジュール(daily / weekly)PR(古い → 最新)

🔑 Alerts = 検知だけ、Updates = 修正 PR まで作る。Security updates は Alerts に乗っかって動く(Alerts 無しでは動かない)。

Dependency graph の役割

Dependabot のすべての判断は Dependency graph が出発点。

  • 🗂️ マニフェストとロックファイルを解析 — package-lock.json、requirements.txt、go.mod、pom.xml、Gemfile.lock など各エコシステムの依存定義を読む
  • 🔄 直接 + 推移的依存 の両方を解決 — lodash を直接入れていなくても、依存先が引っ張っていれば追跡対象
  • 📚 GitHub Advisory Database と照合 — 検出された依存と公開済み CVE を突き合わせて脆弱性を判定
  • 🛂 対応エコシステム — npm, pip, Maven, NuGet, Composer, Bundler, Go modules, Cargo, Gradle, Hex, Pub, Docker, GitHub Actions ほか

🌍 Advisory Database は GitHub・コミュニティ・MITRE の CVE フィードから集約された脆弱性データベース。

始め方(最短ルート)

Step 1 — Security alerts / updates を ON

Repo → Settings → Code security
  ✅ Dependency graph
  ✅ Dependabot alerts
  ✅ Dependabot security updates

3 つチェックを入れるだけ。設定ファイル不要 で動き出す。

Step 2 — Version updates を使うなら .github/dependabot.yml を追加

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "monthly"
  • 📦 package-ecosystem でエコシステム指定
  • 📅 interval: daily / weekly / monthly
  • 🏷️ groups でまとめて 1 つの PR にしたり、ignore で特定パッケージを除外可

Step 3 — Org / Enterprise で一括 ON にしたい場合

Org → Settings → Code security から default settings で全リポジトリに適用できる。

補完機能: Dependency Review 📖 Docs

Dependency Review は Dependabot の PR タイム版。脆弱な依存や違反ライセンスをマージ前に止めるゲートで、default branch だけでなく任意の base branch で動く。

Dependency ReviewDependabot alerts
タイミングPR ごと(任意の branch)常時(新しい CVE 発生時)
マージを止める?✅ Yes(required check 化すれば)❌ 通知のみ
ライセンスチェック✅ allow / deny list❌ 非対応
  • 🚨 脆弱なパッケージ が PR で追加 / 更新された時 — fail-on-severity で閾値設定
  • 📜 ライセンス遵守 — allow / deny list(例: proprietary repo で GPL-3.0 を拒否)
  • 📦 依存差分 — lockfile から解決した推移的依存も含めて全部

actions/dependency-review-action を入れて required status check にすればゲート化完了。Org owner は repository ruleset で組織横断に強制可。

⚠️ PR タイムのゲートであり常時監視ではない。マージ後に公開された CVE を拾うのは Dependabot alerts の役目 — 必ず両方を併用 する。

Open source license compliance 📖 Docs

2026-10-16 に GA。 Dependabot の補完機能として、脆弱性だけでなく依存関係のライセンスをマージ前に統制する。

ポリシーの一元管理Action との違い

Dependency Review Action はライセンスの allow / deny list で制御する。License compliance は Enterprise 共通ポリシーをブランチルールセットで適用する。

利用条件Enterprise + Code Security

Public repo も含め Enterprise Cloud + Code Security が必要。データ所在地にも対応。一方、Dependency Review Action は Public repo なら無料で、Private repo は Code Security が必要。

段階的な適用Evaluate / Active

Active は非準拠の PR をブロック。Evaluate は指摘のみで直接ブロックしない。ただし、会話の解決を必須にするブランチ保護があると、指摘がマージを妨げる場合がある。

違反の解消例外の承認

依存関係の削除 / 置き換え、ポリシーの変更、または Enterprise Open-Source License Manager が承認した例外で対応する。

対象:PR で追加 / 変更された依存関係。検出済みの推移的依存も含む。コピーされたコードやバイナリのスキャナーではない。

AI triage: alert を agent に渡す

各 Dependabot alert に 「Assign to agent」 ボタンがあり、Copilot / Claude / Codex に渡すと、agent が advisory とリポジトリを読んで alert ごとに on-demand で triage と修正 を行う。

  • 🔍 agent が typically やること — reachability チェック(「脆弱関数が実際に自分のコードパスから呼ばれているか?」)、自分のコンテキストでの exploitability 判定、そして breaking change / downgrade / refactor まで含む draft 修正 PR の作成
  • 🏁 同じ alert に 複数 agent を競わせて PR を比較できる
  • 🧹 Auto-triage rules — 別軸として、severity / ecosystem / dependency scope(runtime か dev か) で低リスク alert を自動 dismiss / snooze。agent が見る alert を本物だけに絞れる
  • 👀 agent の修正は first-pass として扱う。マージ前の人間レビュー + テストは依然として必須

🎯 Alert → Assign to agent → reachability + fix → draft PR → 人間レビュー → merge。ボトルネックは「パッチ合成」から「承認」へ移る。

💰 Public repo は無料。Private repo は GitHub Code Security(旧 Advanced Security バンドル)が必要。

利用条件と料金 📖 Docs

Dependabot 本体は 全プラン無料。有料は Code Security の premium 機能のみ。

機能Public repoPrivate repo(個人 / Free)Private repo(Team / Enterprise)
Dependency graph✅ 既定 ON✅ 無料(opt-in)✅ 無料
Dependabot alerts(malware 含む)✅ 無料✅ 無料✅ 無料
Dependabot security updates✅ 無料✅ 無料✅ 無料
Dependabot version updates✅ 無料✅ 無料✅ 無料
Custom auto-triage rules✅ 無料❌💰 Code Security

Enterprise の License compliance は無料の Dependabot とは別。Public repo も含め、Enterprise Cloud + Code Security が必要。

⚙️ standard / self-hosted runner なら Actions 分数を消費しない。課金は larger runner のみ。
🤖 Assign to agent は Code Security + coding agent 付き Copilot プラン が必要。

スライド Eng