Skip to main content

Configuring advanced setup for code scanning with CodeQL at scale

You can use a script to configure advanced setup for code scanning for a specific group of repositories in your organization.

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

管理者 ロールを持つ組織の所有者、セキュリティ マネージャー、および組織メンバー

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

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

About enabling advanced setup for code scanning with CodeQL at scale

If you need to configure a highly customizable code scanning setup for many repositories in your organization, or if repositories in your organization are ineligible for default setup, you can enable code scanning at scale with advanced setup.

To enable advanced setup across multiple repositories, you can write a bulk configuration script. To successfully execute the script, GitHub Actions must be enabled for the organization or enterprise.

Alternatively, if you do not need granular control over the code scanning configuration for many repositories in your organization, you can quickly and easily configure code scanning at scale with default setup. For more information, see Configuring default setup for code scanning at scale.

Using a script to enable advanced setup

For repositories that are not eligible for default setup, you can use a bulk configuration script to enable advanced setup across multiple repositories.

  1. Identify a group of repositories that can be analyzed using the same code scanning configuration. For example, all repositories that build Java artifacts using the production environment.
  2. Create and test a GitHub Actions workflow to call the CodeQL action with the appropriate configuration. For more information, see コード スキャンの高度なセットアップの構成.
  3. Use one of the example scripts or create a custom script to add the workflow to each repository in the group.

Extending CodeQL coverage with model packs

メモ

CodeQL モデル パックは現在 パブリック プレビュー 段階であり、変更される可能性があります。 モデル パックは C/C++、C#、Java/Kotlin、Python、Ruby、Rust 分析でサポートされます。

Visual Studio Code 用 CodeQL 拡張機能の CodeQL モデル エディターでは、C#、Java/Kotlin、Python、Ruby に対する依存関係のモデリングがサポートされています。

If your codebase depends on a library or framework that is not recognized by the standard queries in CodeQL, you can extend the CodeQL coverage in your bulk configuration script by specifying published CodeQL model packs. For more information, see コード スキャン用の高度なセットアップのカスタマイズ.

Alternatively, if you do not need granular control over the code scanning configuration for many repositories in your organization, you can quickly and easily configure model packs with code scanning at scale with default setup. For more information, see 既定のセットアップの構成を編集する.