After running an initial analysis of your code with default setup, you can make changes to your configuration to better meet your needs. See À propos des types d’installation pour l’analyse du code and Propriétés du référentiel pour code scanning.
Customizing your existing configuration of default setup
-
Sur GitHub, accédez à la page principale du référentiel.
-
Sous le nom de votre référentiel, cliquez sur Paramètres. Si vous ne voyez pas l’onglet « Paramètres », sélectionnez le menu déroulant , puis cliquez sur Paramètres.

-
Dans la section « Sécurité » de la barre latérale, cliquez sur Advanced Security.
-
In the "CodeQL analysis" row of the "Code Security" section, select , then click View CodeQL configuration.
-
In the "CodeQL default configuration" window, click Edit.
-
Optionally, in the "Languages" section, select or deselect languages for analysis.
-
Optionally, in the "Query suite" row of the "Scan settings" section, select a different query suite to run against your code.
-
Optionally, to use labeled runners, in the "Runner type" section of the "CodeQL default configuration" modal dialog, select Standard GitHub runner to open a dropdown menu, then select Labeled runner. Then, next to "Runner label," enter the label of an existing self-hosted or GitHub-hosted runner. For more information, see Configuring default setup for code scanning.
-
(Version d'essai publique) 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 et C#.
-
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:
- Un outil requis détecte une alerte code scanning dont la gravité est spécifiée dans l’ensemble de règles.
- L’analyse d’un outil requis est toujours en cours.
- Un outil requis n’est pas configuré pour le référentiel.
For more information, see Set code scanning merge protection. For more general information about rulesets, see À propos des ensembles de règles.
Including local sources of tainted data in default setup
Remarque
Les modèles de menace se trouvent actuellement en préversion publique et peuvent être amenés à changer. Pendant la préversion publique, les modèles de risque ne sont pris en charge que par l’analyse pour Java/Kotlin et 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 préversion publique, 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
Remarque
Les packs de modèles CodeQL sont actuellement en préversion publique et peuvent faire l’objet de modifications. Les packs de modèles sont pris en charge pour l’analyse C/C++, C#, Java/Kotlin, Python, Ruby et Rust.
L’éditeur de modèle CodeQL de l’extension CodeQL pour Visual Studio Code prend en charge les dépendances de modélisation pour C#, Java/Kotlin, Python et Ruby.
If your enterprise is hosted on GitHub.com and 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
- In the
.github/codeql/extensionsdirectory of the repository, copy the model pack directory which should include acodeql-pack.ymlfile and any.ymlfiles containing additional models for the libraries or frameworks you wish to include in your analysis. - The model packs will be automatically detected and used in your code scanning analysis.
- If you later change your configuration to use advanced setup, any model packs in the
.github/codeql/extensionsdirectory will still be recognized and used.
Extending coverage for all repositories in an organization
Remarque
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 GitHub Container registry and be accessible to the repositories that run code scanning. For more information, see Utilisation du registre de conteneurs.
-
Dans le coin supérieur droit de GitHub, cliquez sur votre photo de profil, puis sur Vos organisations.
-
Sous le nom de votre organisation, cliquez sur Settings. Si vous ne voyez pas l’onglet « Paramètres », sélectionnez le menu déroulant , puis cliquez sur Paramètres.

-
Dans la section « Sécurité » de la barre latérale, cliquez sur Advanced Security puis Paramètres globaux.
-
Find the "Code scanning" section.
-
Next to "Expand CodeQL analysis," click Configure.
-
Enter references to the published model packs you want to use, one per line, then click Save.

-
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 Configuration avancée de l’analyse du code.