Dependency graph support is now available for PHP repositories with Composer dependencies
Dependency graphが、composerを使用しているPHPリポジトリに対応したよ。
設定方法
publicリポジトリ
リポジトリ > Settings > Options > Data services
Dependency graphは標準で有効。
依存パッケージに脆弱性がある時に通知を受け取りたい場合はSecurity alerts
をチェックする。
privateリポジトリ
リポジトリ > Settings > Options > Data services
Dependency graphを利用するには、GitHubがリポジトリを読み取るためにAllow GitHub to perform read-only analysis of this repository
をチェックする必要がある。
その上でDependency graph
と、必要に応じてSecurity alerts
をチェックする。
自動的なセキュリティ修正
※ この機能はベータテスト中です。
セキュリティアラートを受け取った際に、その脆弱性を解消するプルリクエストを自動で作成してくれるらしい。
先述のSecurity alerts
の設定を有効にした上で、
リポジトリ > Security > Off: Automated security fixes > Automated security fixes
をクリックして有効にする。
実践
脆弱性のあるtwig/twig:<2.7
で早速試してみよう!
https://www.cvedetails.com/cve/CVE-2001-1348/
$ composer require "twig/twig:<2.7"
$ git push
音沙汰がない
Receive alerts when a new vulnerability is found in one of your dependencies.
とのことなので、既存の脆弱性は報告してくれないのかもしれない。
追記
しばらくしたら、過去に使った別のsandboxリポジトリのGemfile.lockとpackage-lock.jsonの脆弱性を報告してくれた。
PHPリポジトリに対応したよ
とは一体…。