Skip to main content

このバージョンの GitHub Enterprise サーバーはこの日付をもって終了となります: 2026-04-09. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise サーバーにアップグレードしてください。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせください

Editing your configuration of default setup

You can edit your existing configuration of default setup for code scanning to better meet your needs.

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

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

After running an initial analysis of your code with default setup, you can make changes to your configuration to better meet your needs. See コード スキャンのセットアップの種類について.

Customizing your existing configuration of default setup

  1. GitHub で、リポジトリのメイン ページに移動します。

  2. リポジトリ名の下にある [Settings] をクリックします。 [設定] タブが表示されない場合は、 [] ドロップダウン メニューを選び、 [設定] をクリックします。

    タブを示すリポジトリ ヘッダーのスクリーンショット。 [設定] タブが濃いオレンジ色の枠線で強調表示されています。

  3. サイドバーの [Security] セクションで、[ Code security and analysis] をクリックします。

  4. In the "CodeQL analysis" row of the "Code scanning" section, select , then click View CodeQL configuration.

  5. In the "CodeQL default configuration" window, click Edit.

  6. Optionally, in the "Languages" section, select or deselect languages for analysis.

  7. Optionally, in the "Query suite" row of the "Scan settings" section, select a different query suite to run against your code.

  8. (ベータ) Optionally, in the "Threat model" row of the "Scan settings" section, select Remote and local sources. This option is only available for repositories with code in a supported language: Java/Kotlin と C#.

  9. To update your configuration, as well as run an initial analysis of your code with the new configuration, click Save changes. All future analyses will use your new configuration.

Defining the alert severities that cause a check failure for a pull request

You can use rulesets to prevent pull requests from being merged when one of the following conditions is met:

  • 必要なツールは、ルール セットで定義されている重大度の code scanning アラートを検索します。
  • 必要なツールの分析はまだ進行中です。
  • リポジトリに必要なツールが構成されていません。

For more information, see Set code scanning merge protection. For more general information about rulesets, see ルールセットについて.

Including local sources of tainted data in default setup

メモ

脅威モデルは現在 ベータ 段階であり、変更される可能性があります。 ベータ 期間中、脅威モデルは Java/Kotlin と C# 解析でのみサポートされます。

If your codebase only considers remote network requests to be potential sources of tainted data, then we recommend using the default threat model. If your codebase considers sources other than network requests to potentially contain tainted data, then you can use threat models to add these additional sources to your CodeQL analysis. During the ベータ, you can add local sources (for example: command-line arguments, environment variables, file systems, and databases) that your codebase may consider to be additional sources of tainted data.

You can edit the threat model used in a default setup configuration. For more information, see Customizing your existing configuration of default setup.

Extending CodeQL coverage with CodeQL model packs in default setup

メモ

CodeQL モデル パックは現在 ベータ 段階であり、変更される可能性があります。 モデル パックは C/C++、C#、Java/Kotlin、Python、および Ruby 分析でサポートされます。

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

If you use frameworks and libraries that are not recognized by the standard libraries included with CodeQL, you can model your dependencies and extend code scanning analysis. For more information, see Supported languages and frameworks in the documentation for CodeQL.

For default setup, you need to define the models of your additional dependencies in CodeQL model packs. You can extend coverage in default setup with CodeQL model packs for individual repositories, or at scale for all repositories in an organization.

For more information about CodeQL model packs and writing your own, see Using the CodeQL model editor.

Extending coverage for a repository

  1. In the .github/codeql/extensions directory of the repository, copy the model pack directory which should include a codeql-pack.yml file and any .yml files containing additional models for the libraries or frameworks you wish to include in your analysis.
  2. The model packs will be automatically detected and used in your code scanning analysis.
  3. If you later change your configuration to use advanced setup, any model packs in the .github/codeql/extensions directory will still be recognized and used.

Extending coverage for all repositories in an organization

メモ

If you extend coverage with CodeQL model packs for all repositories in an organization, the model packs that you specify must be published to the container registry associated with the GitHub Enterprise Server instance (https://containers.HOSTNAME) and be accessible to the repositories that run code scanning. For more information, see コンテナレジストリの利用.

  1. GitHub の右上隅にあるプロフィール画像をクリックしてから、[ Your organizations] をクリックします。

  2. Organization 名の下で、[ Settings] をクリックします。 [設定] タブが表示されない場合は、 [] ドロップダウン メニューを選び、 [設定] をクリックします。

    組織のプロファイルのタブのスクリーンショット。 [設定] タブが濃いオレンジ色の枠線で囲まれています。

  3. サイドバーの [Security] セクションで、 [Code security and analysis][Global settings] の順にクリックします。

  4. Find the "Code scanning" section.

  5. Next to "Expand CodeQL analysis," click Configure.

  6. Enter references to the published model packs you want to use, one per line, then click Save.

    Screenshot of the "Expand CodeQL analysis" view" in the settings for an organization.

  7. The model packs will be automatically detected and used when code scanning runs on any repository in the organization with default setup enabled.

Further customization

If you need to change any other aspects of your code scanning configuration, consider configuring advanced setup. See Configuring advanced setup for code scanning.