Dependency-Check 是 OWASP(Open Web Application Security Project)的一個實用開源程序,用于識別項目依賴項并檢查是否存在任何已知的,公開披露的漏洞。
?DependencyCheck 是什么
- Dependency-Check 是 OWASP(Open Web Application Security Project)的一個實用開源程序,用于識別項目依賴項并檢查是否存在任何已知的,公開披露的漏洞。目前,已支持Java、.NET、Ruby、Node.js、Python等語言編寫的程序,并為C/C++構(gòu)建系統(tǒng)(autoconf和cmake)提供了有限的支持。而且該工具還是OWASP Top 10的解決方案的一部分。
- Dependency-Check 支持面廣(支持多種語言)、可集成性強,作為一款開源工具,在多年來的發(fā)展中已經(jīng)支持和許多主流的軟件進行集成,比如:命令行、Ant、Maven、Gradle、Jenkins、Sonar等;具備使用方便,落地簡單等優(yōu)勢。
DependencyCheck 實現(xiàn)原理
- 依賴性檢查可用于掃描應(yīng)用程序(及其依賴庫),執(zhí)行檢查時會將 Common Platform Enumeration (CPE)國家漏洞數(shù)據(jù)庫及NPM Public Advisories庫下載到本地,再通過核心引擎中的一系列分析器檢查項目依賴性,收集有關(guān)依賴項的信息。
- 然后根據(jù)收集的依賴項信息與本地的CPE&NPM庫數(shù)據(jù)進行對比,如果檢查發(fā)現(xiàn)掃描的組件存在已知的易受攻擊的漏洞則標識,最后生成報告進行展示。
DependencyCheck 集成
與maven集成
- Dependency-check-maven非常易于使用,可以作為獨立插件使用,也可以作為maven site的一部分使用。
- 該插件需要使用Maven 3.1或更高版本,第一次執(zhí)行時,可能需要20分鐘或更長時間,因為它會從NIST托管的國家漏洞數(shù)據(jù)庫下載漏洞數(shù)據(jù)到本地備份庫。
- 第一次批量下載后,只要插件每七天至少執(zhí)行一次,本地漏洞庫就會自動更新,更新只需幾秒鐘。
- 集成很簡單,只需要在項目的pom文件中增加maven配置即可。
用法一
在target目錄中創(chuàng)建dependency-check-report.html
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>4.0.2</version>
<configuration>
<autoUpdate>true</autoUpdate>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
用法二
在maven site中創(chuàng)建聚合性的報告
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>4.0.2</version>
<reportSets>
<reportSet>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>
用法三
設(shè)置當風險指數(shù)(CVSS)大于等于8時(CVSS分數(shù)為0-10)則項目編譯失敗
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>4.0.2</version>
<configuration>
<failBuildOnCVSS>8</failBuildOnCVSS>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
用法四
僅更新NVD(漏洞庫)數(shù)據(jù),而不執(zhí)行檢查
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>4.0.2</version>
<executions>
<execution>
<goals>
<goal>update-only</goal>
</goals>
</execution>
</executions>
</plugin>
與 Jenkins 集成
Jenkins中需要安裝插件:Static Analysis Utilities 和 Dependency-Check
該插件具有執(zhí)行依賴關(guān)系分析和構(gòu)建后查看檢查結(jié)果的功能。
執(zhí)行依賴分析配置:
查看檢查分析結(jié)果配置:
?文章來源地址http://www.zghlxwxcb.cn/news/detail-774248.html
報告查看
樣本報告demo:https://jeremylong.github.io/DependencyCheck/general/SampleReport.html
?
DependencyCheck 項目信息
Github 項目地址:https://github.com/jeremylong/DependencyCheck
文檔地址:https://jeremylong.github.io/DependencyCheck/
關(guān)于HummerRisk
HummerRisk 是開源的云原生安全平臺,以非侵入的方式解決云原生的安全和治理問題,核心能力包括混合云的安全治理和K8S容器云安全檢測。
文章來源:http://www.zghlxwxcb.cn/news/detail-774248.html
?
到了這里,關(guān)于開源工具系列5:DependencyCheck的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!