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 Resolving code scanning alerts.
GitHub Copilotの自動修正機能 will suggest fixes for alerts from code scanning analysis, allowing developers to prevent and reduce vulnerabilities with less effort. For more information, see アプリケーション カード: GitHubセキュリティと品質の AI 機能.
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 エンドポイント.
Code scanning uses GitHub Actions, with each workflow run consuming GitHub Actions minutes. If you want to use code scanning on private repositories, you need a GitHub Code Security license. For more information, see GitHub Actions の課金. GitHub Enterprise で GitHub Advanced Security を無料で試用する方法については、GitHub Enterprise Cloud ドキュメントの「GitHub Enterprise Cloud の試用版の設定」と「GitHub Advanced Security の試用版を設定する」を参照してください。
If you want to assess your organization's exposure to vulnerabilities before purchasing a license, you can run a free code security risk assessment. See Code security risk assessment.
To get started with code scanning, see Configuring default setup for code scanning.
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 Code scanning with CodeQL.
About third-party code scanning tools
Code scanning は、SARIF (Static Analysis Results Interchange Format) データを出力するサードパーティのコード スキャンニング ツールと相互運用できます。 SARIFはオープン標準です。 詳しくは、「SARIF support for code scanning」をご覧ください。
You can run third-party analysis tools within GitHub using actions or within an external CI system. For more information, see コード スキャンの詳細設定を構成する or Uploading a SARIF file to 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 コード スキャンにツールの状態ページを使用する.