我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

Configuring automated security fixes

You can use automated or manual pull requests to easily update vulnerable dependencies.

In this article

About automated security fixes

Note: Automatic security fixes are available in beta and are subject to change.

You can enable automated security fixes for any repository that uses security alerts and the dependency graph. We'll automatically enable automated security fixes in every repository that uses security alerts and the dependency graph over the next few months, starting in May 2019. You can disable automated security fixes for an individual repository or for all repositories owned by your user account or organization.

When you receive a security alert about a vulnerable dependency in your repository, you can resolve the vulnerability using an automated security fix in a pull request that corresponds to the security alert. Automated security fixes are available in repositories that use the dependency graph. By default, GitHub automatically creates a pull request in your repository to upgrade the vulnerable dependency to the minimum possible secure version needed to avoid the vulnerability. If you prefer, you can disable automatic pull requests and manually create pull requests to upgrade dependencies only when you choose to.

Automated security requests contain everything you need to quickly and safely review and merge a proposed fix into your project, including information about the vulnerability like release notes, changelog entries, and commit details.

Automated security fixes are opened by Dependabot on behalf of GitHub. The Dependabot GitHub 应用程序 is automatically installed on every repository where automated security fixes are enabled.

People with access to your repository's security alerts will see a link to the relevant security alert, although other people with access to the pull request will not be able to see which vulnerablity the pull request resolves.

When you merge a pull request that contains an automated security fix, the corresponding security alert is marked as resolved for your repository.

Note: Automated security fixes resolve security vulnerabilities only. Automated security fixes are not created to resolve vulnerabilities in private registries or packages hosted in private repositories.

About compatibility scores

Automated security fixes also include compatibility scores to let you know whether updating a vulnerability could cause breaking changes to your project. We look at previously-passing CI tests from public repositories where we've generated a given automated security fix to learn whether the update causes tests to fail. An update's compatibility score is the percentage of CI runs that passed when updating between relevant versions of the dependency.

Managing automated security fixes for your repository

You can enable or disable automated security fixes for an individual repository.

Before you can enable automated security fixes, you must enable the dependency graph and security alerts for your repository. For more information, see "Opting into or out of data use for your repository."

  1. 在 GitHub 上,导航到仓库的主页面。

  2. 在仓库名称下,单击 Security(安全)

    Security(安全)选项卡

  3. Above the list of alerts, use the drop-down menu and select or unselect Automated security fixes.

    Drop-down menu with the option to enable automated security fixes

Managing automated security fixes for your user account

You can disable automated security fixes for all repositories owned by your user account. If you do, you can still enable automated security fixes for individual repositories owned by your user account.

  1. 在任意页面的右上角,单击您的个人资料照片,然后单击 Settings(设置)

    用户栏中的 Settings(设置)图标

  2. 在用户设置侧边栏中,单击 Security(安全)

    安全设置侧边栏

  3. Under "Automated security fixes", select or deselect Opt out of automated security fixes.

    Checkbox to opt out of automated security fixes

  4. 单击 Save(保存)

Managing automated security fixes for your organization

Organization owners can disable automated security fixes for all repositories owned by the organization. If you do, anyone with admin permissions to an individual repository owned by the organization can still enable automated security fixes on that repository.

  1. 在 GitHub 的右上角,单击您的个人资料照片,然后单击 Your profile(您的个人资料)

    个人资料照片

  2. 在个人资料页面的左侧,在“Organizations(组织)”下单击组织的图标。

    组织图标

  3. 在组织名称下,单击 Settings(设置)

    组织设置按钮

  4. 在组织设置侧边栏中,单击 Security(安全)

    Security(安全)设置

  5. Under "Automated security fixes", select or deselect Opt out of automated security fixes.

    Checkbox to opt out of automated security fixes

  6. 单击 Save(保存)

Further reading

问问别人

找不到要找的内容?

联系我们