mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 00:03:43 +01:00
Merge branch 'hgschmie-additional_analyzers'
This commit is contained in:
@@ -568,6 +568,102 @@ public class Check extends Update {
|
||||
public void setCMakeAnalyzerEnabled(Boolean cmakeAnalyzerEnabled) {
|
||||
this.cmakeAnalyzerEnabled = cmakeAnalyzerEnabled;
|
||||
}
|
||||
|
||||
//start changes
|
||||
/**
|
||||
* Whether or not the Ruby Bundle Audit Analyzer is enabled.
|
||||
*/
|
||||
private Boolean bundleAuditAnalyzerEnabled;
|
||||
|
||||
/**
|
||||
* Returns if the Bundle Audit Analyzer is enabled.
|
||||
*
|
||||
* @return if the Bundle Audit Analyzer is enabled.
|
||||
*/
|
||||
public Boolean isBundleAuditAnalyzerEnabled() {
|
||||
return bundleAuditAnalyzerEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if the Bundle Audit Analyzer is enabled.
|
||||
*
|
||||
* @param bundleAuditAnalyzerEnabled whether or not the analyzer should be
|
||||
* enabled
|
||||
*/
|
||||
public void setBundleAuditAnalyzerEnabled(Boolean bundleAuditAnalyzerEnabled) {
|
||||
this.bundleAuditAnalyzerEnabled = bundleAuditAnalyzerEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the path for the bundle-audit binary.
|
||||
*/
|
||||
private String bundleAuditPath;
|
||||
|
||||
/**
|
||||
* Returns the path to the bundle audit executable.
|
||||
*
|
||||
* @return the path to the bundle audit executable
|
||||
*/
|
||||
public String getBundleAuditPath() {
|
||||
return bundleAuditPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the path to the bundle audit executable.
|
||||
*
|
||||
* @param bundleAuditPath the path to the bundle audit executable
|
||||
*/
|
||||
public void setBundleAuditPath(String bundleAuditPath) {
|
||||
this.bundleAuditPath = bundleAuditPath;
|
||||
}
|
||||
/**
|
||||
* Whether or not the CocoaPods Analyzer is enabled.
|
||||
*/
|
||||
private Boolean cocoapodsAnalyzerEnabled;
|
||||
|
||||
/**
|
||||
* Returns if the cocoapods analyyzer is enabled.
|
||||
*
|
||||
* @return if the cocoapods analyyzer is enabled
|
||||
*/
|
||||
public boolean isCocoapodsAnalyzerEnabled() {
|
||||
return cocoapodsAnalyzerEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether or not the cocoapods analyzer is enabled.
|
||||
*
|
||||
* @param cocoapodsAnalyzerEnabled the state of the cocoapods analyzer
|
||||
*/
|
||||
public void setCocoapodsAnalyzerEnabled(Boolean cocoapodsAnalyzerEnabled) {
|
||||
this.cocoapodsAnalyzerEnabled = cocoapodsAnalyzerEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not the Swift package Analyzer is enabled.
|
||||
*/
|
||||
private Boolean swiftPackageManagerAnalyzerEnabled;
|
||||
|
||||
/**
|
||||
* Returns whether or not the Swift package Analyzer is enabled.
|
||||
*
|
||||
* @return whether or not the Swift package Analyzer is enabled
|
||||
*/
|
||||
public Boolean isSwiftPackageManagerAnalyzerEnabled() {
|
||||
return swiftPackageManagerAnalyzerEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the enabled state of the swift package manager analyzer.
|
||||
*
|
||||
* @param swiftPackageManagerAnalyzerEnabled the enabled state of the swift
|
||||
* package manager
|
||||
*/
|
||||
public void setSwiftPackageManagerAnalyzerEnabled(Boolean swiftPackageManagerAnalyzerEnabled) {
|
||||
this.swiftPackageManagerAnalyzerEnabled = swiftPackageManagerAnalyzerEnabled;
|
||||
}
|
||||
//end changes
|
||||
|
||||
/**
|
||||
* Whether or not the openssl analyzer is enabled.
|
||||
*/
|
||||
@@ -934,6 +1030,10 @@ public class Check extends Update {
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_RUBY_GEMSPEC_ENABLED, rubygemsAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_OPENSSL_ENABLED, opensslAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_CMAKE_ENABLED, cmakeAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_SWIFT_PACKAGE_MANAGER_ENABLED, swiftPackageManagerAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_COCOAPODS_ENABLED, cocoapodsAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_ENABLED, bundleAuditAnalyzerEnabled);
|
||||
Settings.setStringIfNotNull(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_PATH, bundleAuditPath);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_AUTOCONF_ENABLED, autoconfAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_COMPOSER_LOCK_ENABLED, composerAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_NODE_PACKAGE_ENABLED, nodeAnalyzerEnabled);
|
||||
|
||||
@@ -72,9 +72,13 @@ cmakeAnalyzerEnabled | Sets whether the [experimental](../analyzers/ind
|
||||
autoconfAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) autoconf Analyzer should be used. | true
|
||||
composerAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) PHP Composer Lock File Analyzer should be used. | true
|
||||
nodeAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) Node.js Analyzer should be used. | true
|
||||
nuspecAnalyzerEnabled | Sets whether the .NET Nuget Nuspec Analyzer will be used. | true
|
||||
assemblyAnalyzerEnabled | Sets whether the .NET Assembly Analyzer should be used. | true
|
||||
pathToMono | The path to Mono for .NET assembly analysis on non-windows systems. |
|
||||
nuspecAnalyzerEnabled | Sets whether the .NET Nuget Nuspec Analyzer will be used. | true
|
||||
cocoapodsAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) Cocoapods Analyzer should be used. | true
|
||||
bundleAuditAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) Bundle Audit Analyzer should be used. | true
|
||||
bundleAuditPath | Sets the path to the bundle audit executable; only used if bundle audit analyzer is enabled and experimental analyzers are enabled. |
|
||||
swiftPackageManagerAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) Switft Package Analyzer should be used. | true
|
||||
assemblyAnalyzerEnabled | Sets whether the .NET Assembly Analyzer should be used. | true
|
||||
pathToMono | The path to Mono for .NET assembly analysis on non-windows systems. |
|
||||
|
||||
Advanced Configuration
|
||||
====================
|
||||
|
||||
@@ -431,6 +431,8 @@ public class App {
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_OPENSSL_ENABLED, !cli.isOpenSSLDisabled());
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_COMPOSER_LOCK_ENABLED, !cli.isComposerDisabled());
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_NODE_PACKAGE_ENABLED, !cli.isNodeJsDisabled());
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_SWIFT_PACKAGE_MANAGER_ENABLED, !cli.isSwiftPackageAnalyzerDisabled());
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_COCOAPODS_ENABLED, !cli.isCocoapodsAnalyzerDisabled());
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_RUBY_GEMSPEC_ENABLED, !cli.isRubyGemspecDisabled());
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED, !cli.isCentralDisabled());
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, !cli.isNexusDisabled());
|
||||
|
||||
@@ -437,6 +437,11 @@ public final class CliParser {
|
||||
final Option disableCmakeAnalyzer = Option.builder().longOpt(ARGUMENT.DISABLE_CMAKE)
|
||||
.desc("Disable the Cmake Analyzer.").build();
|
||||
|
||||
final Option cocoapodsAnalyzerEnabled = Option.builder().longOpt(ARGUMENT.DISABLE_COCOAPODS)
|
||||
.desc("Disable the CocoaPods Analyzer.").build();
|
||||
final Option swiftPackageManagerAnalyzerEnabled = Option.builder().longOpt(ARGUMENT.DISABLE_SWIFT)
|
||||
.desc("Disable the swift package Analyzer.").build();
|
||||
|
||||
final Option disableCentralAnalyzer = Option.builder().longOpt(ARGUMENT.DISABLE_CENTRAL)
|
||||
.desc("Disable the Central Analyzer. If this analyzer is disabled it is likely you also want to disable "
|
||||
+ "the Nexus Analyzer.").build();
|
||||
@@ -481,6 +486,8 @@ public final class CliParser {
|
||||
.addOption(disableNuspecAnalyzer)
|
||||
.addOption(disableCentralAnalyzer)
|
||||
.addOption(disableNexusAnalyzer)
|
||||
.addOption(cocoapodsAnalyzerEnabled)
|
||||
.addOption(swiftPackageManagerAnalyzerEnabled)
|
||||
.addOption(Option.builder().longOpt(ARGUMENT.DISABLE_NODE_JS)
|
||||
.desc("Disable the Node.js Package Analyzer.").build())
|
||||
.addOption(nexusUrl)
|
||||
@@ -701,6 +708,28 @@ public final class CliParser {
|
||||
return (line != null) && line.hasOption(ARGUMENT.DISABLE_NODE_JS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the disableCocoapodsAnalyzer command line argument was
|
||||
* specified.
|
||||
*
|
||||
* @return true if the disableCocoapodsAnalyzer command line argument was
|
||||
* specified; otherwise false
|
||||
*/
|
||||
public boolean isCocoapodsAnalyzerDisabled() {
|
||||
return (line != null) && line.hasOption(ARGUMENT.DISABLE_COCOAPODS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the disableSwiftPackageManagerAnalyzer command line
|
||||
* argument was specified.
|
||||
*
|
||||
* @return true if the disableSwiftPackageManagerAnalyzer command line
|
||||
* argument was specified; otherwise false
|
||||
*/
|
||||
public boolean isSwiftPackageAnalyzerDisabled() {
|
||||
return (line != null) && line.hasOption(ARGUMENT.DISABLE_SWIFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the disableCentral command line argument was specified.
|
||||
*
|
||||
@@ -1352,6 +1381,14 @@ public final class CliParser {
|
||||
* Disables the Cmake Analyzer.
|
||||
*/
|
||||
public static final String DISABLE_CMAKE = "disableCmake";
|
||||
/**
|
||||
* Disables the cocoapods analyzer.
|
||||
*/
|
||||
public static final String DISABLE_COCOAPODS = "disableCocoapodsAnalyzer";
|
||||
/**
|
||||
* Disables the swift package manager analyzer.
|
||||
*/
|
||||
public static final String DISABLE_SWIFT = "disableSwiftPackageManagerAnalyzer";
|
||||
/**
|
||||
* Disables the Assembly Analyzer.
|
||||
*/
|
||||
|
||||
@@ -35,13 +35,15 @@ Short | Argument Name | Paramete
|
||||
| \-\-disablePyPkg | | Sets whether the [experimental](../analyzers/index.html) Python Package Analyzer will be used. | false
|
||||
| \-\-disableNodeJS | | Sets whether the [experimental](../analyzers/index.html) Node.js Package Analyzer will be used. | false
|
||||
| \-\-disableRubygems | | Sets whether the [experimental](../analyzers/index.html) Ruby Gemspec Analyzer will be used. | false
|
||||
| \-\-disableBundleAudit | | Sets whether the [experimental](../analyzers/index.html) Ruby Bundler Audit Analyzer will be used. | false
|
||||
| \-\-disableBundleAudit | | Sets whether the [experimental](../analyzers/index.html) Ruby Bundler Audit Analyzer will be used. | false
|
||||
| \-\-disableCocoapodsAnalyzer | | Sets whether the [experimental](../analyzers/index.html) Cocoapods Analyzer will be used. | false
|
||||
| \-\-disableSwiftPackageManagerAnalyzer | | Sets whether the [experimental](../analyzers/index.html) Swift Package Manager Analyzer will be used. | false
|
||||
| \-\-disableAutoconf | | Sets whether the [experimental](../analyzers/index.html) Autoconf Analyzer will be used. | false
|
||||
| \-\-disableOpenSSL | | Sets whether the OpenSSL Analyzer will be used. | false
|
||||
| \-\-disableOpenSSL | | Sets whether the OpenSSL Analyzer will be used. | false
|
||||
| \-\-disableCmake | | Sets whether the [experimental](../analyzers/index.html) Cmake Analyzer will be disabled. | false
|
||||
| \-\-disableArchive | | Sets whether the Archive Analyzer will be disabled. | false
|
||||
| \-\-disableArchive | | Sets whether the Archive Analyzer will be disabled. | false
|
||||
| \-\-zipExtensions | \<strings\> | A comma-separated list of additional file extensions to be treated like a ZIP file, the contents will be extracted and analyzed. |
|
||||
| \-\-disableJar | | Sets whether the Jar Analyzer will be disabled. | false
|
||||
| \-\-disableJar | | Sets whether the Jar Analyzer will be disabled. | false
|
||||
| \-\-disableComposer | | Sets whether the [experimental](../analyzers/index.html) PHP Composer Lock File Analyzer will be disabled. | false
|
||||
| \-\-disableCentral | | Sets whether the Central Analyzer will be used. **Disabling this analyzer is not recommended as it could lead to false negatives (e.g. libraries that have vulnerabilities may not be reported correctly).** If this analyzer is being disabled there is a good chance you also want to disable the Nexus Analyzer. | false
|
||||
| \-\-disableNexus | | Sets whether the Nexus Analyzer will be used. Note, this has been superceded by the Central Analyzer. However, you can configure the Nexus URL to utilize an internally hosted Nexus Pro server. | false
|
||||
|
||||
@@ -304,6 +304,30 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
|
||||
@Parameter(property = "nexusAnalyzerEnabled", required = false)
|
||||
private Boolean nexusAnalyzerEnabled;
|
||||
|
||||
/**
|
||||
* Whether or not the Ruby Bundle Audit Analyzer is enabled.
|
||||
*/
|
||||
@Parameter(property = "bundleAuditAnalyzerEnabled", required = false)
|
||||
private Boolean bundleAuditAnalyzerEnabled;
|
||||
|
||||
/**
|
||||
* Sets the path for the bundle-audit binary.
|
||||
*/
|
||||
@Parameter(property = "bundleAuditPath", defaultValue="", required = false)
|
||||
private String bundleAuditPath;
|
||||
|
||||
/**
|
||||
* Whether or not the CocoaPods Analyzer is enabled.
|
||||
*/
|
||||
@Parameter(property = "cocoapodsAnalyzerEnabled", required = false)
|
||||
private Boolean cocoapodsAnalyzerEnabled;
|
||||
|
||||
/**
|
||||
* Whether or not the Swift package Analyzer is enabled.
|
||||
*/
|
||||
@Parameter(property = "swiftPackageManagerAnalyzerEnabled", required = false)
|
||||
private Boolean swiftPackageManagerAnalyzerEnabled;
|
||||
|
||||
/**
|
||||
* The URL of a Nexus server's REST API end point
|
||||
* (http://domain/nexus/service/local).
|
||||
@@ -884,6 +908,10 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_AUTOCONF_ENABLED, autoconfAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_COMPOSER_LOCK_ENABLED, composerAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_NODE_PACKAGE_ENABLED, nodeAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_ENABLED, bundleAuditAnalyzerEnabled);
|
||||
Settings.setStringIfNotNull(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_PATH, bundleAuditPath);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_COCOAPODS_ENABLED, cocoapodsAnalyzerEnabled);
|
||||
Settings.setBooleanIfNotNull(Settings.KEYS.ANALYZER_SWIFT_PACKAGE_MANAGER_ENABLED, swiftPackageManagerAnalyzerEnabled);
|
||||
|
||||
//Database configuration
|
||||
Settings.setStringIfNotEmpty(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
|
||||
|
||||
@@ -55,7 +55,11 @@ cmakeAnalyzerEnabled | Sets whether the [experimental](../analyzers/ind
|
||||
autoconfAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) autoconf Analyzer should be used. | true
|
||||
composerAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) PHP Composer Lock File Analyzer should be used. | true
|
||||
nodeAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) Node.js Analyzer should be used. | true
|
||||
nuspecAnalyzerEnabled | Sets whether the .NET Nuget Nuspec Analyzer will be used. | true
|
||||
nuspecAnalyzerEnabled | Sets whether the .NET Nuget Nuspec Analyzer will be used. | true
|
||||
cocoapodsAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) Cocoapods Analyzer should be used. | true
|
||||
bundleAuditAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) Bundle Audit Analyzer should be used. | true
|
||||
bundleAuditPath | Sets the path to the bundle audit executable; only used if bundle audit analyzer is enabled and experimental analyzers are enabled. |
|
||||
swiftPackageManagerAnalyzerEnabled | Sets whether the [experimental](../analyzers/index.html) Switft Package Analyzer should be used. | true
|
||||
assemblyAnalyzerEnabled | Sets whether the .NET Assembly Analyzer should be used. | true
|
||||
pathToMono | The path to Mono for .NET assembly analysis on non-windows systems. |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user