Skip to content

Latest commit

 

History

History
158 lines (117 loc) · 11.3 KB

configuring-dependabot-security-updates.md

File metadata and controls

158 lines (117 loc) · 11.3 KB
title intro shortTitle permissions redirect_from versions type topics
Configuring Dependabot security updates
You can use {% data variables.product.prodname_dependabot_security_updates %} or manual pull requests to easily update vulnerable dependencies.
Configure security updates
{% data reusables.permissions.dependabot-yml-configure %}
/articles/configuring-automated-security-fixes
/github/managing-security-vulnerabilities/configuring-automated-security-fixes
/github/managing-security-vulnerabilities/configuring-automated-security-updates
/github/managing-security-vulnerabilities/configuring-github-dependabot-security-updates
/github/managing-security-vulnerabilities/configuring-dependabot-security-updates
/code-security/supply-chain-security/configuring-dependabot-security-updates
/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates
fpt ghec ghes
*
*
*
how_to
Dependabot
Security updates
Alerts
Dependencies
Pull requests
Repositories

{% data reusables.dependabot.enterprise-enable-dependabot %}

About configuring {% data variables.product.prodname_dependabot_security_updates %}

You can enable {% data variables.product.prodname_dependabot_security_updates %} for any repository that uses {% data variables.product.prodname_dependabot_alerts %} and the dependency graph. For more information, see "AUTOTITLE."

You can enable or disable {% data variables.product.prodname_dependabot_security_updates %} for an individual repository{% ifversion code-security-multi-repo-enablement %}, for a selection of repositories in an organization,{% endif %} or for all repositories owned by your personal account or organization. For more information about enabling security features in an organization, see {% ifversion security-configurations %}"AUTOTITLE."{% else %}"AUTOTITLE."{% endif %}

{% data reusables.dependabot.dependabot-security-updates-disable-for-alert-rules %}

{% ifversion fpt or ghec %}{% data reusables.dependabot.dependabot-tos %}{% endif %}

Supported repositories

{% data variables.product.prodname_dotcom %} automatically enables {% data variables.product.prodname_dependabot_security_updates %} for newly created repositories if your personal account or organization has enabled Automatically enable for new repositories for {% data variables.product.prodname_dependabot_security_updates %}. For more information, see "Managing {% data variables.product.prodname_dependabot_security_updates %} for your repositories."

If you create a fork of a repository that has security updates enabled, {% data variables.product.prodname_dotcom %} will automatically disable {% data variables.product.prodname_dependabot_security_updates %} for the fork. You can then decide whether to enable {% data variables.product.prodname_dependabot_security_updates %} on the specific fork.

If security updates are not enabled for your repository and you don't know why, first try enabling them using the instructions given in the procedural sections below. If security updates are still not working, you can contact {% data variables.contact.contact_support %}.

Managing {% data variables.product.prodname_dependabot_security_updates %} for your repositories

You can enable or disable {% data variables.product.prodname_dependabot_security_updates %} for all qualifying repositories owned by your personal account or organization. For more information, see "AUTOTITLE" or "AUTOTITLE."

You can also enable or disable {% data variables.product.prodname_dependabot_security_updates %} for an individual repository.

Enabling or disabling {% data variables.product.prodname_dependabot_security_updates %} for an individual repository

{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.navigate-to-code-security-and-analysis %}

  1. Under "Code security", to the right of "{% data variables.product.prodname_dependabot %} security updates", click Enable to enable the feature or Disable to disable it. {% ifversion fpt or ghec %}For public repositories, the button is disabled if the feature is always enabled.{% endif %}

{% ifversion dependabot-grouped-security-updates-config %}

Grouping {% data variables.product.prodname_dependabot_security_updates %} into a single pull request

To reduce the number of pull requests you may be seeing, you can enable grouped security updates for your repository or organization. When this is enabled, {% data variables.product.prodname_dependabot %} will group security updates into one pull request for each package ecosystem. In order to use grouped security updates, you must first enable the following features:

  • Dependency graph. For more information, see "AUTOTITLE."
  • {% data variables.product.prodname_dependabot_alerts %}. For more information, see "AUTOTITLE."
  • {% data variables.product.prodname_dependabot_security_updates %}. For more information, see "AUTOTITLE."

