リポジトリを保護する

You can use a number of GitHub features to help keep your repository secure.

Repository administrators and organization owners can configure repository security settings.

はじめに

This guide shows you how to configure security features for a repository. You must be a repository administrator or organization owner to configure security settings for a repository.

Your security needs are unique to your repository, so you may not need to enable every feature for your repository. For more information, see "GitHub security features."

Some security features are only available for public repositories, and for private repositories owned by organizations with an Advanced Security license. 詳しい情報については、「GitHub Advanced Security について」を参照してください。

Managing access to your repository

リポジトリを保護するための最初の手順は、コードを表示および変更できるユーザを設定することです。 詳しい情報については、「リポジトリ設定を管理する」を参照してください。

From the main page of your repository, click Settings, then scroll down to the "Danger Zone."

Setting a security policy

  1. From the main page of your repository, click Security.
  2. Click Security policy.
  3. [Start setup] をクリックします。
  4. Add information about supported versions of your project and how to report vulnerabilities.

詳しい情報については「リポジトリにセキュリティポリシーを追加する」を参照してください。

Managing the dependency graph

The dependency graph is automatically generated for all public repositories and you can choose to enable it for private repositories.

  1. From the main page of your repository, click Settings.
  2. Click Security & analysis.
  3. Next to Dependency graph, click Enable or Disable.

詳しい情報については、「リポジトリの依存関係を調べる」を参照してください。

Managing Dependabotアラート

By default, GitHub detects vulnerabilities in public repositories and generates Dependabotアラート. Dependabotアラート can also be enabled for private repositories.

  1. Click your profile photo, then click Settings.
  2. Click Security & analysis.
  3. Click Enable all next to Dependabotアラート.

For more information, see "About alerts for vulnerable dependencies" and "Managing security and analysis settings for your user account."

Managing dependency review

Dependency review lets you visualize dependency changes in pull requests before they are merged into your repository. Dependency review is available in all public repositories and in repositories owned by organizations with an Advanced Security license that have the dependency graph enabled. For more information, see "About dependency review."

Managing Dependabotセキュリティアップデート

For any repository that uses Dependabotアラート, you can enable Dependabotセキュリティアップデート to raise pull requests with security updates when vulnerabilities are detected.

  1. From the main page of your repository, click Settings.
  2. Click Security & analysis.
  3. Next to Dependabotセキュリティアップデート, click Enable.

For more information, see "About Dependabotセキュリティアップデート" and "Configuring Dependabotセキュリティアップデート."

Managing Dependabotバージョンアップデート

You can enable Dependabot to automatically raise pull requests to keep your dependencies up-to-date. For more information, see "About Dependabotバージョンアップデート."

To enable Dependabotバージョンアップデート, you must create a dependabot.yml configuration file. For more information, see "Enabling and disabling version updates."

code scanning を設定する

Code scanning is available for all public repositories, and for private repositories owned by organizations with an Advanced Security license.

You can set up code scanning to automatically identify vulnerabilities and errors in the code stored in your repository by using a CodeQL分析ワークフロー or third-party tool. 詳しい情報については、「リポジトリに対する code scanning をセットアップする」を参照してください。

Configuring secret scanning

Secret scanning is available for all public repositories, and for private repositories owned by organizations with an Advanced Security license.

Secret scanning may be enabled for your repository by default depending upon your organization's settings.

  1. From the main page of your repository, click Settings.
  2. Click Security & analysis.
  3. If GitHub Advanced Security is not already enabled, click Enable.
  4. Next to Secret scanning, click Enable.

次のステップ

You can view and manage alerts from security features to address dependencies and vulnerabilities in your code. For more information, see "Viewing and updating vulnerable dependencies in your repository," "Managing pull requests for dependency updates," "Managing code scanning for your repository," and "Managing alerts from secret scanning."

If you have a security vulnerability, you can create a security advisory to privately discuss and fix the vulnerability. For more information, see "About GitHub Security Advisories" and "Creating a security advisory."

このドキュメントは役立ちましたか?プライバシーポリシー

これらのドキュメントを素晴らしいものにするのを手伝ってください!

GitHubのすべてのドキュメントはオープンソースです。間違っていたり、はっきりしないところがありましたか?Pull Requestをお送りください。

コントリビューションを行う

OR, コントリビューションの方法を学んでください。

問題がまだ解決していませんか?

GitHubコミュニティで質問するサポートへの連絡