Skip to main content

Creating a custom security configuration

Who can use this feature?

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

With custom security configurations, you can create collections of enablement settings for 's security products to meet the specific security needs of your organization. For example, you can create a different custom security configuration for each group of repositories to reflect their different levels of visibility, risk tolerance, and impact.

You can also choose whether or not you want to include Code Security or Secret Protection features in a configuration. For more information, see About Advanced Security.

  • Only features installed by a site administrator on your Enterprise Server instance will appear in the UI.
  • Some features will only be visible if your organization or Enterprise Server instance has purchased the relevant Advanced Security product ( Code Security or Secret Protection).
  • Certain features, like Dependabot security updates and code scanning default setup, also require that Actions is installed on the Enterprise Server instance.

Important

The order and names of some settings will differ depending on whether you are using licenses for the original Advanced Security product, or for the two new products: Code Security and Secret Protection. See Creating a Advanced Security configuration or Creating a Secret Protection and Code Security configuration.

  1. In the upper-right corner of , select your profile photo, then click Your organizations.

  2. Under your organization name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

    Screenshot of the tabs in an organization's profile. The "Settings" tab is outlined in dark orange.

  3. In the "Security" section of the sidebar, select the Advanced Security dropdown menu, then click Configurations.

  4. In the "Security configurations" section, click New configuration.

  5. To help identify your custom security configuration and clarify its purpose on the "Security configurations" page, name your configuration and create a description.

  6. Optionally, enable "Secret Protection", a paid feature for private repositories. Enabling Secret Protection enables alerts for secret scanning. In addition, you can choose whether to enable, disable, or keep the existing settings for the following secret scanning features:

  7. Optionally, enable "Code Security", a paid feature for private repositories. You can choose whether to enable, disable, or keep the existing settings for the following code scanning features:

  8. Still under "Code Security", in the "Dependency scanning" table, choose whether you want to enable, disable, or keep the existing settings for the following dependency scanning features:

  9. Optionally, in the "Policy" section, you can use additional options to control how the configuration is applied:

    • Use as default for newly created repositories. Select the None dropdown menu, then click Public, Private and internal, or All repositories.

      Note

      The default security configuration for an organization is only automatically applied to new repositories created in your organization. If a repository is transferred into your organization, you will still need to apply an appropriate security configuration to the repository manually.

    • Enforce configuration. Block repository owners from changing features that are enabled or disabled by the configuration (features that are not set aren't enforced). Select Enforce from the dropdown menu.
  10. To finish creating your custom security configuration, click Save configuration.

Note

If a user in your enterprise attempts to change the enablement status of a feature in an enforced configuration using the REST API, the API call will appear to succeed, but no enablement statuses will change.

Some situations can break the enforcement of security configurations for a repository. For example, the enablement of code scanning will not apply to a repository if:

  • Actions is initially enabled on the repository, but is then disabled in the repository.
  • Actions required by code scanning configurations are not available in the repository.
  • Self-hosted runners with the label code-scanning are not available.
  • The definition for which languages should not be analyzed using code scanning default setup is changed.

  1. In the upper-right corner of , select your profile photo, then click Your organizations.

  2. Under your organization name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

    Screenshot of the tabs in an organization's profile. The "Settings" tab is outlined in dark orange.

  3. In the "Security" section of the sidebar, select the Advanced Security dropdown menu, then click Configurations.

  4. In the "Security configurations" section, click New configuration.

  5. To help identify your custom security configuration and clarify its purpose on the "New configuration" page, name your configuration and create a description.

  6. In the " Advanced Security features" row, choose whether to include or exclude Advanced Security (GHAS) features.

  7. In the "Secret scanning" table, choose whether you want to enable, disable, or keep the existing settings for the following security features:

  8. In the "Code scanning" table, choose whether you want to enable, disable, or keep the existing settings for code scanning default setup.

  9. In the "Dependency scanning" table, choose whether you want to enable, disable, or keep the existing settings for the following dependency scanning features:

  10. Optionally, in the "Policy" section, you can use additional options to control how the configuration is applied:

    • Use as default for newly created repositories. Select the None dropdown menu, then click Public, Private and internal, or All repositories.

      Note

      The default security configuration for an organization is only automatically applied to new repositories created in your organization. If a repository is transferred into your organization, you will still need to apply an appropriate security configuration to the repository manually.

    • Enforce configuration. Block repository owners from changing features that are enabled or disabled by the configuration (features that are not set aren't enforced). Select Enforce from the dropdown menu.
  11. To finish creating your custom security configuration, click Save configuration.

To apply your custom security configuration to repositories in your organization, see Applying a custom security configuration.

To learn how to edit your custom security configuration, see Editing a custom security configuration.