LoginSignup
1
1

More than 3 years have passed since last update.

GitHub Dependency graphがPHPに対応した

Last updated at Posted at 2019-09-19

Dependency graph support is now available for PHP repositories with Composer dependencies

Dependency graphが、composerを使用しているPHPリポジトリに対応したよ。

設定方法

publicリポジトリ

リポジトリ > Settings > Options > Data services

範囲を選択_016.png

Dependency graphは標準で有効。
依存パッケージに脆弱性がある時に通知を受け取りたい場合はSecurity alertsをチェックする。

privateリポジトリ

リポジトリ > Settings > Options > Data services

範囲を選択_015.png

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をクリックして有効にする。

範囲を選択_018.png

実践

脆弱性のあるtwig/twig:<2.7で早速試してみよう!
https://www.cvedetails.com/cve/CVE-2001-1348/

$ composer require "twig/twig:<2.7"
$ git push

音沙汰がない:thinking:

Receive alerts when a new vulnerability is found in one of your dependencies.
とのことなので、既存の脆弱性は報告してくれないのかもしれない。

追記

しばらくしたら、過去に使った別のsandboxリポジトリのGemfile.lockとpackage-lock.jsonの脆弱性を報告してくれた。

PHPリポジトリに対応したよ

とは一体…。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1