diff --git a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java index 181b75bc0..71b7590b6 100644 --- a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java +++ b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/App.java @@ -254,6 +254,7 @@ public class App { final boolean archiveDisabled = cli.isArchiveDisabled(); final boolean pyDistDisabled = cli.isPythonDistributionDisabled(); final boolean pyPkgDisabled = cli.isPythonPackageDisabled(); + final boolean autoconfDisabled = cli.isAutoconfDisabled(); final boolean assemblyDisabled = cli.isAssemblyDisabled(); final boolean nuspecDisabled = cli.isNuspecDisabled(); final boolean centralDisabled = cli.isCentralDisabled(); @@ -321,6 +322,7 @@ public class App { Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, !archiveDisabled); Settings.setBoolean(Settings.KEYS.ANALYZER_PYTHON_DISTRIBUTION_ENABLED, !pyDistDisabled); Settings.setBoolean(Settings.KEYS.ANALYZER_PYTHON_PACKAGE_ENABLED, !pyPkgDisabled); + Settings.setBoolean(Settings.KEYS.ANALYZER_AUTOCONF_ENABLED, !autoconfDisabled); Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, !nuspecDisabled); Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, !assemblyDisabled); diff --git a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/CliParser.java b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/CliParser.java index 4f4da1948..920b30f5b 100644 --- a/dependency-check-cli/src/main/java/org/owasp/dependencycheck/CliParser.java +++ b/dependency-check-cli/src/main/java/org/owasp/dependencycheck/CliParser.java @@ -333,6 +333,10 @@ public final class CliParser { final Option disablePythonPackageAnalyzer = OptionBuilder.withLongOpt(ARGUMENT.DISABLE_PY_PKG) .withDescription("Disable the Python Package Analyzer.").create(); + + final Option disableAutoconfAnalyzer = OptionBuilder + .withLongOpt(ARGUMENT.DISABLE_AUTOCONF) + .withDescription("Disable the Autoconf Analyzer.").create(); final Option disableCentralAnalyzer = OptionBuilder.withLongOpt(ARGUMENT.DISABLE_CENTRAL) .withDescription("Disable the Central Analyzer. If this analyzer is disabled it is likely you also want to disable " @@ -379,6 +383,7 @@ public final class CliParser { .addOption(disableAssemblyAnalyzer) .addOption(disablePythonDistributionAnalyzer) .addOption(disablePythonPackageAnalyzer) + .addOption(disableAutoconfAnalyzer) .addOption(disableNuspecAnalyzer) .addOption(disableCentralAnalyzer) .addOption(disableNexusAnalyzer) @@ -486,6 +491,15 @@ public final class CliParser { return (line != null) && line.hasOption(ARGUMENT.DISABLE_PY_PKG); } + /** + * Returns true if the disableAutoconf command line argument was specified. + * + * @return true if the disableAutoconf command line argument was specified; otherwise false + */ + public boolean isAutoconfDisabled() { + return (line != null) && line.hasOption(ARGUMENT.DISABLE_AUTOCONF); + } + /** * Returns true if the disableNexus command line argument was specified. * @@ -796,7 +810,7 @@ public final class CliParser { */ public static class ARGUMENT { - /** + /** * The long CLI argument name specifying the directory/file to scan. */ public static final String SCAN = "scan"; @@ -935,6 +949,10 @@ public final class CliParser { * Disables the Python Package Analyzer. */ public static final String DISABLE_PY_PKG = "disablePyPkg"; + /** + * Disables the Autoconf Analyzer. + */ + public static final String DISABLE_AUTOCONF = "disableAutoconf"; /** * Disables the Assembly Analyzer. */ @@ -992,4 +1010,4 @@ public final class CliParser { */ public static final String EXCLUDE = "exclude"; } -} +} \ No newline at end of file diff --git a/dependency-check-cli/src/site/markdown/arguments.md b/dependency-check-cli/src/site/markdown/arguments.md index cda68ab11..e700402b4 100644 --- a/dependency-check-cli/src/site/markdown/arguments.md +++ b/dependency-check-cli/src/site/markdown/arguments.md @@ -25,6 +25,7 @@ Short | Argument Name        | Paramete | \-\-updateonly | | If set only the update phase of dependency-check will be executed; no scan will be executed and no report will be generated. |   | \-\-disablePyDist | | Sets whether the Python Distribution Analyzer will be used. | false | \-\-disablePyPkg | | Sets whether the Python Package Analyzer will be used. | false + | \-\-disableAutoconf | | Sets whether the Autoconf Analyzer will be used. | false | \-\-disableArchive | | Sets whether the Archive Analyzer will be used. | false | \-\-zipExtensions | \ | 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 used. | false diff --git a/dependency-check-core/src/main/resources/META-INF/services/org.owasp.dependencycheck.analyzer.Analyzer b/dependency-check-core/src/main/resources/META-INF/services/org.owasp.dependencycheck.analyzer.Analyzer index 70e1f6d7f..6a3bae2bf 100644 --- a/dependency-check-core/src/main/resources/META-INF/services/org.owasp.dependencycheck.analyzer.Analyzer +++ b/dependency-check-core/src/main/resources/META-INF/services/org.owasp.dependencycheck.analyzer.Analyzer @@ -13,4 +13,5 @@ org.owasp.dependencycheck.analyzer.NexusAnalyzer org.owasp.dependencycheck.analyzer.NuspecAnalyzer org.owasp.dependencycheck.analyzer.AssemblyAnalyzer org.owasp.dependencycheck.analyzer.PythonDistributionAnalyzer -org.owasp.dependencycheck.analyzer.PythonPackageAnalyzer \ No newline at end of file +org.owasp.dependencycheck.analyzer.PythonPackageAnalyzer +org.owasp.dependencycheck.analyzer.AutoconfAnalyzer \ No newline at end of file diff --git a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java index cc5469a27..7899d0633 100644 --- a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java +++ b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java @@ -184,6 +184,10 @@ public final class Settings { * The properties key for whether the Python Package analyzer is enabled. */ public static final String ANALYZER_PYTHON_PACKAGE_ENABLED = "analyzer.python.package.enabled"; + /** + * The properties key for whether the Autoconf analyzer is enabled. + */ + public static final String ANALYZER_AUTOCONF_ENABLED = "analyzer.autoconf.enabled"; /** * The properties key for whether the .NET Assembly analyzer is enabled. */