Skip to main content

This version of GitHub Enterprise Server will be discontinued on 2026-03-17. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise Server. For help with the upgrade, contact GitHub Enterprise support.

Configuring default setup for code scanning at scale

You can quickly configure code scanning for repositories across your organization using default setup.

Who can use this feature?

Organization owners, security managers, and organization members with the admin role

Code scanning is available for the following repository types:

  • Public repositories on GitHub.com
  • Organization-owned repositories on GitHub Team, GitHub Enterprise Cloud, or GitHub Enterprise Server, with GitHub Advanced Security enabled.

With default setup for code scanning, you can quickly secure code in repositories across your organization. For more information, see About setup types for code scanning.

For repositories that are not suitable for default setup, you can configure advanced setup at the repository level, or at the organization level using a script.

Prerequisites

A repository must meet all the following criteria to be eligible for default setup:

  • Advanced setup for code scanning is not already enabled.
  • GitHub Actions is enabled.
  • GitHub Advanced Security is enabled.

Configuring default setup for all eligible repositories in an organization

You can enable default setup for all eligible repositories in your organization. For more information, see About enabling security features at scale.

Extending CodeQL coverage in default setup

Through your organization's security settings page, you can extend coverage in default setup using model packs for all eligible repositories in your organization. For more information, see Editing your configuration of default setup.

Configuring default setup for a subset of repositories in an organization

You can filter for specific repositories you would like to configure default setup for. For more information, see Applying a custom security configuration.

Configuring merge protection for all repositories in an organization

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

  • A required tool found a code scanning alert of a severity that is defined in a ruleset.
  • A required code scanning tool's analysis is still in progress.
  • A required code scanning tool is not configured for the repository.

For more information, see Set code scanning merge protection. For more general information about rulesets, see About rulesets.