Note

When grouped security updates are first enabled, {% data variables.product.prodname_dependabot %} will immediately try to create grouped pull requests. You may notice {% data variables.product.prodname_dependabot %} closing old pull requests and opening new ones.

{% data reusables.dependabot.dependabot-grouped-security-updates-how-enable %} {% data reusables.dependabot.dependabot-grouped-security-updates-order %}

Enabling or disabling grouped {% data variables.product.prodname_dependabot_security_updates %} for an individual repository

Repository administrators can enable or disable grouped security updates for their repository. Changing the repository setting will override any default organization settings. {% data reusables.dependabot.dependabot-grouped-security-updates-yaml-override %}

{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.navigate-to-code-security-and-analysis %}

  1. Under "Code security", to the right of "Grouped security updates", click Enable to enable the feature or Disable to disable it.

Enabling or disabling grouped {% data variables.product.prodname_dependabot_security_updates %} for an organization

{% ifversion security-configurations %} You can enable grouped {% data variables.product.prodname_dependabot_security_updates %} into a single pull request. For more information, see "AUTOTITLE."

{% else %}

Organization owners can enable or disable grouped security updates for all repositories in their organization. However, repository administrators within the organization can update the settings for their repositories to override the default organization settings. {% data reusables.dependabot.dependabot-grouped-security-updates-yaml-override %}

{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} {% data reusables.organizations.security-and-analysis %}

  1. Under "Code security", to the right of "Grouped security updates", click Disable all or Enable all.
  2. Optionally, to enable grouped {% data variables.product.prodname_dependabot_security_updates %} for new repositories in your organization, select Automatically enable for new repositories.

{% endif %} {% endif %}

Overriding the default behavior with a configuration file

You can override the default behavior of {% data variables.product.prodname_dependabot_security_updates %} by adding a dependabot.yml file to your repository. {% ifversion dependabot-grouped-security-updates-config %}With a dependabot.yml file, you can have more granular control of grouping, and override the default behavior of {% data variables.product.prodname_dependabot_security_updates %} settings.{% endif %}

{% ifversion dependabot-grouped-security-updates-config %} Use the groups option with the applies-to: security-updates key to create sets of dependencies (per package manager), so that {% data variables.product.prodname_dependabot %} opens a single pull request to update multiple dependencies at the same time. You can define groups by package name (the patterns and exclude-patterns keys), dependency type (dependency-type key), and SemVer (the update-types key).

{% data reusables.dependabot.dependabot-version-updates-groups-match-first %} {% endif %}

If you only require security updates and want to exclude version updates, you can set open-pull-requests-limit to 0 in order to prevent version updates for a given package-ecosystem.

For more information about the configuration options available for security updates, see "AUTOTITLE."

# Example configuration file that:
#  - Has a private registry
#  - Ignores lodash dependency
#  - Disables version-updates
{% ifversion dependabot-grouped-security-updates-config %}#  - Defines a group by package name, for security updates for golang dependencies{%- endif %}

version: 2
registries:
  example:
    type: npm-registry
    url: https://example.com
    token: {% raw %}${{secrets.NPM_TOKEN}}{% endraw %}
updates:
  - package-ecosystem: "npm"
    directory: "/src/npm-project"
    schedule:
      interval: "daily"
    # For Lodash, ignore all updates
    ignore:
      - dependency-name: "lodash"
    # Disable version updates for npm dependencies
    open-pull-requests-limit: 0
    registries:
      - example
  {% ifversion dependabot-grouped-security-updates-config %}- package-ecosystem: "gomod"
    groups:
      golang:
        applies-to: security-updates
        patterns:
          - "golang.org*"{% endif %}

Note

In order for {% data variables.product.prodname_dependabot %} to use this configuration for security updates, the directory must be the path to the manifest files, and you should not specify a target-branch.

Further reading