0

我创建了一个测试 NuGet 包,它指定了对 jQuery 1.4.2 的依赖。当上传到我的 Artifactory NuGet 服务器时,XRay 可以正确检测 jQuery 上的安全问题。但是,当我上传将 jQuery 1.4.2 列为依赖项的测试 NuGet 包时,XRay 不会将我的包标记为易受攻击的包。

1) 测试我的 Artifactory 服务器中的 jQuery 1.4.2 Nuget 包被正确检测为易受攻击。

2) 向我的测试包添加了一个依赖项,其中列出了 jQuery 1.4.2。(我怀疑是区分大小写的问题,所以我还尝试了一个小写依赖作为“jquery”)。

3) 尝试了除 jQuery 之外的其他已知易受攻击的包

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
    <id>RogerCruz.VulnerabilitiesGalore</id>
    <title>VulnerabilitiesGalore</title>
    <version>1.0.4.0</version>
    <owners>Roger Cruz</owners>
    <authors>Roger Cruz</authors>
    <releaseNotes>A package that depends on known vulnerable packages.  Use this to test vulnerability scanners.</releaseNotes>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Test package with known vulnerabilities</description>
    <copyright>Copyright Roger Cruz</copyright>
    <dependencies>
        <dependency id="jQuery" version="[1.4.2]"/>
    </dependencies>
</metadata>
<files>
</files>
</package>

这些是我用来创建我的测试 NuGet 包并将它们推送到 Artifactory+XRay 云试用实例的命令。

nuget.exe pack VulnerabilitiesGalore.nuspec
nuget push .\RogerCruz.VulnerabilitiesGalore.1.0.4.nupkg -Source Trial

Artifactory 报告我的测试包有一个依赖项。浏览包时可以看到以下属性。

nuget.dependency  jQuery:[1.4.2]: 

在我所有的测试尝试中,XRay 都没有检测到我的测试包 (RogerCruz.VulnerabilitiesGalore) 是易受攻击的,尽管它对易受攻击的 jQuery 1.4.2 具有指定的依赖关系。

我的期望是它应该因为这个声明而检测到它:

“对 NuGet 包的所有层进行深度递归扫描 Xray 以递归方式剥离 NuGet 包的不同层及其依赖项,确保软件中包含的每个软件工件都已被扫描以查找问题和漏洞。”

来源:https ://jfrog.com/integration/nuget-xray/

4

1 回答 1

5

该软件包RogerCruz.VulnerabilitiesGalore不包含jQuery:1.4.2在其中。如 .nuspec 描述符文件所示,它作为直接运行时依赖项与其相关。

Deep Recursive Scan表示包在物理上与另一个包之间的关系。例如:如果RogerCruz.VulnerabilitiesGalore包裹包含jQuery:1.4.2在其中,那么 JFrog Xray 会检测到它是易受攻击的,并通过像剥洋葱一样逐个打开包裹来递归扫描它。

上述场景中的一个正确用例是RogerCruz.VulnerabilitiesGalore自行构建或将其用作另一个项目的依赖项。在构建时,直接依赖jQuery:1.4.2将从中解决remote repository,JFrog Xray 将能够扫描它。

为了实现对 NuGet 项目及其传递依赖项的全面扫描,我建议使用JFrog CLI构建您的项目

JFrog Xray 将知道如何分析它生成的构建信息,扫描项目及其依赖项(包括传递)

于 2019-12-02T07:18:41.363 回答