4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Githubから届いた脆弱性報告を自動で解消するautomated security updates

Posted at

はじめに

GithubにソースコードをPushしておくと、そのリポジトリに脆弱性のあるパッケージが含まれているとGithubからAlertメールが届きます。
良くないことではありますが、すでに開発していないリポジトリだとコードを探してパッケージをアップデートして・・というのが面倒になることがあります。
その時に、Githubの automated security updates を使って、PR発行までをGithubにやってもらい、Githubの画面でマージするだけで対応することができます。

automated security updatesとは

「自動または手動のプルリクエストを使って、脆弱性のある依存対象を簡単に更新できます。」

ドキュメントはこちらです。
https://help.github.com/ja/github/managing-security-vulnerabilities/configuring-automated-security-updates
https://help.github.com/en/github/managing-security-vulnerabilities/configuring-automated-security-updates

設定方法

  1. 「View security alert」ボタンもしくは「Security」タブをクリックします。
スクリーンショット 2020-03-29 23.31.43.png
  1. 「Automated security updates」をクリックし、チェックを入れます。
スクリーンショット 2020-03-29 23.35.22.png
  1. Dependabotが動き出します。アップデートが可能であれば、PRを発行してきます。それをマージすればOKです。

対応できないものもある

他のパッケージが脆弱性のあるパッケージに依存しているなど、Dependabotが対応できないものもあります。
その場合は手動でアップデートが必要です。

動作確認は自己責任

当然ですが、アップデートに伴う動作確認は行われません。ソースコードを管理しているのであれば、masterブランチが動作することは確認する必要があると思います。
なので結局自分の環境下にリポジトリをcloneする必要がありますが、それでも楽だと思います。

まとめ

一つのサービスに依存しすぎるのも開発者の判断次第ではありますg、GithubがやってくれることはGithubに任せていくスタイルでやっていきたい。

4
2
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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?