Skip to main content

About code scanning

You can use code scanning to find security vulnerabilities and errors in the code for your project on GitHub.

この機能を使用できるユーザーについて

Code scanning は、次のリポジトリの種類で使用できます。

  • GitHub.com 上のパブリックリポジトリ
  • GitHub Team、GitHub Enterprise Cloud、または GitHub Enterprise Server 上の組織所有リポジトリ。 GitHub Code Security が 有効になっています。

Code scanning は、GitHub リポジトリ内のコードを分析して、セキュリティの脆弱性とコーディング エラーを見つけることができる機能です。 分析によって特定された問題は、リポジトリに表示されます。

You can use code scanning to find, triage, and prioritize fixes for existing problems in your code. Code scanning also prevents developers from introducing new problems. You can schedule scans for specific days and times, or trigger scans when a specific event occurs in the repository, such as a push.

If code scanning finds a potential vulnerability or error in your code, GitHub displays an alert in the repository. After you fix the code that triggered the alert, GitHub closes the alert. For more information, see コード スキャン アラートを解決する.

GitHub Copilot Autofix will suggest fixes for alerts from code scanning analysis, allowing developers to prevent and reduce vulnerabilities with less effort. For more information, see コード スキャンにおける Copilot Autofix の責任ある使用.

To monitor results from code scanning across your repositories or your organization, you can use webhooks and the code scanning API. For information about the webhooks for code scanning, see Webhook のイベントとペイロード. For information about API endpoints, see コード スキャン用の REST API エンドポイント.

To get started with code scanning, see コード スキャンの既定セットアップの構成.

About billing for code scanning

Code scanning uses GitHub Actions, and each run of a code scanning workflow consumes minutes for GitHub Actions. For more information, see GitHub Actions の課金.

To use code scanning on a private repository, you will also need a license for GitHub Code Security. GitHub Advanced Security で GitHub Enterprise を無料で試用する方法については、GitHub Enterprise Cloud ドキュメントの「GitHub Enterprise Cloud のトライアルを設定する」と「GitHub Advanced Security の試用版を設定する」を参照してください。

About tools for code scanning

You can configure code scanning to use the CodeQL product maintained by GitHub or a third-party code scanning tool.

About CodeQL analysis

CodeQL は、セキュリティ チェックを自動化するために GitHub が開発した、コード分析エンジンです。 CodeQL を使用してコードを分析し、結果を code scanning アラートとして表示することができます。 For more information about CodeQL, see About code scanning with CodeQL.

About third-party code scanning tools

Code scanning は、SARIF (Static Analysis Results Interchange Format) データを出力するサードパーティのコード スキャンニング ツールと相互運用できます。 SARIFはオープン標準です。 詳しくは、「Code scanningの SARIF サポート」をご覧ください。

You can run third-party analysis tools within GitHub using actions or within an external CI system. For more information, see コード スキャンの高度なセットアップの構成 or SARIF ファイルを GitHub にアップロードする.

About the ツールの状態ページ

The ツールの状態ページ shows useful information about all of your code scanning tools. If code scanning is not working as you'd expect, the ツールの状態ページ is a good starting point for debugging problems. For more information, see コード スキャンのツール状態ページについて.