2
0

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 3 years have passed since last update.

GitHubでセキュリティの脆弱性を自動で修正する

Posted at

はじめに

ある日、GitHubからYour repository has dependencies with security vulnerabilitiesとメールが来て、確認するとこのような警告がされていました。

image.png

脆弱性があるとのことでSee security alertsを押すと、詳細な内容を確認できました。

image.png

原因

原因は利用していたライブラリSystem.Text.Encodings.Webのバージョン5.0.0に脆弱性があるとのことで最新版にバージョンアップすれば解決するそうです。

自動で解決

詳細を見ているとCreate automated security fixと自動で修正してくれるようなボタンが出てきます。(混み具合にもよるそうでちょっと時間がかかるみたいです)
※自動アップデートを有効にしていれば勝手にプルリクエストが作成されます。

image.png

すると下記のようなプルリクエストが作成されますので、これをマージするだけで脆弱性の警告を解消できます。

image.png

Dependabot Alertsとは

今回、脆弱性の通知から自動修正まで行ってくれた機能について調べてみるとDependabotの機能だそうで以下の記事がわかりやすかったです。

参考:

まとめ

  • Dependabotを利用して、自動で脆弱性の検出から修正を行ってみた。
  • ライブラリのバージョン更新を日々チェックするのは大変ですし、変更内容がプロジェクトに影響するのか確認するのもなかなか難しいので、このようなサービスは有効に活用していきたいですね。
2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?