Skip to main content

About Dependabot alerts

GitHub sends Dependabot alerts when we detect that your repository uses a vulnerable dependency.

谁可以使用此功能?

Dependabot alerts 可用于以下仓库:

  • 组织拥有的存储库和用户拥有的存储库

Dependabot alerts tell you when your code depends on a package that is insecure. Often, software is built using open-source code packages from a large variety of sources. The complex relationships between these dependencies, and the ease with which malicious actors can insert malware into upstream code, mean that you may unknowingly be using dependencies that have security flaws, also known as vulnerabilities.

If your code depends on a package with a security vulnerability, this can cause a range of problems for your project or the people who use it. Using a vulnerable package makes you a soft target for malicious users looking to exploit your system. For example, they may seek to get access to your code and data from your customers or contributors. You should upgrade to a secure version of the package as soon as possible. If your code uses malware, you need to replace the package with a secure alternative.

Dependabot 不会为恶意软件生成 Dependabot alerts。 有关详细信息,请参阅“About the GitHub Advisory database”。

有关 Dependabot 提供的不同功能的概述以及如何入门的说明,请参阅“Dependabot 快速入门指南”。

Detection of insecure dependencies

Dependabot performs a scan of the default branch of your repository to detect insecure dependencies, and sends Dependabot alerts when:

  • New advisory data is synchronized to GitHub each hour from GitHub.com. 有关详细信息,请参阅“在 GitHub Advisory Database 中浏览安全公告”。

    注意

    Only advisories that have been reviewed by GitHub will trigger Dependabot alerts.

  • The dependency graph for a repository changes. For example, when a contributor pushes a commit to change the packages or versions it depends on. For more information, see About the dependency graph.

注意

Dependabot doesn't scan archived repositories.

此外,GitHub 还可以查看在针对存储库默认分支的拉取请求中添加、更新或删除的任何依赖项,并标记任何会降低项目安全性的更改。 因此可以在易受攻击的依赖项到达代码库之前(而非之后)发现并进行处理。 有关详细信息,请参阅“审查拉取请求中的依赖项更改”。

As Dependabot alerts rely on the dependency graph, the ecosystems that are supported by Dependabot alerts are the same as those supported by the dependency graph. For a list of these ecosystems, see 依赖项关系图支持的包生态系统.

注意

It is important to keep your manifest and lock files up to date. If the dependency graph doesn't accurately reflect your current dependencies and versions, then you could miss alerts for insecure dependencies that you use. You may also get alerts for dependencies that you no longer use.

Dependabot 只会为使用语义版本控制的易受攻击的 GitHub Actions 创建 Dependabot alerts。 你将不会收到有关使用 SHA 版本控制的易受攻击操作的警报。 如果将 GitHub Actions 与 SHA 版本控制配合使用,建议为存储库或组织启用 Dependabot version updates 以保留更新到最新版本的操作。

Configuration of Dependabot alerts

企业所有者必须对你的 GitHub Enterprise Server 实例启用Dependabot alerts,然后才能使用此功能。 有关详细信息,请参阅“为企业启用 Dependabot”。

When GitHub identifies a vulnerable dependency, we generate a Dependabot alert and display it on the Security tab for the repository and in the repository's dependency graph. The alert includes a link to the affected file in the project, and information about a fixed version.

GitHub may also notify the maintainers of affected repositories about new alerts according to their notification preferences. When Dependabot is first enabled, GitHub does not send notifications for all vulnerable dependencies found in your repository, only for new vulnerable dependencies identified after Dependabot is enabled. For more information, see 为 Dependabot 警报配置通知.

如果已启用存储库的 Dependabot security updates,警报中还会包含一个拉取请求链接,用于将清单或锁定文件更新到可解决该漏洞的最低版本。 有关详细信息,请参阅“About Dependabot security updates”。

此外,可以使用 Dependabot 自动分类规则 大规模管理警报,以便自动关闭或推迟警报,并指定希望 Dependabot 打开拉取请求的警报。 有关不同类型的自动会审规则以及仓库是否符合条件的信息,请参阅“About Dependabot auto-triage rules”。

警告

GitHub's security features do not claim to catch all vulnerabilities. We actively maintain GitHub Advisory Database and generate alerts with the most up-to-date information. However, we cannot catch everything or tell you about known vulnerabilities within a guaranteed time frame. These features are not substitutes for human review of each dependency for potential vulnerabilities or any other issues, and we recommend consulting with a security service or conducting a thorough dependency review when necessary.

Access to Dependabot alerts

You can see all of the alerts that affect a particular project in the repository's dependency graph. For more information, see 查看和更新 Dependabot 警报.

By default, we notify people with write, maintain, or admin permissions in the affected repositories about new Dependabot alerts.

若要在存储库上接收有关 Dependabot alerts} 的通知,需要监视这些存储库,并订阅以接收“所有活动”通知或配置自定义设置以包括“安全警报”。 有关详细信息,请参阅“配置通知”。 可以选择通知的传递方法,以及通知发送给你的频率。 For more information, see 为 Dependabot 警报配置通知.

You can also see all the Dependabot alerts that correspond to a particular advisory in the GitHub Advisory Database. 有关详细信息,请参阅“在 GitHub Advisory Database 中浏览安全公告”。

Further reading