【问题标题】:Issue with nsp scannsp 扫描问题
【发布时间】:2018-06-14 15:09:12
【问题描述】:

我正在使用 nsp 来扫描漏洞。我看到一个奇怪的行为。

在脚本、依赖项、devDependency 部分我有以下内容

{
    "scripts": {
        "security-scan:nsp": "nsp check --threshold 10 --reporter json"
    },
    "dependencies": {
        "joi": "10.x",
        "dotenv": "4.0.0",
        "nsp": "3.2.1"
    },
    "devDependencies": {
        "lab": "14.x",
        "code": "4.x",
        "eslint": "4.1.1",
        "eslint-plugin-import": "2.7.0"
    }
}

如果我运行 npm run security-scan:nsp 我会遇到一些漏洞,但现在如果我将 nsp 从依赖项移动到 devDependency 并运行 npm run security-scan:nsp strong> 我没有任何漏洞。任何人都可以在这里帮助我。

【问题讨论】:

    标签: node.js express hapijs owasp


    【解决方案1】:

    Nsp 不扫描开发依赖项。新的npm audit 命令确实如此,并且它使用相同的漏洞数据库,但没有任何 nsp 的格式化选项。

    【讨论】:

    • 嘿 Gangstead,感谢您的回答,但我的意图是 nsp 模块不应该投入生产,我们在测试阶段或开发阶段需要它。所以这就是我想将它添加到 devDependency 中的原因,以便在生产中我可以使用 npm install --only-production
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-07-04
    • 2012-12-08
    • 1970-01-01
    • 1970-01-01
    • 2014-07-18
    • 2010-12-31
    相关资源
    最近更新 更多