我正在开发网络应用程序。
我需要检查依赖项的安全性。
我实际上正在使用 OWASP 依赖项检查扫描我的源代码,但我认为它不是在 Web 应用程序上使用的最佳工具。
我认为 npm 审计或 yarn 审计是检查这个应用程序之王的依赖项安全性的更好工具。
使用 OWASP,我使用 OWASP SonarQube 项目将结果集成到 sonarQube 中
使用的设置示例:
sonar.dependencyCheck.reportPath=$(System.DefaultWorkingDirectory)/DependencyCheckResults/dependency-check-report.xml
sonar.dependencyCheck.htmlReportPath=$(System.DefaultWorkingDirectory)/DependencyCheckResults/dependency-check-report.html
同理,有没有办法将npm审计(或yarn审计)报告导入SonarQube?
目前我使用以下命令以 json 格式生成报告:
npm audit --json
我也知道可以使用 https://github.com/eventOneHQ/npm-audit-html 从 npm 审计中生成 HTML 报告。
所以,它只是缺少一个 SonarQube 插件来导入它或类似的东西,但我找不到它。
最佳答案
目前,这似乎不可能。然而,this npm rfc 0004指定 npm audit --owasp
解决这个问题的标志。此 RFC 已被接受,但尚未实现。
也许值得一试解析 npm audit --json
的输出使用一些 sonarQube 插件,但我不知道如何执行此操作。
编辑 2021-08-09
npm rfc 是 withdrawn :
The npm cli team would be happy to land this change in case it comes from a community contribution, this withdrawn was based on the fact that this is not remotely closed to being in the roadmap of the current team.
关于npm - 在 SonarQube 中使用 npm 审计报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57926484/