mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 08:13:43 +01:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8722eae766 | ||
|
|
53776936ca | ||
|
|
dca465b801 | ||
|
|
43cd115dc7 | ||
|
|
e7ba08e52c | ||
|
|
9df12e6ff2 | ||
|
|
b5c7fb747c | ||
|
|
a40a4afe80 | ||
|
|
d4a6c58cc8 | ||
|
|
d644431a4e | ||
|
|
f4df263dfe | ||
|
|
0b699d45bf | ||
|
|
54beafa262 | ||
|
|
531d4923eb | ||
|
|
b160a4d1dd | ||
|
|
ca54daf456 | ||
|
|
a22fc550b3 | ||
|
|
0650d93953 | ||
|
|
5633258fa7 | ||
|
|
12278cda58 | ||
|
|
84d1f08fda | ||
|
|
c184292a57 | ||
|
|
4cdfcb9f9d | ||
|
|
343a78917c | ||
|
|
ff7d0fdb9d | ||
|
|
db26b46be0 | ||
|
|
d77a70c360 | ||
|
|
42f4ae65d1 | ||
|
|
88daac31d2 | ||
|
|
ac04c173a8 | ||
|
|
8401494fbc | ||
|
|
97af118cb9 | ||
|
|
091e6026bc | ||
|
|
c798ede7bf | ||
|
|
225851f067 | ||
|
|
9dd65ecf70 | ||
|
|
1a9cc4b6be | ||
|
|
a612f206bf | ||
|
|
e51031c62a | ||
|
|
e30c29ef50 | ||
|
|
91ddcadbcd | ||
|
|
8c145860e5 | ||
|
|
a19dd7687e |
@@ -118,4 +118,4 @@ Dependency-Check makes use of several other open source libraries. Please see th
|
|||||||
[wiki]: https://github.com/jeremylong/DependencyCheck/wiki
|
[wiki]: https://github.com/jeremylong/DependencyCheck/wiki
|
||||||
[subscribe]: mailto:dependency-check+subscribe@googlegroups.com
|
[subscribe]: mailto:dependency-check+subscribe@googlegroups.com
|
||||||
[post]: mailto:dependency-check@googlegroups.com
|
[post]: mailto:dependency-check@googlegroups.com
|
||||||
[notices]: https://github.com/jeremylong/DependencyCheck/blob/master/NOTICES.txt
|
[notices]: https://github.com/jeremylong/DependencyCheck/blob/master/NOTICE.txt
|
||||||
|
|||||||
@@ -1,134 +1,25 @@
|
|||||||
Dependency-Check-Gradle
|
Dependency-Check Ant Task
|
||||||
=========
|
=========
|
||||||
|
|
||||||
**Working in progress**
|
Dependency-Check Ant Task can be used to check the project dependencies for published security vulnerabilities. The checks
|
||||||
|
performed are a "best effort" and as such, there could be false positives as well as false negatives. However,
|
||||||
|
vulnerabilities in 3rd party components is a well-known problem and is currently documented in the 2013 OWASP
|
||||||
|
Top 10 as [A9 - Using Components with Known Vulnerabilities](https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities).
|
||||||
|
|
||||||
This is a DependencyCheck gradle plugin designed for project which use Gradle as build script.
|
Documentation and links to production binary releases can be found on the [github pages](http://jeremylong.github.io/DependencyCheck/dependency-check-ant/index.html).
|
||||||
|
|
||||||
Dependency-Check is a utility that attempts to detect publicly disclosed vulnerabilities contained within project dependencies. It does this by determining if there is a Common Platform Enumeration (CPE) identifier for a given dependency. If found, it will generate a report linking to the associated CVE entries.
|
Mailing List
|
||||||
|
------------
|
||||||
|
|
||||||
=========
|
Subscribe: [dependency-check+subscribe@googlegroups.com](mailto:dependency-check+subscribe@googlegroups.com)
|
||||||
|
|
||||||
## What's New
|
Post: [dependency-check@googlegroups.com](mailto:dependency-check@googlegroups.com)
|
||||||
Current latest version is `0.0.8`
|
|
||||||
|
|
||||||
## Usage
|
Copyright & License
|
||||||
|
-------------------
|
||||||
|
|
||||||
### Step 1, Apply dependency check gradle plugin
|
Dependency-Check is Copyright (c) 2012-2014 Jeremy Long. All Rights Reserved.
|
||||||
|
|
||||||
Install from Maven central repo
|
Permission to modify and redistribute is granted under the terms of the Apache 2.0 license. See the [LICENSE.txt](https://raw.githubusercontent.com/jeremylong/DependencyCheck/master/LICENSE.txt) file for the full license.
|
||||||
|
|
||||||
```groovy
|
Dependency-Check-Ant makes use of other open source libraries. Please see the [NOTICE.txt](https://raw.githubusercontent.com/jeremylong/DependencyCheck/master/dependency-check-ant/NOTICE.txt) file for more information.
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'org.owasp:dependency-check-gradle:1.3.2'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'dependency-check-gradle'
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 2, Run gradle task
|
|
||||||
|
|
||||||
Once gradle plugin applied, run following gradle task to check dependencies:
|
|
||||||
|
|
||||||
```
|
|
||||||
gradle dependencyCheck --info
|
|
||||||
```
|
|
||||||
|
|
||||||
The reports will be generated automatically under `./reports` folder.
|
|
||||||
|
|
||||||
If your project includes multiple sub-projects, the report will be generated for each sub-project in different sub-directory.
|
|
||||||
|
|
||||||
## FAQ
|
|
||||||
|
|
||||||
> **Questions List:**
|
|
||||||
> - What if I'm behind a proxy?
|
|
||||||
> - What if my project includes multiple sub-project? How can I use this plugin for each of them including the root project?
|
|
||||||
> - How to customize the report directory?
|
|
||||||
|
|
||||||
### What if I'm behind a proxy?
|
|
||||||
|
|
||||||
Maybe you have to use proxy to access internet, in this case, you could configure proxy settings for this plugin:
|
|
||||||
|
|
||||||
```groovy
|
|
||||||
dependencyCheck {
|
|
||||||
proxy {
|
|
||||||
server = "127.0.0.1" // required, the server name or IP address of the proxy
|
|
||||||
port = 3128 // required, the port number of the proxy
|
|
||||||
|
|
||||||
// optional, the proxy server might require username
|
|
||||||
// username = "username"
|
|
||||||
|
|
||||||
// optional, the proxy server might require password
|
|
||||||
// password = "password"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
In addition, if the proxy only allow HTTP `GET` or `POST` methods, you will find that the update process will always fail,
|
|
||||||
the root cause is that every time you run `dependencyCheck` task, it will try to query the latest timestamp to determine whether need to perform an update action,
|
|
||||||
and for performance reason the HTTP method it uses by default is `HEAD`, which probably is disabled or not supported by the proxy. To avoid this problem, you can simply change the HTTP method by below configuration:
|
|
||||||
|
|
||||||
```groovy
|
|
||||||
dependencyCheck {
|
|
||||||
quickQueryTimestamp = false // when set to false, it means use HTTP GET method to query timestamp. (default value is true)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### What if my project includes multiple sub-project? How can I use this plugin for each of them including the root project?
|
|
||||||
|
|
||||||
Try put 'apply plugin: "dependency-check"' inside the 'allprojects' or 'subprojects' if you'd like to check all sub-projects only, see below:
|
|
||||||
|
|
||||||
(1) For all projects including root project:
|
|
||||||
|
|
||||||
```groovy
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath "gradle.plugin.com.tools.security:dependency-check:0.0.8"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
apply plugin: "dependency-check"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
(2) For all sub-projects:
|
|
||||||
|
|
||||||
```groovy
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath "gradle.plugin.com.tools.security:dependency-check:0.0.8"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subprojects {
|
|
||||||
apply plugin: "dependency-check"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
In this way, the dependency check will be executed for all projects (including root project) or just sub projects.
|
|
||||||
|
|
||||||
### How to customize the report directory?
|
|
||||||
|
|
||||||
By default, all reports will be placed under `./reports` folder, to change the default directory, just modify it in the configuration section like this:
|
|
||||||
|
|
||||||
```groovy
|
|
||||||
subprojects {
|
|
||||||
apply plugin: "dependency-check"
|
|
||||||
|
|
||||||
dependencyCheck {
|
|
||||||
outputDirectory = "./customized-path/security-report"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Copyright (c) 2013 - Jeremy Long. All Rights Reserved.
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.owasp</groupId>
|
<groupId>org.owasp</groupId>
|
||||||
<artifactId>dependency-check-parent</artifactId>
|
<artifactId>dependency-check-parent</artifactId>
|
||||||
<version>1.3.5</version>
|
<version>1.3.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>dependency-check-ant</artifactId>
|
<artifactId>dependency-check-ant</artifactId>
|
||||||
@@ -256,6 +256,7 @@ Copyright (c) 2013 - Jeremy Long. All Rights Reserved.
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||||
<systemProperties>
|
<systemProperties>
|
||||||
<property>
|
<property>
|
||||||
<name>data.directory</name>
|
<name>data.directory</name>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ performed are a "best effort" and as such, there could be false positives as wel
|
|||||||
vulnerabilities in 3rd party components is a well-known problem and is currently documented in the 2013 OWASP
|
vulnerabilities in 3rd party components is a well-known problem and is currently documented in the 2013 OWASP
|
||||||
Top 10 as [A9 - Using Components with Known Vulnerabilities](https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities).
|
Top 10 as [A9 - Using Components with Known Vulnerabilities](https://www.owasp.org/index.php/Top_10_2013-A9-Using_Components_with_Known_Vulnerabilities).
|
||||||
|
|
||||||
Documentation and links to production binary releases can be found on the [github pages](http://jeremylong.github.io/DependencyCheck/dependency-check-cli/installation.html).
|
Documentation and links to production binary releases can be found on the [github pages](http://jeremylong.github.io/DependencyCheck/dependency-check-cli/index.html).
|
||||||
|
|
||||||
Mailing List
|
Mailing List
|
||||||
------------
|
------------
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Copyright (c) 2012 - Jeremy Long. All Rights Reserved.
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.owasp</groupId>
|
<groupId>org.owasp</groupId>
|
||||||
<artifactId>dependency-check-parent</artifactId>
|
<artifactId>dependency-check-parent</artifactId>
|
||||||
<version>1.3.5</version>
|
<version>1.3.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>dependency-check-cli</artifactId>
|
<artifactId>dependency-check-cli</artifactId>
|
||||||
@@ -110,6 +110,7 @@ Copyright (c) 2012 - Jeremy Long. All Rights Reserved.
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||||
<systemProperties>
|
<systemProperties>
|
||||||
<property>
|
<property>
|
||||||
<name>cpe</name>
|
<name>cpe</name>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Copyright (c) 2012 Jeremy Long. All Rights Reserved.
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.owasp</groupId>
|
<groupId>org.owasp</groupId>
|
||||||
<artifactId>dependency-check-parent</artifactId>
|
<artifactId>dependency-check-parent</artifactId>
|
||||||
<version>1.3.5</version>
|
<version>1.3.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>dependency-check-core</artifactId>
|
<artifactId>dependency-check-core</artifactId>
|
||||||
@@ -178,6 +178,7 @@ Copyright (c) 2012 Jeremy Long. All Rights Reserved.
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||||
<systemProperties>
|
<systemProperties>
|
||||||
<property>
|
<property>
|
||||||
<name>data.directory</name>
|
<name>data.directory</name>
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
package org.owasp.dependencycheck.analyzer;
|
package org.owasp.dependencycheck.analyzer;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
|
import org.apache.commons.io.filefilter.NameFileFilter;
|
||||||
import org.owasp.dependencycheck.Engine;
|
import org.owasp.dependencycheck.Engine;
|
||||||
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
||||||
import org.owasp.dependencycheck.dependency.Confidence;
|
import org.owasp.dependencycheck.dependency.Confidence;
|
||||||
@@ -65,6 +67,13 @@ public class FileNameAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
|
||||||
|
// Python init files
|
||||||
|
private static final NameFileFilter IGNORED_FILES = new NameFileFilter(new String[] {
|
||||||
|
"__init__.py",
|
||||||
|
"__init__.pyc",
|
||||||
|
"__init__.pyo"
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects information about the file name.
|
* Collects information about the file name.
|
||||||
*
|
*
|
||||||
@@ -102,7 +111,7 @@ public class FileNameAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
fileName, Confidence.HIGHEST);
|
fileName, Confidence.HIGHEST);
|
||||||
dependency.getVendorEvidence().addEvidence("file", "name",
|
dependency.getVendorEvidence().addEvidence("file", "name",
|
||||||
fileName, Confidence.HIGHEST);
|
fileName, Confidence.HIGHEST);
|
||||||
} else {
|
} else if (!IGNORED_FILES.accept(f)) {
|
||||||
dependency.getProductEvidence().addEvidence("file", "name",
|
dependency.getProductEvidence().addEvidence("file", "name",
|
||||||
fileName, Confidence.HIGH);
|
fileName, Confidence.HIGH);
|
||||||
dependency.getVendorEvidence().addEvidence("file", "name",
|
dependency.getVendorEvidence().addEvidence("file", "name",
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ public class PythonPackageAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
if (found) {
|
if (found) {
|
||||||
dependency.setDisplayFileName(parentName + "/__init__.py");
|
dependency.setDisplayFileName(parentName + "/__init__.py");
|
||||||
dependency.getProductEvidence().addEvidence(file.getName(),
|
dependency.getProductEvidence().addEvidence(file.getName(),
|
||||||
"PackageName", parentName, Confidence.MEDIUM);
|
"PackageName", parentName, Confidence.HIGH);
|
||||||
} else {
|
} else {
|
||||||
// copy, alter and set in case some other thread is iterating over
|
// copy, alter and set in case some other thread is iterating over
|
||||||
final List<Dependency> dependencies = new ArrayList<Dependency>(
|
final List<Dependency> dependencies = new ArrayList<Dependency>(
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class RubyBundleAuditAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
final ProcessBuilder builder = new ProcessBuilder(args);
|
final ProcessBuilder builder = new ProcessBuilder(args);
|
||||||
builder.directory(folder);
|
builder.directory(folder);
|
||||||
try {
|
try {
|
||||||
|
LOGGER.info("Launching: " + args + " from " + folder);
|
||||||
return builder.start();
|
return builder.start();
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
throw new AnalysisException("bundle-audit failure", ioe);
|
throw new AnalysisException("bundle-audit failure", ioe);
|
||||||
@@ -97,7 +98,16 @@ public class RubyBundleAuditAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
@Override
|
@Override
|
||||||
public void initializeFileTypeAnalyzer() throws Exception {
|
public void initializeFileTypeAnalyzer() throws Exception {
|
||||||
// Now, need to see if bundle-audit actually runs from this location.
|
// Now, need to see if bundle-audit actually runs from this location.
|
||||||
Process process = launchBundleAudit(Settings.getTempDirectory());
|
Process process = null;
|
||||||
|
try {
|
||||||
|
process = launchBundleAudit(Settings.getTempDirectory());
|
||||||
|
}
|
||||||
|
catch(AnalysisException ae) {
|
||||||
|
LOGGER.warn("Exception from bundle-audit process: {}. Disabling {}", ae.getCause(), ANALYZER_NAME);
|
||||||
|
setEnabled(false);
|
||||||
|
throw ae;
|
||||||
|
}
|
||||||
|
|
||||||
int exitValue = process.waitFor();
|
int exitValue = process.waitFor();
|
||||||
if (0 == exitValue) {
|
if (0 == exitValue) {
|
||||||
LOGGER.warn("Unexpected exit code from bundle-audit process. Disabling {}: {}", ANALYZER_NAME, exitValue);
|
LOGGER.warn("Unexpected exit code from bundle-audit process. Disabling {}: {}", ANALYZER_NAME, exitValue);
|
||||||
@@ -125,6 +135,7 @@ public class RubyBundleAuditAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
LOGGER.info(ANALYZER_NAME + " is enabled. It is necessary to manually run \"bundle-audit update\" "
|
LOGGER.info(ANALYZER_NAME + " is enabled. It is necessary to manually run \"bundle-audit update\" "
|
||||||
+ "occasionally to keep its database up to date.");
|
+ "occasionally to keep its database up to date.");
|
||||||
@@ -194,6 +205,11 @@ public class RubyBundleAuditAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
}
|
}
|
||||||
BufferedReader rdr = null;
|
BufferedReader rdr = null;
|
||||||
try {
|
try {
|
||||||
|
BufferedReader errReader = new BufferedReader(new InputStreamReader(process.getErrorStream(), "UTF-8"));
|
||||||
|
while(errReader.ready()) {
|
||||||
|
String error = errReader.readLine();
|
||||||
|
LOGGER.warn(error);
|
||||||
|
}
|
||||||
rdr = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8"));
|
rdr = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8"));
|
||||||
processBundlerAuditOutput(dependency, engine, rdr);
|
processBundlerAuditOutput(dependency, engine, rdr);
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ CREATE TABLE cpeEntry (id INT auto_increment PRIMARY KEY, cpe VARCHAR(250), vend
|
|||||||
|
|
||||||
CREATE TABLE software (cveid INT, cpeEntryId INT, previousVersion VARCHAR(50)
|
CREATE TABLE software (cveid INT, cpeEntryId INT, previousVersion VARCHAR(50)
|
||||||
, CONSTRAINT fkSoftwareCve FOREIGN KEY (cveid) REFERENCES vulnerability(id) ON DELETE CASCADE
|
, CONSTRAINT fkSoftwareCve FOREIGN KEY (cveid) REFERENCES vulnerability(id) ON DELETE CASCADE
|
||||||
, CONSTRAINT fkSoftwareCpeProduct FOREIGN KEY (cpeEntryId) REFERENCES cpeEntry(id));
|
, CONSTRAINT fkSoftwareCpeProduct FOREIGN KEY (cpeEntryId) REFERENCES cpeEntry(id)
|
||||||
|
, PRIMARY KEY (cveid, cpeEntryId));
|
||||||
|
|
||||||
CREATE INDEX idxVulnerability ON vulnerability(cve);
|
CREATE INDEX idxVulnerability ON vulnerability(cve);
|
||||||
CREATE INDEX idxReference ON reference(cveid);
|
CREATE INDEX idxReference ON reference(cveid);
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ FOR EACH ROW
|
|||||||
BEGIN
|
BEGIN
|
||||||
:new.ID := VULNERABILITY_SEQ.nextval;
|
:new.ID := VULNERABILITY_SEQ.nextval;
|
||||||
END VULNERABILITY_TRG;
|
END VULNERABILITY_TRG;
|
||||||
|
/
|
||||||
|
|
||||||
CREATE OR REPLACE TRIGGER CPEENTRY_TRG
|
CREATE OR REPLACE TRIGGER CPEENTRY_TRG
|
||||||
BEFORE INSERT
|
BEFORE INSERT
|
||||||
@@ -106,4 +107,6 @@ FOR EACH ROW
|
|||||||
BEGIN
|
BEGIN
|
||||||
:new.ID := CPEENTRY_SEQ.nextval;
|
:new.ID := CPEENTRY_SEQ.nextval;
|
||||||
END CPEENTRY_TRG;
|
END CPEENTRY_TRG;
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO properties(id,value) VALUES ('version','3.0');
|
||||||
|
|||||||
@@ -298,6 +298,13 @@
|
|||||||
<gav regex="true">io\.dropwizard\.metrics:metrics-httpclient:.*</gav>
|
<gav regex="true">io\.dropwizard\.metrics:metrics-httpclient:.*</gav>
|
||||||
<cpe>cpe:/a:apache:httpclient</cpe>
|
<cpe>cpe:/a:apache:httpclient</cpe>
|
||||||
</suppress>
|
</suppress>
|
||||||
|
<suppress base="true">
|
||||||
|
<notes><![CDATA[
|
||||||
|
javax.transaction false positives
|
||||||
|
]]></notes>
|
||||||
|
<gav regex="true">javax\.transaction:javax\.transaction-api:.*</gav>
|
||||||
|
<cpe>cpe:/a:oracle:glassfish</cpe>
|
||||||
|
</suppress>
|
||||||
<suppress base="true">
|
<suppress base="true">
|
||||||
<notes><![CDATA[
|
<notes><![CDATA[
|
||||||
false positive in drop wizard
|
false positive in drop wizard
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
<xs:simpleType name="cveType">
|
<xs:simpleType name="cveType">
|
||||||
<xs:restriction base="xs:string">
|
<xs:restriction base="xs:string">
|
||||||
<xs:pattern value="(\w+\-)?CVE\-\d\d\d\d\-\d+"/>
|
<xs:pattern value="((\w+\-)?CVE\-\d\d\d\d\-\d+|\d+)"/>
|
||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
<xs:simpleType name="sha1Type">
|
<xs:simpleType name="sha1Type">
|
||||||
|
|||||||
@@ -17,6 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.owasp.dependencycheck.analyzer;
|
package org.owasp.dependencycheck.analyzer;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
import static org.junit.Assert.assertThat;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Assume;
|
import org.junit.Assume;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@@ -26,15 +32,10 @@ import org.owasp.dependencycheck.Engine;
|
|||||||
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
||||||
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
|
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
|
||||||
import org.owasp.dependencycheck.dependency.Dependency;
|
import org.owasp.dependencycheck.dependency.Dependency;
|
||||||
|
import org.owasp.dependencycheck.utils.Settings;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.is;
|
|
||||||
import static org.hamcrest.CoreMatchers.not;
|
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for {@link RubyBundleAuditAnalyzer}.
|
* Unit tests for {@link RubyBundleAuditAnalyzer}.
|
||||||
*
|
*
|
||||||
@@ -56,14 +57,9 @@ public class RubyBundleAuditAnalyzerTest extends BaseTest {
|
|||||||
*/
|
*/
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
try {
|
Settings.initialize();
|
||||||
analyzer = new RubyBundleAuditAnalyzer();
|
analyzer = new RubyBundleAuditAnalyzer();
|
||||||
analyzer.setFilesMatched(true);
|
analyzer.setFilesMatched(true);
|
||||||
analyzer.initialize();
|
|
||||||
} catch (Exception e) {
|
|
||||||
//LOGGER.warn("Exception setting up RubyBundleAuditAnalyzer. Tests will be incomplete", e);
|
|
||||||
Assume.assumeNoException("Exception setting up RubyBundleAuditAnalyzer; bundle audit may not be installed. Tests will be incomplete", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,6 +69,7 @@ public class RubyBundleAuditAnalyzerTest extends BaseTest {
|
|||||||
*/
|
*/
|
||||||
@After
|
@After
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
|
Settings.cleanup();
|
||||||
analyzer.close();
|
analyzer.close();
|
||||||
analyzer = null;
|
analyzer = null;
|
||||||
}
|
}
|
||||||
@@ -100,10 +97,44 @@ public class RubyBundleAuditAnalyzerTest extends BaseTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testAnalysis() throws AnalysisException, DatabaseException {
|
public void testAnalysis() throws AnalysisException, DatabaseException {
|
||||||
final Dependency result = new Dependency(BaseTest.getResourceAsFile(this,
|
try {
|
||||||
"ruby/vulnerable/Gemfile.lock"));
|
analyzer.initialize();
|
||||||
final Engine engine = new Engine();
|
|
||||||
analyzer.analyze(result, engine);
|
final Dependency result = new Dependency(BaseTest.getResourceAsFile(this,
|
||||||
assertThat(engine.getDependencies().size(), is(not(0)));
|
"ruby/vulnerable/gems/rails-4.1.15/Gemfile.lock"));
|
||||||
|
final Engine engine = new Engine();
|
||||||
|
analyzer.analyze(result, engine);
|
||||||
|
int size = engine.getDependencies().size();
|
||||||
|
assertThat(size, is(1));
|
||||||
|
|
||||||
|
Dependency dependency = engine.getDependencies().get(0);
|
||||||
|
assertTrue(dependency.getProductEvidence().toString().toLowerCase().contains("redcarpet"));
|
||||||
|
assertTrue(dependency.getVersionEvidence().toString().toLowerCase().contains("2.2.2"));
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOGGER.warn("Exception setting up RubyBundleAuditAnalyzer. Make sure Ruby gem bundle-audit is installed. You may also need to set property \"analyzer.bundle.audit.path\".", e);
|
||||||
|
Assume.assumeNoException("Exception setting up RubyBundleAuditAnalyzer; bundle audit may not be installed, or property \"analyzer.bundle.audit.path\" may not be set.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test when Ruby bundle-audit is not available on the system.
|
||||||
|
*
|
||||||
|
* @throws AnalysisException is thrown when an exception occurs.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testMissingBundleAudit() throws AnalysisException, DatabaseException {
|
||||||
|
//set a non-exist bundle-audit
|
||||||
|
Settings.setString(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_PATH, "phantom-bundle-audit");
|
||||||
|
try {
|
||||||
|
//initialize should fail.
|
||||||
|
analyzer.initialize();
|
||||||
|
} catch (Exception e) {
|
||||||
|
//expected, so ignore.
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
assertThat(analyzer.isEnabled(), is(false));
|
||||||
|
LOGGER.info("phantom-bundle-audit is not available. Ruby Bundle Audit Analyzer is disabled as expected.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,3 +100,5 @@ analyzer.nexus.enabled=false
|
|||||||
#whether the nexus analyzer uses the proxy
|
#whether the nexus analyzer uses the proxy
|
||||||
analyzer.nexus.proxy=true
|
analyzer.nexus.proxy=true
|
||||||
|
|
||||||
|
#Use your own bundle-audit install directory.
|
||||||
|
#analyzer.bundle.audit.path=/usr/local/bin/bundle-audit
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
gemspec
|
||||||
|
|
||||||
|
# This needs to be with require false as it is
|
||||||
|
# loaded after loading the test library to
|
||||||
|
# ensure correct loading order
|
||||||
|
gem 'mocha', '~> 0.14', require: false
|
||||||
|
|
||||||
|
gem 'rack-cache', '~> 1.2'
|
||||||
|
gem 'jquery-rails', '~> 3.1.0'
|
||||||
|
gem 'turbolinks'
|
||||||
|
gem 'coffee-rails', '~> 4.0.0'
|
||||||
|
|
||||||
|
gem 'sprockets', '~> 3.0.0.rc.1'
|
||||||
|
|
||||||
|
# require: false so bcrypt is loaded only when has_secure_password is used.
|
||||||
|
# This is to avoid ActiveModel (and by extension the entire framework)
|
||||||
|
# being dependent on a binary library.
|
||||||
|
gem 'bcrypt', '~> 3.1.7', require: false
|
||||||
|
|
||||||
|
# This needs to be with require false to avoid
|
||||||
|
# it being automatically loaded by sprockets
|
||||||
|
gem 'uglifier', '>= 1.3.0', require: false
|
||||||
|
|
||||||
|
group :doc do
|
||||||
|
gem 'sdoc', '~> 0.4.0'
|
||||||
|
gem 'redcarpet', '~> 2.2.2', platforms: :ruby
|
||||||
|
gem 'w3c_validators'
|
||||||
|
gem 'kindlerb', '0.1.1'
|
||||||
|
gem 'mustache', '~> 0.99.8'
|
||||||
|
end
|
||||||
|
|
||||||
|
# AS
|
||||||
|
gem 'dalli', '>= 2.2.1'
|
||||||
|
|
||||||
|
# Add your own local bundler stuff
|
||||||
|
local_gemfile = File.dirname(__FILE__) + "/.Gemfile"
|
||||||
|
instance_eval File.read local_gemfile if File.exist? local_gemfile
|
||||||
|
|
||||||
|
group :test do
|
||||||
|
# FIX: Our test suite isn't ready to run in random order yet
|
||||||
|
gem 'minitest', '< 5.3.4'
|
||||||
|
|
||||||
|
platforms :mri_19 do
|
||||||
|
gem 'ruby-prof', '~> 0.11.2'
|
||||||
|
end
|
||||||
|
|
||||||
|
# platforms :mri_19, :mri_20 do
|
||||||
|
# gem 'debugger'
|
||||||
|
# end
|
||||||
|
|
||||||
|
platforms :mri do
|
||||||
|
gem 'stackprof'
|
||||||
|
end
|
||||||
|
|
||||||
|
gem 'benchmark-ips'
|
||||||
|
end
|
||||||
|
|
||||||
|
platforms :ruby do
|
||||||
|
gem 'nokogiri', '>= 1.4.5'
|
||||||
|
|
||||||
|
# Needed for compiling the ActionDispatch::Journey parser
|
||||||
|
gem 'racc', '>=1.4.6', require: false
|
||||||
|
|
||||||
|
# AR
|
||||||
|
gem 'sqlite3', '~> 1.3.6'
|
||||||
|
|
||||||
|
group :db do
|
||||||
|
gem 'pg', '>= 0.11.0'
|
||||||
|
gem 'mysql', '>= 2.9.0'
|
||||||
|
gem 'mysql2', '>= 0.3.13', '< 0.4'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
platforms :jruby do
|
||||||
|
gem 'json'
|
||||||
|
if ENV['AR_JDBC']
|
||||||
|
gem 'activerecord-jdbcsqlite3-adapter', github: 'jruby/activerecord-jdbc-adapter', branch: 'master'
|
||||||
|
group :db do
|
||||||
|
gem 'activerecord-jdbcmysql-adapter', github: 'jruby/activerecord-jdbc-adapter', branch: 'master'
|
||||||
|
gem 'activerecord-jdbcpostgresql-adapter', github: 'jruby/activerecord-jdbc-adapter', branch: 'master'
|
||||||
|
end
|
||||||
|
else
|
||||||
|
gem 'activerecord-jdbcsqlite3-adapter', '>= 1.3.0'
|
||||||
|
group :db do
|
||||||
|
gem 'activerecord-jdbcmysql-adapter', '>= 1.3.0'
|
||||||
|
gem 'activerecord-jdbcpostgresql-adapter', '>= 1.3.0'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# gems that are necessary for ActiveRecord tests with Oracle database
|
||||||
|
if ENV['ORACLE_ENHANCED']
|
||||||
|
platforms :ruby do
|
||||||
|
gem 'ruby-oci8', '>= 2.0.4'
|
||||||
|
end
|
||||||
|
gem 'activerecord-oracle_enhanced-adapter', github: 'rsim/oracle-enhanced', branch: 'master'
|
||||||
|
end
|
||||||
|
|
||||||
|
# A gem necessary for ActiveRecord tests with IBM DB
|
||||||
|
gem 'ibm_db' if ENV['IBM_DB']
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
PATH
|
||||||
|
remote: .
|
||||||
|
specs:
|
||||||
|
actionmailer (4.1.15)
|
||||||
|
actionpack (= 4.1.15)
|
||||||
|
actionview (= 4.1.15)
|
||||||
|
mail (~> 2.5, >= 2.5.4)
|
||||||
|
actionpack (4.1.15)
|
||||||
|
actionview (= 4.1.15)
|
||||||
|
activesupport (= 4.1.15)
|
||||||
|
rack (~> 1.5.2)
|
||||||
|
rack-test (~> 0.6.2)
|
||||||
|
actionview (4.1.15)
|
||||||
|
activesupport (= 4.1.15)
|
||||||
|
builder (~> 3.1)
|
||||||
|
erubis (~> 2.7.0)
|
||||||
|
activemodel (4.1.15)
|
||||||
|
activesupport (= 4.1.15)
|
||||||
|
builder (~> 3.1)
|
||||||
|
activerecord (4.1.15)
|
||||||
|
activemodel (= 4.1.15)
|
||||||
|
activesupport (= 4.1.15)
|
||||||
|
arel (~> 5.0.0)
|
||||||
|
activesupport (4.1.15)
|
||||||
|
i18n (~> 0.6, >= 0.6.9)
|
||||||
|
json (~> 1.7, >= 1.7.7)
|
||||||
|
minitest (~> 5.1)
|
||||||
|
thread_safe (~> 0.1)
|
||||||
|
tzinfo (~> 1.1)
|
||||||
|
rails (4.1.15)
|
||||||
|
actionmailer (= 4.1.15)
|
||||||
|
actionpack (= 4.1.15)
|
||||||
|
actionview (= 4.1.15)
|
||||||
|
activemodel (= 4.1.15)
|
||||||
|
activerecord (= 4.1.15)
|
||||||
|
activesupport (= 4.1.15)
|
||||||
|
bundler (>= 1.3.0, < 2.0)
|
||||||
|
railties (= 4.1.15)
|
||||||
|
sprockets-rails (~> 2.0)
|
||||||
|
railties (4.1.15)
|
||||||
|
actionpack (= 4.1.15)
|
||||||
|
activesupport (= 4.1.15)
|
||||||
|
rake (>= 0.8.7)
|
||||||
|
thor (>= 0.18.1, < 2.0)
|
||||||
|
|
||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
arel (5.0.1.20140414130214)
|
||||||
|
bcrypt (3.1.10)
|
||||||
|
benchmark-ips (2.3.0)
|
||||||
|
builder (3.2.2)
|
||||||
|
coffee-rails (4.0.1)
|
||||||
|
coffee-script (>= 2.2.0)
|
||||||
|
railties (>= 4.0.0, < 5.0)
|
||||||
|
coffee-script (2.4.1)
|
||||||
|
coffee-script-source
|
||||||
|
execjs
|
||||||
|
coffee-script-source (1.10.0)
|
||||||
|
dalli (2.7.5)
|
||||||
|
erubis (2.7.0)
|
||||||
|
execjs (2.6.0)
|
||||||
|
i18n (0.7.0)
|
||||||
|
jquery-rails (3.1.4)
|
||||||
|
railties (>= 3.0, < 5.0)
|
||||||
|
thor (>= 0.14, < 2.0)
|
||||||
|
json (1.8.3)
|
||||||
|
kindlerb (0.1.1)
|
||||||
|
mustache
|
||||||
|
nokogiri
|
||||||
|
mail (2.6.3)
|
||||||
|
mime-types (>= 1.16, < 3)
|
||||||
|
metaclass (0.0.4)
|
||||||
|
mime-types (2.99.1)
|
||||||
|
mini_portile2 (2.0.0)
|
||||||
|
minitest (5.3.3)
|
||||||
|
mocha (0.14.0)
|
||||||
|
metaclass (~> 0.0.1)
|
||||||
|
mustache (0.99.8)
|
||||||
|
mysql (2.9.1)
|
||||||
|
mysql2 (0.3.20)
|
||||||
|
nokogiri (1.6.7.2)
|
||||||
|
mini_portile2 (~> 2.0.0.rc2)
|
||||||
|
pg (0.18.4)
|
||||||
|
racc (1.4.14)
|
||||||
|
rack (1.5.5)
|
||||||
|
rack-cache (1.5.1)
|
||||||
|
rack (>= 0.4)
|
||||||
|
rack-test (0.6.3)
|
||||||
|
rack (>= 1.0)
|
||||||
|
rake (10.5.0)
|
||||||
|
rdoc (4.2.1)
|
||||||
|
redcarpet (2.2.2)
|
||||||
|
ruby-prof (0.11.3)
|
||||||
|
sdoc (0.4.1)
|
||||||
|
json (~> 1.7, >= 1.7.7)
|
||||||
|
rdoc (~> 4.0)
|
||||||
|
sprockets (3.0.3)
|
||||||
|
rack (~> 1.0)
|
||||||
|
sprockets-rails (2.3.3)
|
||||||
|
actionpack (>= 3.0)
|
||||||
|
activesupport (>= 3.0)
|
||||||
|
sprockets (>= 2.8, < 4.0)
|
||||||
|
sqlite3 (1.3.11)
|
||||||
|
stackprof (0.2.8)
|
||||||
|
thor (0.19.1)
|
||||||
|
thread_safe (0.3.5)
|
||||||
|
turbolinks (2.5.3)
|
||||||
|
coffee-rails
|
||||||
|
tzinfo (1.2.2)
|
||||||
|
thread_safe (~> 0.1)
|
||||||
|
uglifier (2.7.2)
|
||||||
|
execjs (>= 0.3.0)
|
||||||
|
json (>= 1.8.0)
|
||||||
|
w3c_validators (1.2)
|
||||||
|
json
|
||||||
|
nokogiri
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
activerecord-jdbcmysql-adapter (>= 1.3.0)
|
||||||
|
activerecord-jdbcpostgresql-adapter (>= 1.3.0)
|
||||||
|
activerecord-jdbcsqlite3-adapter (>= 1.3.0)
|
||||||
|
bcrypt (~> 3.1.7)
|
||||||
|
benchmark-ips
|
||||||
|
coffee-rails (~> 4.0.0)
|
||||||
|
dalli (>= 2.2.1)
|
||||||
|
jquery-rails (~> 3.1.0)
|
||||||
|
json
|
||||||
|
kindlerb (= 0.1.1)
|
||||||
|
minitest (< 5.3.4)
|
||||||
|
mocha (~> 0.14)
|
||||||
|
mustache (~> 0.99.8)
|
||||||
|
mysql (>= 2.9.0)
|
||||||
|
mysql2 (>= 0.3.13, < 0.4)
|
||||||
|
nokogiri (>= 1.4.5)
|
||||||
|
pg (>= 0.11.0)
|
||||||
|
racc (>= 1.4.6)
|
||||||
|
rack-cache (~> 1.2)
|
||||||
|
rails!
|
||||||
|
redcarpet (~> 2.2.2)
|
||||||
|
ruby-prof (~> 0.11.2)
|
||||||
|
sdoc (~> 0.4.0)
|
||||||
|
sprockets (~> 3.0.0.rc.1)
|
||||||
|
sqlite3 (~> 1.3.6)
|
||||||
|
stackprof
|
||||||
|
turbolinks
|
||||||
|
uglifier (>= 1.3.0)
|
||||||
|
w3c_validators
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.11.2
|
||||||
@@ -20,12 +20,11 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.owasp</groupId>
|
<groupId>org.owasp</groupId>
|
||||||
<artifactId>dependency-check-parent</artifactId>
|
<artifactId>dependency-check-parent</artifactId>
|
||||||
<version>1.3.5</version>
|
<version>1.3.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>dependency-check-maven</artifactId>
|
<artifactId>dependency-check-maven</artifactId>
|
||||||
<packaging>maven-plugin</packaging>
|
<packaging>maven-plugin</packaging>
|
||||||
|
|
||||||
<name>Dependency-Check Maven Plugin</name>
|
<name>Dependency-Check Maven Plugin</name>
|
||||||
<description>dependency-check-maven is a Maven Plugin that uses dependency-check-core to detect publicly disclosed vulnerabilities associated with the project's dependencies. The plugin will generate a report listing the dependency, any identified Common Platform Enumeration (CPE) identifiers, and the associated Common Vulnerability and Exposure (CVE) entries.</description>
|
<description>dependency-check-maven is a Maven Plugin that uses dependency-check-core to detect publicly disclosed vulnerabilities associated with the project's dependencies. The plugin will generate a report listing the dependency, any identified Common Platform Enumeration (CPE) identifiers, and the associated Common Vulnerability and Exposure (CVE) entries.</description>
|
||||||
<inceptionYear>2013</inceptionYear>
|
<inceptionYear>2013</inceptionYear>
|
||||||
@@ -88,6 +87,7 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||||
<systemProperties>
|
<systemProperties>
|
||||||
<property>
|
<property>
|
||||||
<name>data.directory</name>
|
<name>data.directory</name>
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class AggregateMojo extends BaseDependencyCheckMojo {
|
|||||||
/**
|
/**
|
||||||
* Gets the last project in the reactor - taking into account skipped projects.
|
* Gets the last project in the reactor - taking into account skipped projects.
|
||||||
*
|
*
|
||||||
* @return the last projecct in the reactor
|
* @return the last project in the reactor
|
||||||
*/
|
*/
|
||||||
private MavenProject getLastProject() {
|
private MavenProject getLastProject() {
|
||||||
for (int x = getReactorProjects().size() - 1; x >= 0; x--) {
|
for (int x = getReactorProjects().size() - 1; x >= 0; x--) {
|
||||||
@@ -149,7 +149,7 @@ public class AggregateMojo extends BaseDependencyCheckMojo {
|
|||||||
*/
|
*/
|
||||||
private boolean skipProject(MavenProject project) {
|
private boolean skipProject(MavenProject project) {
|
||||||
final String skip = (String) project.getProperties().get("maven.site.skip");
|
final String skip = (String) project.getProperties().get("maven.site.skip");
|
||||||
return "true".equalsIgnoreCase(skip);
|
return "true".equalsIgnoreCase(skip) && isGeneratingSite();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -387,6 +387,7 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute() throws MojoExecutionException, MojoFailureException {
|
public void execute() throws MojoExecutionException, MojoFailureException {
|
||||||
|
generatingSite = false;
|
||||||
if (skip) {
|
if (skip) {
|
||||||
getLog().info("Skipping " + getName(Locale.US));
|
getLog().info("Skipping " + getName(Locale.US));
|
||||||
} else {
|
} else {
|
||||||
@@ -424,6 +425,20 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
|
|||||||
generate((Sink) sink, locale);
|
generate((Sink) sink, locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A flag indicating whether or not the maven site is being generated.
|
||||||
|
*/
|
||||||
|
private boolean generatingSite = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the Maven site is being generated.
|
||||||
|
*
|
||||||
|
* @return true if the Maven site is being generated
|
||||||
|
*/
|
||||||
|
protected boolean isGeneratingSite() {
|
||||||
|
return generatingSite;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the Dependency-Check Site Report.
|
* Generates the Dependency-Check Site Report.
|
||||||
*
|
*
|
||||||
@@ -432,6 +447,7 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
|
|||||||
* @throws MavenReportException if a maven report exception occurs
|
* @throws MavenReportException if a maven report exception occurs
|
||||||
*/
|
*/
|
||||||
public void generate(Sink sink, Locale locale) throws MavenReportException {
|
public void generate(Sink sink, Locale locale) throws MavenReportException {
|
||||||
|
generatingSite = true;
|
||||||
try {
|
try {
|
||||||
validateAggregate();
|
validateAggregate();
|
||||||
} catch (MojoExecutionException ex) {
|
} catch (MojoExecutionException ex) {
|
||||||
@@ -1054,7 +1070,8 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
|
|||||||
"org.owasp.dependencycheck.dependency.Reference",
|
"org.owasp.dependencycheck.dependency.Reference",
|
||||||
"org.owasp.dependencycheck.dependency.Vulnerability",
|
"org.owasp.dependencycheck.dependency.Vulnerability",
|
||||||
"org.owasp.dependencycheck.dependency.VulnerabilityComparator",
|
"org.owasp.dependencycheck.dependency.VulnerabilityComparator",
|
||||||
"org.owasp.dependencycheck.dependency.VulnerableSoftware");
|
"org.owasp.dependencycheck.dependency.VulnerableSoftware",
|
||||||
|
"org.owasp.dependencycheck.data.cpe.IndexEntry");
|
||||||
ret = (List<Dependency>) ois.readObject();
|
ret = (List<Dependency>) ois.readObject();
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
//TODO fix logging
|
//TODO fix logging
|
||||||
|
|||||||
@@ -156,8 +156,8 @@ Create the DependencyCheck-report.html and use internal mirroring of CVE content
|
|||||||
<artifactId>dependency-check-maven</artifactId>
|
<artifactId>dependency-check-maven</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<cveUrl12Modified>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-modified.xml</cveUrl12Modified>
|
<cveUrl12Modified>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-Modified.xml.gz</cveUrl12Modified>
|
||||||
<cveUrl20Modified>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-2.0-modified.xml</cveUrl20Modified>
|
<cveUrl20Modified>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-2.0-Modified.xml.gz</cveUrl20Modified>
|
||||||
<cveUrl12Base>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-%d.xml</cveUrl12Base>
|
<cveUrl12Base>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-%d.xml</cveUrl12Base>
|
||||||
<cveUrl20Base>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-2.0-%d.xml</cveUrl20Base>
|
<cveUrl20Base>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-2.0-%d.xml</cveUrl20Base>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Copyright (c) 2014 - Jeremy Long. All Rights Reserved.
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.owasp</groupId>
|
<groupId>org.owasp</groupId>
|
||||||
<artifactId>dependency-check-parent</artifactId>
|
<artifactId>dependency-check-parent</artifactId>
|
||||||
<version>1.3.5</version>
|
<version>1.3.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>dependency-check-utils</artifactId>
|
<artifactId>dependency-check-utils</artifactId>
|
||||||
@@ -77,6 +77,7 @@ Copyright (c) 2014 - Jeremy Long. All Rights Reserved.
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||||
<systemProperties>
|
<systemProperties>
|
||||||
<property>
|
<property>
|
||||||
<name>data.directory</name>
|
<name>data.directory</name>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class ExpectedOjectInputStream extends ObjectInputStream {
|
|||||||
@Override
|
@Override
|
||||||
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
|
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
|
||||||
if (!this.expected.contains(desc.getName())) {
|
if (!this.expected.contains(desc.getName())) {
|
||||||
throw new InvalidClassException("Unexpected deserialization", desc.getName());
|
throw new InvalidClassException("Unexpected deserialization ", desc.getName());
|
||||||
}
|
}
|
||||||
return super.resolveClass(desc);
|
return super.resolveClass(desc);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -743,7 +743,9 @@ public final class Settings {
|
|||||||
try {
|
try {
|
||||||
value = Integer.parseInt(Settings.getString(key));
|
value = Integer.parseInt(Settings.getString(key));
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
LOGGER.trace("Could not convert property '{}' to an int.", key, ex);
|
if (!Settings.getString(key, "").isEmpty()) {
|
||||||
|
LOGGER.debug("Could not convert property '{}={}' to an int; using {} instead.", key, Settings.getString(key), defaultValue);
|
||||||
|
}
|
||||||
value = defaultValue;
|
value = defaultValue;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -139,6 +139,18 @@ public class SettingsTest extends BaseTest {
|
|||||||
Assert.assertEquals(expResult, result);
|
Assert.assertEquals(expResult, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test of getInt method, of class Settings.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testGetIntDefault() throws InvalidSettingException {
|
||||||
|
String key = "SomeKey";
|
||||||
|
int expResult = 85;
|
||||||
|
Settings.setString(key, "blue");
|
||||||
|
int result = Settings.getInt(key, expResult);
|
||||||
|
Assert.assertEquals(expResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test of getLong method, of class Settings.
|
* Test of getLong method, of class Settings.
|
||||||
*/
|
*/
|
||||||
|
|||||||
23
pom.xml
23
pom.xml
@@ -20,7 +20,7 @@ Copyright (c) 2012 - Jeremy Long
|
|||||||
|
|
||||||
<groupId>org.owasp</groupId>
|
<groupId>org.owasp</groupId>
|
||||||
<artifactId>dependency-check-parent</artifactId>
|
<artifactId>dependency-check-parent</artifactId>
|
||||||
<version>1.3.5</version>
|
<version>1.3.6</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
@@ -125,8 +125,8 @@ Copyright (c) 2012 - Jeremy Long
|
|||||||
<!-- new versions of lucene are compiled with JDK 1.7 and cannot be used ubiquitously in Jenkins
|
<!-- new versions of lucene are compiled with JDK 1.7 and cannot be used ubiquitously in Jenkins
|
||||||
thus, we cannot upgrade beyond 4.7.2 -->
|
thus, we cannot upgrade beyond 4.7.2 -->
|
||||||
<apache.lucene.version>4.7.2</apache.lucene.version>
|
<apache.lucene.version>4.7.2</apache.lucene.version>
|
||||||
<slf4j.version>1.7.16</slf4j.version>
|
<slf4j.version>1.7.21</slf4j.version>
|
||||||
<logback.version>1.1.5</logback.version>
|
<logback.version>1.1.7</logback.version>
|
||||||
<reporting.checkstyle-plugin.version>2.17</reporting.checkstyle-plugin.version>
|
<reporting.checkstyle-plugin.version>2.17</reporting.checkstyle-plugin.version>
|
||||||
<reporting.cobertura-plugin.version>2.7</reporting.cobertura-plugin.version>
|
<reporting.cobertura-plugin.version>2.7</reporting.cobertura-plugin.version>
|
||||||
<reporting.pmd-plugin.version>3.6</reporting.pmd-plugin.version>
|
<reporting.pmd-plugin.version>3.6</reporting.pmd-plugin.version>
|
||||||
@@ -445,7 +445,7 @@ Copyright (c) 2012 - Jeremy Long
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
<version>2.8.1</version>
|
<version>2.9</version>
|
||||||
<reportSets>
|
<reportSets>
|
||||||
<reportSet>
|
<reportSet>
|
||||||
<reports>
|
<reports>
|
||||||
@@ -589,7 +589,7 @@ Copyright (c) 2012 - Jeremy Long
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-compress</artifactId>
|
<artifactId>commons-compress</artifactId>
|
||||||
<version>1.10</version>
|
<version>1.11</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ant</groupId>
|
<groupId>org.apache.ant</groupId>
|
||||||
@@ -636,11 +636,6 @@ Copyright (c) 2012 - Jeremy Long
|
|||||||
<artifactId>maven-settings</artifactId>
|
<artifactId>maven-settings</artifactId>
|
||||||
<version>3.3.3</version>
|
<version>3.3.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
|
||||||
<version>3.4</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven.plugin-testing</groupId>
|
<groupId>org.apache.maven.plugin-testing</groupId>
|
||||||
<artifactId>maven-plugin-testing-harness</artifactId>
|
<artifactId>maven-plugin-testing-harness</artifactId>
|
||||||
@@ -656,6 +651,12 @@ Copyright (c) 2012 - Jeremy Long
|
|||||||
<artifactId>maven-reporting-api</artifactId>
|
<artifactId>maven-reporting-api</artifactId>
|
||||||
<version>3.0</version>
|
<version>3.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- Upgrading transitive commons-collections-3.2.1 from velocity-1.7. -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-collections</groupId>
|
||||||
|
<artifactId>commons-collections</artifactId>
|
||||||
|
<version>3.2.2</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.velocity</groupId>
|
<groupId>org.apache.velocity</groupId>
|
||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity</artifactId>
|
||||||
@@ -680,7 +681,7 @@ Copyright (c) 2012 - Jeremy Long
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jmockit</groupId>
|
<groupId>org.jmockit</groupId>
|
||||||
<artifactId>jmockit</artifactId>
|
<artifactId>jmockit</artifactId>
|
||||||
<version>1.21</version>
|
<version>1.22</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Tasks
|
|||||||
Task | Description
|
Task | Description
|
||||||
----------------------------------------------------|-----------------------
|
----------------------------------------------------|-----------------------
|
||||||
[dependencyCheck](configuration.html) | Runs dependency-check against the project and generates a report.
|
[dependencyCheck](configuration.html) | Runs dependency-check against the project and generates a report.
|
||||||
[dependencyCheckUpdate]](configuration-update.html) | Updates the local cache of the NVD data from NIST.
|
[dependencyCheckUpdate](configuration-update.html) | Updates the local cache of the NVD data from NIST.
|
||||||
dependencyCheckPurge | Deletes the local copy of the NVD. This is used to force a refresh of the data.
|
dependencyCheckPurge | Deletes the local copy of the NVD. This is used to force a refresh of the data.
|
||||||
|
|
||||||
Configuration: dependencyCheckPurge
|
Configuration: dependencyCheckPurge
|
||||||
@@ -24,7 +24,7 @@ Config Group | Property | Description
|
|||||||
-------------|-------------------|---------------------------------------------------------------------------------------------|------------------
|
-------------|-------------------|---------------------------------------------------------------------------------------------|------------------
|
||||||
data | directory | Sets the data directory to hold SQL CVEs contents. This should generally not be changed. |
|
data | directory | Sets the data directory to hold SQL CVEs contents. This should generally not be changed. |
|
||||||
|
|
||||||
$H$H$H$H Example
|
#### Example
|
||||||
```groovy
|
```groovy
|
||||||
dependencyCheckPurge {
|
dependencyCheckPurge {
|
||||||
data {
|
data {
|
||||||
|
|||||||
Reference in New Issue
Block a user