Composer 真的很酷,但是我们怎么知道某个必需的包中是否存在严重错误?

Composer is really cool, but how do we know if there is a critical bug in one of the required packages?

我的一些应用程序使用了 30 多个作曲家包。

使用所有这些包让我想到,如果其中一些发现需要更新的关键问题,我不能每天都手动重新检查它们。

Please note that I don't want to update just for new features when in production, only want to do critical updates, so I can't just check if there is a new version out.

我考虑过为这些使用次要补丁号,但我认为这还不够,因为某些软件包不为旧版本提供安全更新。

我的问题是:

有没有一种简单的方法可以关注所有这些软件包,以了解是否存在严重的安全问题或需要更新的错误? (也许有一个我不知道的标记选项,只更新标记为“ciritical-bug-fix”的包?)

你们这些专业人士是否只需要软件包,而一旦生产就忘记了它们?

P.S。我听说我们真的不应该 运行 composer update 在生产中,所以如果发生关键更新,我们应该如何进行?

最简单的方法是对具有已知漏洞的包使用 roave/security-advisories package. This is a Composer package which contains only a set of conflict 规则。实际上,如果您的依赖项中存在安全问题,您将无法 install/update 这个包。

安装包:

composer require --dev roave/security-advisories:dev-master

在此之后,您可以使用以下方法测试您的依赖项:

composer update --dry-run roave/security-advisories

如果这些命令中的任何一个导致 "Your requirements could not be resolved to an installable set of packages" 错误,您应该查看冲突包,因为它们可能存在一些已知的安全问题。