1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.owasp.dependencycheck;
19
20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
21
22 import java.io.File;
23 import java.io.FileNotFoundException;
24
25 import org.apache.commons.cli.CommandLine;
26 import org.apache.commons.cli.CommandLineParser;
27 import org.apache.commons.cli.DefaultParser;
28 import org.apache.commons.cli.HelpFormatter;
29 import org.apache.commons.cli.Option;
30 import org.apache.commons.cli.OptionGroup;
31 import org.apache.commons.cli.Options;
32 import org.apache.commons.cli.ParseException;
33 import org.owasp.dependencycheck.reporting.ReportGenerator.Format;
34 import org.owasp.dependencycheck.utils.InvalidSettingException;
35 import org.owasp.dependencycheck.utils.Settings;
36 import org.slf4j.Logger;
37 import org.slf4j.LoggerFactory;
38
39
40
41
42
43
44
45 @SuppressWarnings("squid:S2068")
46 public final class CliParser {
47
48
49
50
51 private static final Logger LOGGER = LoggerFactory.getLogger(CliParser.class);
52
53
54
55 private CommandLine line;
56
57
58
59 private boolean isValid = true;
60
61
62
63 private final Settings settings;
64
65
66
67 private static final String SUPPORTED_FORMATS = "HTML, XML, CSV, JSON, JUNIT, SARIF, JENKINS, GITLAB or ALL";
68
69
70
71
72
73
74 public CliParser(Settings settings) {
75 this.settings = settings;
76 }
77
78
79
80
81
82
83
84
85
86 public void parse(String[] args) throws FileNotFoundException, ParseException {
87 line = parseArgs(args);
88
89 if (line != null) {
90 validateArgs();
91 }
92 }
93
94
95
96
97
98
99
100
101 private CommandLine parseArgs(String[] args) throws ParseException {
102 final CommandLineParser parser = new DefaultParser();
103 final Options options = createCommandLineOptions();
104 return parser.parse(options, args);
105 }
106
107
108
109
110
111
112
113
114
115 private void validateArgs() throws FileNotFoundException, ParseException {
116 if (isUpdateOnly() || isRunScan()) {
117
118 String value = line.getOptionValue(ARGUMENT.NVD_API_VALID_FOR_HOURS);
119 if (value != null) {
120 try {
121 final int i = Integer.parseInt(value);
122 if (i < 0) {
123 throw new ParseException("Invalid Setting: nvdValidForHours must be a number greater than or equal to 0.");
124 }
125 } catch (NumberFormatException ex) {
126 throw new ParseException("Invalid Setting: nvdValidForHours must be a number greater than or equal to 0.");
127 }
128 }
129 value = line.getOptionValue(ARGUMENT.NVD_API_MAX_RETRY_COUNT);
130 if (value != null) {
131 try {
132 final int i = Integer.parseInt(value);
133 if (i <= 0) {
134 throw new ParseException("Invalid Setting: nvdMaxRetryCount must be a number greater than 0.");
135 }
136 } catch (NumberFormatException ex) {
137 throw new ParseException("Invalid Setting: nvdMaxRetryCount must be a number greater than 0.");
138 }
139 }
140 value = line.getOptionValue(ARGUMENT.NVD_API_DELAY);
141 if (value != null) {
142 try {
143 final int i = Integer.parseInt(value);
144 if (i < 0) {
145 throw new ParseException("Invalid Setting: nvdApiDelay must be a number greater than or equal to 0.");
146 }
147 } catch (NumberFormatException ex) {
148 throw new ParseException("Invalid Setting: nvdApiDelay must be a number greater than or equal to 0.");
149 }
150 }
151 }
152 if (isRunScan()) {
153 validatePathExists(getScanFiles(), ARGUMENT.SCAN);
154 validatePathExists(getReportDirectory(), ARGUMENT.OUT);
155 final String pathToCore = getStringArgument(ARGUMENT.PATH_TO_CORE);
156 if (pathToCore != null) {
157 validatePathExists(pathToCore, ARGUMENT.PATH_TO_CORE);
158 }
159 if (line.hasOption(ARGUMENT.OUTPUT_FORMAT)) {
160 for (String validating : getReportFormat()) {
161 if (!isValidFormat(validating)
162 && !isValidFilePath(validating, "format")) {
163 final String msg = String.format("An invalid 'format' of '%s' was specified. "
164 + "Supported output formats are %s, and custom template files.",
165 validating, SUPPORTED_FORMATS);
166 throw new ParseException(msg);
167 }
168 }
169 }
170 if (line.hasOption(ARGUMENT.SYM_LINK_DEPTH)) {
171 try {
172 final int i = Integer.parseInt(line.getOptionValue(ARGUMENT.SYM_LINK_DEPTH));
173 if (i < 0) {
174 throw new ParseException("Symbolic Link Depth (symLink) must be greater than zero.");
175 }
176 } catch (NumberFormatException ex) {
177 throw new ParseException("Symbolic Link Depth (symLink) is not a number.");
178 }
179 }
180 }
181 }
182
183
184
185
186
187
188
189
190 private boolean isValidFormat(String format) {
191 try {
192 Format.valueOf(format);
193 return true;
194 } catch (IllegalArgumentException ex) {
195 return false;
196 }
197 }
198
199
200
201
202
203
204
205
206 private boolean isValidFilePath(String path, String argumentName) {
207 try {
208 validatePathExists(path, argumentName);
209 return true;
210 } catch (FileNotFoundException ex) {
211 return false;
212 }
213 }
214
215
216
217
218
219
220
221
222
223
224
225 private void validatePathExists(String[] paths, String optType) throws FileNotFoundException {
226 for (String path : paths) {
227 validatePathExists(path, optType);
228 }
229 }
230
231
232
233
234
235
236
237
238
239
240
241 private void validatePathExists(String path, String argumentName) throws FileNotFoundException {
242 if (path == null) {
243 isValid = false;
244 final String msg = String.format("Invalid '%s' argument: null", argumentName);
245 throw new FileNotFoundException(msg);
246 } else if (!path.contains("*") && !path.contains("?")) {
247 File f = new File(path);
248 final String[] formats = this.getReportFormat();
249 if ("o".equalsIgnoreCase(argumentName.substring(0, 1)) && formats.length == 1 && !"ALL".equalsIgnoreCase(formats[0])) {
250 final String checkPath = path.toLowerCase();
251 if (checkPath.endsWith(".html") || checkPath.endsWith(".xml") || checkPath.endsWith(".htm")
252 || checkPath.endsWith(".csv") || checkPath.endsWith(".json")) {
253 if (f.getParentFile() == null) {
254 f = new File(".", path);
255 }
256 if (!f.getParentFile().isDirectory()) {
257 isValid = false;
258 final String msg = String.format("Invalid '%s' argument: '%s' - directory path does not exist", argumentName, path);
259 throw new FileNotFoundException(msg);
260 }
261 }
262 } else if ("o".equalsIgnoreCase(argumentName.substring(0, 1)) && !f.isDirectory()) {
263 if (f.getParentFile() != null && f.getParentFile().isDirectory() && !f.mkdir()) {
264 isValid = false;
265 final String msg = String.format("Invalid '%s' argument: '%s' - unable to create the output directory", argumentName, path);
266 throw new FileNotFoundException(msg);
267 }
268 if (!f.isDirectory()) {
269 isValid = false;
270 final String msg = String.format("Invalid '%s' argument: '%s' - path does not exist", argumentName, path);
271 throw new FileNotFoundException(msg);
272 }
273 } else if (!f.exists()) {
274 isValid = false;
275 final String msg = String.format("Invalid '%s' argument: '%s' - path does not exist", argumentName, path);
276 throw new FileNotFoundException(msg);
277 }
278
279
280
281
282 } else if ((path.endsWith("/*") && !path.endsWith("**/*")) || (path.endsWith("\\*") && path.endsWith("**\\*"))) {
283 LOGGER.warn("Possibly incorrect path '{}' from argument '{}' because it ends with a slash star; "
284 + "dependency-check uses ant-style paths", path, argumentName);
285 }
286 }
287
288
289
290
291
292
293
294 @SuppressWarnings("static-access")
295 private Options createCommandLineOptions() {
296 final Options options = new Options();
297 addStandardOptions(options);
298 addAdvancedOptions(options);
299 addDeprecatedOptions(options);
300 return options;
301 }
302
303
304
305
306
307
308 @SuppressWarnings("static-access")
309 private void addStandardOptions(final Options options) {
310
311
312 options.addOptionGroup(newOptionGroup(newOptionWithArg(ARGUMENT.SCAN_SHORT, ARGUMENT.SCAN, "path",
313 "The path to scan - this option can be specified multiple times. Ant style paths are supported (e.g. 'path/**/*.jar'); "
314 + "if using Ant style paths it is highly recommended to quote the argument value.")))
315 .addOptionGroup(newOptionGroup(newOptionWithArg(ARGUMENT.EXCLUDE, "pattern", "Specify an exclusion pattern. This option "
316 + "can be specified multiple times and it accepts Ant style exclusions.")))
317 .addOption(newOptionWithArg(ARGUMENT.PROJECT, "name", "The name of the project being scanned."))
318 .addOption(newOptionWithArg(ARGUMENT.OUT_SHORT, ARGUMENT.OUT, "path",
319 "The folder to write reports to. This defaults to the current directory. It is possible to set this to a specific "
320 + "file name if the format argument is not set to ALL."))
321 .addOption(newOptionWithArg(ARGUMENT.OUTPUT_FORMAT_SHORT, ARGUMENT.OUTPUT_FORMAT, "format",
322 "The report format (" + SUPPORTED_FORMATS + "). The default is HTML. Multiple format parameters can be specified."))
323 .addOption(newOption(ARGUMENT.PRETTY_PRINT, "When specified the JSON and XML report formats will be pretty printed."))
324 .addOption(newOption(ARGUMENT.VERSION_SHORT, ARGUMENT.VERSION, "Print the version information."))
325 .addOption(newOption(ARGUMENT.HELP_SHORT, ARGUMENT.HELP, "Print this message."))
326 .addOption(newOption(ARGUMENT.ADVANCED_HELP, "Print the advanced help message."))
327 .addOption(newOption(ARGUMENT.DISABLE_AUTO_UPDATE_SHORT, ARGUMENT.DISABLE_AUTO_UPDATE,
328 "Disables the automatic updating of the NVD-CVE, hosted-suppressions and RetireJS data."))
329 .addOption(newOptionWithArg(ARGUMENT.VERBOSE_LOG_SHORT, ARGUMENT.VERBOSE_LOG, "file",
330 "The file path to write verbose logging information."))
331 .addOptionGroup(newOptionGroup(newOptionWithArg(ARGUMENT.SUPPRESSION_FILES, "file",
332 "The file path to the suppression XML file. This can be specified more then once to utilize multiple suppression files")))
333 .addOption(newOption(ARGUMENT.EXPERIMENTAL, "Enables the experimental analyzers."))
334 .addOption(newOptionWithArg(ARGUMENT.NVD_API_KEY, "apiKey", "The API Key to access the NVD API."))
335 .addOption(newOptionWithArg(ARGUMENT.FAIL_ON_CVSS, "score",
336 "Specifies if the build should be failed if a CVSS score above a specified level is identified. The default is 11; "
337 + "since the CVSS scores are 0-10, by default the build will never fail."))
338 .addOption(newOptionWithArg(ARGUMENT.FAIL_JUNIT_ON_CVSS, "score",
339 "Specifies the CVSS score that is considered a failure when generating the junit report. The default is 0."));
340 }
341
342
343
344
345
346
347
348
349 @SuppressWarnings("static-access")
350 private void addAdvancedOptions(final Options options) {
351 options
352 .addOption(newOption(ARGUMENT.UPDATE_ONLY,
353 "Only update the local NVD data cache; no scan will be executed."))
354 .addOption(newOptionWithArg(ARGUMENT.NVD_API_DELAY, "milliseconds",
355 "Time in milliseconds to wait between downloading from the NVD."))
356 .addOption(newOptionWithArg(ARGUMENT.NVD_API_ENDPOINT, "endpoint",
357 "The NVD API Endpoint - setting this is rare."))
358 .addOption(newOptionWithArg(ARGUMENT.NVD_API_DATAFEED_URL, "url",
359 "The URL to the NVD API Datafeed."))
360 .addOption(newOptionWithArg(ARGUMENT.NVD_API_DATAFEED_USER, "user",
361 "Credentials for basic authentication to the NVD API Datafeed."))
362 .addOption(newOptionWithArg(ARGUMENT.NVD_API_DATAFEED_PASSWORD, "password",
363 "Credentials for basic authentication to the NVD API Datafeed."))
364 .addOption(newOptionWithArg(ARGUMENT.NVD_API_MAX_RETRY_COUNT,"count",
365 "The maximum number of retry requests for a single call to the NVD API."))
366 .addOption(newOptionWithArg(ARGUMENT.NVD_API_VALID_FOR_HOURS, "hours",
367 "The number of hours to wait before checking for new updates from the NVD."))
368 .addOption(newOptionWithArg(ARGUMENT.PROXY_PORT, "port",
369 "The proxy port to use when downloading resources."))
370 .addOption(newOptionWithArg(ARGUMENT.PROXY_SERVER, "server",
371 "The proxy server to use when downloading resources."))
372 .addOption(newOptionWithArg(ARGUMENT.PROXY_USERNAME, "user",
373 "The proxy username to use when downloading resources."))
374 .addOption(newOptionWithArg(ARGUMENT.PROXY_PASSWORD, "pass",
375 "The proxy password to use when downloading resources."))
376 .addOption(newOptionWithArg(ARGUMENT.NON_PROXY_HOSTS, "list",
377 "The proxy exclusion list: hostnames (or patterns) for which proxy should not be used. "
378 + "Use pipe, comma or colon as list separator."))
379 .addOption(newOptionWithArg(ARGUMENT.CONNECTION_TIMEOUT_SHORT, ARGUMENT.CONNECTION_TIMEOUT, "timeout",
380 "The connection timeout (in milliseconds) to use when downloading resources."))
381 .addOption(newOptionWithArg(ARGUMENT.CONNECTION_READ_TIMEOUT, "timeout",
382 "The read timeout (in milliseconds) to use when downloading resources."))
383 .addOption(newOptionWithArg(ARGUMENT.CONNECTION_STRING, "connStr",
384 "The connection string to the database."))
385 .addOption(newOptionWithArg(ARGUMENT.DB_NAME, "user",
386 "The username used to connect to the database."))
387 .addOption(newOptionWithArg(ARGUMENT.DATA_DIRECTORY_SHORT, ARGUMENT.DATA_DIRECTORY, "path",
388 "The location of the H2 Database file. This option should generally not be set."))
389 .addOption(newOptionWithArg(ARGUMENT.DB_PASSWORD, "password",
390 "The password for connecting to the database."))
391 .addOption(newOptionWithArg(ARGUMENT.DB_DRIVER, "driver",
392 "The database driver name."))
393 .addOption(newOptionWithArg(ARGUMENT.DB_DRIVER_PATH, "path",
394 "The path to the database driver; note, this does not need to be set unless the JAR is "
395 + "outside of the classpath."))
396 .addOption(newOptionWithArg(ARGUMENT.SYM_LINK_DEPTH, "depth",
397 "Sets how deep nested symbolic links will be followed; 0 indicates symbolic links will not be followed."))
398 .addOption(newOptionWithArg(ARGUMENT.PATH_TO_BUNDLE_AUDIT, "path",
399 "The path to bundle-audit for Gem bundle analysis."))
400 .addOption(newOptionWithArg(ARGUMENT.PATH_TO_BUNDLE_AUDIT_WORKING_DIRECTORY, "path",
401 "The path to working directory that the bundle-audit command should be executed from when "
402 + "doing Gem bundle analysis."))
403 .addOption(newOptionWithArg(ARGUMENT.CENTRAL_URL, "url",
404 "Alternative URL for Maven Central Search. If not set the public Sonatype Maven Central will be used."))
405 .addOption(newOptionWithArg(ARGUMENT.OSSINDEX_URL, "url",
406 "Alternative URL for the OSS Index. If not set the public Sonatype OSS Index will be used."))
407 .addOption(newOptionWithArg(ARGUMENT.OSSINDEX_USERNAME, "username",
408 "The username to authenticate to Sonatype's OSS Index. If not set the Sonatype OSS Index "
409 + "Analyzer will use an unauthenticated connection."))
410 .addOption(newOptionWithArg(ARGUMENT.OSSINDEX_PASSWORD, "password", ""
411 + "The password to authenticate to Sonatype's OSS Index. If not set the Sonatype OSS "
412 + "Index Analyzer will use an unauthenticated connection."))
413 .addOption(newOptionWithArg(ARGUMENT.OSSINDEX_WARN_ONLY_ON_REMOTE_ERRORS, "true/false", ""
414 + "Whether a Sonatype OSS Index remote error should result in a warning only or a failure."))
415 .addOption(newOption(ARGUMENT.RETIRE_JS_FORCEUPDATE, "Force the RetireJS Analyzer to update "
416 + "even if autoupdate is disabled"))
417 .addOption(newOptionWithArg(ARGUMENT.RETIREJS_URL, "url",
418 "The Retire JS Repository URL"))
419 .addOption(newOptionWithArg(ARGUMENT.RETIREJS_URL_USER, "username",
420 "The password to authenticate to Retire JS Repository URL"))
421 .addOption(newOptionWithArg(ARGUMENT.RETIREJS_URL_PASSWORD, "password",
422 "The password to authenticate to Retire JS Repository URL"))
423 .addOption(newOption(ARGUMENT.RETIREJS_FILTER_NON_VULNERABLE, "Specifies that the Retire JS "
424 + "Analyzer should filter out non-vulnerable JS files from the report."))
425 .addOption(newOptionWithArg(ARGUMENT.ARTIFACTORY_PARALLEL_ANALYSIS, "true/false",
426 "Whether the Artifactory Analyzer should use parallel analysis."))
427 .addOption(newOptionWithArg(ARGUMENT.ARTIFACTORY_USES_PROXY, "true/false",
428 "Whether the Artifactory Analyzer should use the proxy."))
429 .addOption(newOptionWithArg(ARGUMENT.ARTIFACTORY_USERNAME, "username",
430 "The Artifactory username for authentication."))
431 .addOption(newOptionWithArg(ARGUMENT.ARTIFACTORY_API_TOKEN, "token",
432 "The Artifactory API token."))
433 .addOption(newOptionWithArg(ARGUMENT.ARTIFACTORY_BEARER_TOKEN, "token",
434 "The Artifactory bearer token."))
435 .addOption(newOptionWithArg(ARGUMENT.ARTIFACTORY_URL, "url",
436 "The Artifactory URL."))
437 .addOption(newOptionWithArg(ARGUMENT.PATH_TO_GO, "path",
438 "The path to the `go` executable."))
439 .addOption(newOptionWithArg(ARGUMENT.PATH_TO_YARN, "path",
440 "The path to the `yarn` executable."))
441 .addOption(newOptionWithArg(ARGUMENT.PATH_TO_PNPM, "path",
442 "The path to the `pnpm` executable."))
443 .addOption(newOptionWithArg(ARGUMENT.RETIREJS_FILTERS, "pattern",
444 "Specify Retire JS content filter used to exclude files from analysis based on their content; "
445 + "most commonly used to exclude based on your applications own copyright line. This "
446 + "option can be specified multiple times."))
447 .addOption(newOptionWithArg(ARGUMENT.NEXUS_URL, "url",
448 "The url to the Nexus Server's REST API Endpoint (http://domain/nexus/service/local). If not "
449 + "set the Nexus Analyzer will be disabled."))
450 .addOption(newOptionWithArg(ARGUMENT.NEXUS_USERNAME, "username",
451 "The username to authenticate to the Nexus Server's REST API Endpoint. If not set the Nexus "
452 + "Analyzer will use an unauthenticated connection."))
453 .addOption(newOptionWithArg(ARGUMENT.NEXUS_PASSWORD, "password",
454 "The password to authenticate to the Nexus Server's REST API Endpoint. If not set the Nexus "
455 + "Analyzer will use an unauthenticated connection."))
456
457 .addOption(newOptionWithArg(ARGUMENT.NEXUS_USES_PROXY, "true/false",
458 "Whether or not the configured proxy should be used when connecting to Nexus."))
459 .addOption(newOptionWithArg(ARGUMENT.ADDITIONAL_ZIP_EXTENSIONS, "extensions",
460 "A comma separated list of additional extensions to be scanned as ZIP files (ZIP, EAR, WAR "
461 + "are already treated as zip files)"))
462 .addOption(newOptionWithArg(ARGUMENT.PROP_SHORT, ARGUMENT.PROP, "file", "A property file to load."))
463 .addOption(newOptionWithArg(ARGUMENT.PATH_TO_CORE, "path", "The path to dotnet core."))
464 .addOption(newOptionWithArg(ARGUMENT.HINTS_FILE, "file", "The file path to the hints XML file."))
465 .addOption(newOption(ARGUMENT.RETIRED, "Enables the retired analyzers."))
466 .addOption(newOption(ARGUMENT.DISABLE_MSBUILD, "Disable the MS Build Analyzer."))
467 .addOption(newOption(ARGUMENT.DISABLE_JAR, "Disable the Jar Analyzer."))
468 .addOption(newOption(ARGUMENT.DISABLE_ARCHIVE, "Disable the Archive Analyzer."))
469 .addOption(newOption(ARGUMENT.DISABLE_KEV, "Disable the Known Exploited Vulnerability Analyzer."))
470 .addOption(newOptionWithArg(ARGUMENT.KEV_URL, "url", "The url to the CISA Known Exploited Vulnerabilities JSON data feed"))
471 .addOption(newOption(ARGUMENT.DISABLE_ASSEMBLY, "Disable the .NET Assembly Analyzer."))
472 .addOption(newOption(ARGUMENT.DISABLE_PY_DIST, "Disable the Python Distribution Analyzer."))
473 .addOption(newOption(ARGUMENT.DISABLE_CMAKE, "Disable the Cmake Analyzer."))
474 .addOption(newOption(ARGUMENT.DISABLE_PY_PKG, "Disable the Python Package Analyzer."))
475 .addOption(newOption(ARGUMENT.DISABLE_MIX_AUDIT, "Disable the Elixir mix_audit Analyzer."))
476 .addOption(newOption(ARGUMENT.DISABLE_RUBYGEMS, "Disable the Ruby Gemspec Analyzer."))
477 .addOption(newOption(ARGUMENT.DISABLE_BUNDLE_AUDIT, "Disable the Ruby Bundler-Audit Analyzer."))
478 .addOption(newOption(ARGUMENT.DISABLE_FILENAME, "Disable the File Name Analyzer."))
479 .addOption(newOption(ARGUMENT.DISABLE_AUTOCONF, "Disable the Autoconf Analyzer."))
480 .addOption(newOption(ARGUMENT.DISABLE_MAVEN_INSTALL, "Disable the Maven install Analyzer."))
481 .addOption(newOption(ARGUMENT.DISABLE_PIP, "Disable the pip Analyzer."))
482 .addOption(newOption(ARGUMENT.DISABLE_PIPFILE, "Disable the Pipfile Analyzer."))
483 .addOption(newOption(ARGUMENT.DISABLE_COMPOSER, "Disable the PHP Composer Analyzer."))
484 .addOption(newOption(ARGUMENT.DISABLE_CPAN, "Disable the Perl CPAN file Analyzer."))
485 .addOption(newOption(ARGUMENT.DISABLE_POETRY, "Disable the Poetry Analyzer."))
486 .addOption(newOption(ARGUMENT.DISABLE_GOLANG_MOD, "Disable the Golang Mod Analyzer."))
487 .addOption(newOption(ARGUMENT.DISABLE_DART, "Disable the Dart Analyzer."))
488 .addOption(newOption(ARGUMENT.DISABLE_OPENSSL, "Disable the OpenSSL Analyzer."))
489 .addOption(newOption(ARGUMENT.DISABLE_NUSPEC, "Disable the Nuspec Analyzer."))
490 .addOption(newOption(ARGUMENT.DISABLE_NUGETCONF, "Disable the Nuget packages.config Analyzer."))
491 .addOption(newOption(ARGUMENT.DISABLE_CENTRAL, "Disable the Central Analyzer. If this analyzer "
492 + "is disabled it is likely you also want to disable the Nexus Analyzer."))
493 .addOption(newOption(ARGUMENT.DISABLE_CENTRAL_CACHE, "Disallow the Central Analyzer from caching results"))
494 .addOption(newOption(ARGUMENT.DISABLE_OSSINDEX, "Disable the Sonatype OSS Index Analyzer."))
495 .addOption(newOption(ARGUMENT.DISABLE_OSSINDEX_CACHE, "Disallow the OSS Index Analyzer from caching results"))
496 .addOption(newOption(ARGUMENT.DISABLE_COCOAPODS, "Disable the CocoaPods Analyzer."))
497 .addOption(newOption(ARGUMENT.DISABLE_SWIFT, "Disable the swift package Analyzer."))
498 .addOption(newOption(ARGUMENT.DISABLE_SWIFT_RESOLVED, "Disable the swift package resolved Analyzer."))
499 .addOption(newOption(ARGUMENT.DISABLE_GO_DEP, "Disable the Golang Package Analyzer."))
500 .addOption(newOption(ARGUMENT.DISABLE_NODE_JS, "Disable the Node.js Package Analyzer."))
501 .addOption(newOption(ARGUMENT.NODE_PACKAGE_SKIP_DEV_DEPENDENCIES, "Configures the Node Package Analyzer to skip devDependencies"))
502 .addOption(newOption(ARGUMENT.DISABLE_NODE_AUDIT, "Disable the Node Audit Analyzer."))
503 .addOption(newOption(ARGUMENT.DISABLE_PNPM_AUDIT, "Disable the Pnpm Audit Analyzer."))
504 .addOption(newOption(ARGUMENT.DISABLE_YARN_AUDIT, "Disable the Yarn Audit Analyzer."))
505 .addOption(newOption(ARGUMENT.DISABLE_NODE_AUDIT_CACHE, "Disallow the Node Audit Analyzer from caching results"))
506 .addOption(newOption(ARGUMENT.DISABLE_NODE_AUDIT_SKIPDEV, "Configures the Node Audit Analyzer to skip devDependencies"))
507 .addOption(newOption(ARGUMENT.DISABLE_RETIRE_JS, "Disable the RetireJS Analyzer."))
508 .addOption(newOption(ARGUMENT.ENABLE_NEXUS, "Enable the Nexus Analyzer."))
509 .addOption(newOption(ARGUMENT.ARTIFACTORY_ENABLED, "Whether the Artifactory Analyzer should be enabled."))
510 .addOption(newOption(ARGUMENT.PURGE_NVD, "Purges the local NVD data cache"))
511 .addOption(newOption(ARGUMENT.DISABLE_HOSTED_SUPPRESSIONS, "Disable the usage of the hosted suppressions file"))
512 .addOption(newOption(ARGUMENT.HOSTED_SUPPRESSIONS_FORCEUPDATE, "Force the hosted suppressions file to update even"
513 + " if autoupdate is disabled"))
514 .addOption(newOptionWithArg(ARGUMENT.HOSTED_SUPPRESSIONS_VALID_FOR_HOURS, "hours",
515 "The number of hours to wait before checking for new updates of the the hosted suppressions file."))
516 .addOption(newOptionWithArg(ARGUMENT.HOSTED_SUPPRESSIONS_URL, "url",
517 "The URL for a mirrored hosted suppressions file"));
518
519 }
520
521
522
523
524
525
526
527
528
529 @SuppressWarnings({"static-access", "deprecation"})
530 private void addDeprecatedOptions(final Options options) {
531
532 options.addOption(newOption("debug",
533 "Used to enable java debugging of the cli via dependency-check.sh."));
534 }
535
536
537
538
539
540
541 public boolean isGetVersion() {
542 return (line != null) && line.hasOption(ARGUMENT.VERSION);
543 }
544
545
546
547
548
549
550 public boolean isGetHelp() {
551 return (line != null) && line.hasOption(ARGUMENT.HELP);
552 }
553
554
555
556
557
558
559 public boolean isRunScan() {
560 return (line != null) && isValid && line.hasOption(ARGUMENT.SCAN);
561 }
562
563
564
565
566
567
568
569 public int getSymLinkDepth() {
570 int value = 0;
571 try {
572 value = Integer.parseInt(line.getOptionValue(ARGUMENT.SYM_LINK_DEPTH, "0"));
573 if (value < 0) {
574 value = 0;
575 }
576 } catch (NumberFormatException ex) {
577 LOGGER.debug("Symbolic link was not a number");
578 }
579 return value;
580 }
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595 public boolean isDisabled(String disableFlag, String setting) {
596 if (line == null || !line.hasOption(disableFlag)) {
597 try {
598 return !settings.getBoolean(setting);
599 } catch (InvalidSettingException ise) {
600 LOGGER.warn("Invalid property setting '{}' defaulting to false", setting);
601 return false;
602 }
603 } else {
604 return true;
605 }
606 }
607
608
609
610
611
612
613
614 public boolean isNodeAuditDisabled() {
615 return isDisabled(ARGUMENT.DISABLE_NODE_AUDIT, Settings.KEYS.ANALYZER_NODE_AUDIT_ENABLED);
616 }
617
618
619
620
621
622
623
624 public boolean isYarnAuditDisabled() {
625 return isDisabled(ARGUMENT.DISABLE_YARN_AUDIT, Settings.KEYS.ANALYZER_YARN_AUDIT_ENABLED);
626 }
627
628
629
630
631
632
633
634 public boolean isPnpmAuditDisabled() {
635 return isDisabled(ARGUMENT.DISABLE_PNPM_AUDIT, Settings.KEYS.ANALYZER_PNPM_AUDIT_ENABLED);
636 }
637
638
639
640
641
642
643
644
645 public boolean isNexusUsesProxy() {
646
647
648 if (line == null || !line.hasOption(ARGUMENT.NEXUS_USES_PROXY)) {
649 try {
650 return settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_USES_PROXY);
651 } catch (InvalidSettingException ise) {
652 return true;
653 }
654 } else {
655 return Boolean.parseBoolean(line.getOptionValue(ARGUMENT.NEXUS_USES_PROXY));
656 }
657 }
658
659
660
661
662
663
664
665 @SuppressFBWarnings(justification = "Accepting that this is a bad practice - used a Boolean as we needed three states",
666 value = {"NP_BOOLEAN_RETURN_NULL"})
667 public Boolean getBooleanArgument(String argument) {
668 if (line != null && line.hasOption(argument)) {
669 final String value = line.getOptionValue(argument);
670 if (value != null) {
671 return Boolean.parseBoolean(value);
672 }
673 }
674 return null;
675 }
676
677
678
679
680
681
682
683 public String getStringArgument(String option) {
684 return getStringArgument(option, null);
685 }
686
687
688
689
690
691
692
693
694 public String getStringArgument(String option, String key) {
695 if (line != null && line.hasOption(option)) {
696 if (key != null && (option.toLowerCase().endsWith("password")
697 || option.toLowerCase().endsWith("pass"))) {
698 LOGGER.warn("{} used on the command line, consider moving the password "
699 + "to a properties file using the key `{}` and using the "
700 + "--propertyfile argument instead", option, key);
701 }
702 return line.getOptionValue(option);
703 }
704 return null;
705 }
706
707
708
709
710
711
712
713 public String[] getStringArguments(String option) {
714 if (line != null && line.hasOption(option)) {
715 return line.getOptionValues(option);
716 }
717 return null;
718 }
719
720
721
722
723
724
725
726 public File getFileArgument(String option) {
727 final String path = line.getOptionValue(option);
728 if (path != null) {
729 return new File(path);
730 }
731 return null;
732 }
733
734
735
736
737 public void printHelp() {
738 final HelpFormatter formatter = new HelpFormatter();
739 final Options options = new Options();
740 addStandardOptions(options);
741 if (line != null && line.hasOption(ARGUMENT.ADVANCED_HELP)) {
742 addAdvancedOptions(options);
743 }
744 final String helpMsg = String.format("%n%s"
745 + " can be used to identify if there are any known CVE vulnerabilities in libraries utilized by an application. "
746 + "%s will automatically update required data from the Internet, such as the CVE and CPE data files from nvd.nist.gov.%n%n",
747 settings.getString(Settings.KEYS.APPLICATION_NAME, "DependencyCheck"),
748 settings.getString(Settings.KEYS.APPLICATION_NAME, "DependencyCheck"));
749
750 formatter.printHelp(settings.getString(Settings.KEYS.APPLICATION_NAME, "DependencyCheck"),
751 helpMsg,
752 options,
753 "",
754 true);
755 }
756
757
758
759
760
761
762
763 public String[] getScanFiles() {
764 return line.getOptionValues(ARGUMENT.SCAN);
765 }
766
767
768
769
770
771
772
773 public String[] getExcludeList() {
774 return line.getOptionValues(ARGUMENT.EXCLUDE);
775 }
776
777
778
779
780
781
782
783 public String[] getRetireJsFilters() {
784 return line.getOptionValues(ARGUMENT.RETIREJS_FILTERS);
785 }
786
787
788
789
790
791
792
793
794 @SuppressFBWarnings(justification = "Accepting that this is a bad practice - but made more sense in this use case",
795 value = {"NP_BOOLEAN_RETURN_NULL"})
796 public Boolean isRetireJsFilterNonVulnerable() {
797 return (line != null && line.hasOption(ARGUMENT.RETIREJS_FILTER_NON_VULNERABLE)) ? true : null;
798 }
799
800
801
802
803
804
805
806 public String getReportDirectory() {
807 return line.getOptionValue(ARGUMENT.OUT, ".");
808 }
809
810
811
812
813
814
815
816 public String[] getReportFormat() {
817 if (line.hasOption(ARGUMENT.OUTPUT_FORMAT)) {
818 return line.getOptionValues(ARGUMENT.OUTPUT_FORMAT);
819 }
820 return new String[]{"HTML"};
821 }
822
823
824
825
826
827
828 public String getProjectName() {
829 String name = line.getOptionValue(ARGUMENT.PROJECT);
830 if (name == null) {
831 name = "";
832 }
833 return name;
834 }
835
836
837
838
839
840
841
842 public void printVersionInfo() {
843 final String version = String.format("%s version %s",
844 settings.getString(Settings.KEYS.APPLICATION_NAME, "dependency-check"),
845 settings.getString(Settings.KEYS.APPLICATION_VERSION, "Unknown"));
846 System.out.println(version);
847 }
848
849
850
851
852
853
854
855 public boolean isUpdateOnly() {
856 return line != null && line.hasOption(ARGUMENT.UPDATE_ONLY);
857 }
858
859
860
861
862
863
864
865 public boolean isPurge() {
866 return line != null && line.hasOption(ARGUMENT.PURGE_NVD);
867 }
868
869
870
871
872
873
874
875 public String getDatabaseDriverName() {
876 return line.getOptionValue(ARGUMENT.DB_DRIVER);
877 }
878
879
880
881
882
883
884
885 public Integer getIntegerValue(String argument) {
886 final String v = line.getOptionValue(argument);
887 if (v != null) {
888 return Integer.parseInt(v);
889 }
890 return null;
891 }
892
893
894
895
896
897
898
899
900
901 @SuppressFBWarnings(justification = "Accepting that this is a bad practice - but made more sense in this use case",
902 value = {"NP_BOOLEAN_RETURN_NULL"})
903 public Boolean hasOption(String option) {
904 return (line != null && line.hasOption(option)) ? true : null;
905 }
906
907
908
909
910
911
912
913 public float getFailOnCVSS() {
914 if (line.hasOption(ARGUMENT.FAIL_ON_CVSS)) {
915 final String value = line.getOptionValue(ARGUMENT.FAIL_ON_CVSS);
916 try {
917 return Float.parseFloat(value);
918 } catch (NumberFormatException nfe) {
919 return 11;
920 }
921 } else {
922 return 11;
923 }
924 }
925
926
927
928
929
930
931
932
933 public float getFloatArgument(String option, float defaultValue) {
934 if (line.hasOption(option)) {
935 final String value = line.getOptionValue(option);
936 try {
937 return Integer.parseInt(value);
938 } catch (NumberFormatException nfe) {
939 return defaultValue;
940 }
941 } else {
942 return defaultValue;
943 }
944 }
945
946
947
948
949
950
951
952
953 private Option newOption(String name, String description) {
954 return Option.builder().longOpt(name).desc(description).build();
955 }
956
957
958
959
960
961
962
963
964
965 private Option newOption(String shortName, String name, String description) {
966 return Option.builder(shortName).longOpt(name).desc(description).build();
967 }
968
969
970
971
972
973
974
975
976
977 private Option newOptionWithArg(String name, String arg, String description) {
978 return Option.builder().longOpt(name).argName(arg).hasArg().desc(description).build();
979 }
980
981
982
983
984
985
986
987
988
989
990 private Option newOptionWithArg(String shortName, String name, String arg, String description) {
991 return Option.builder(shortName).longOpt(name).argName(arg).hasArg().desc(description).build();
992 }
993
994
995
996
997
998
999
1000
1001 private OptionGroup newOptionGroup(Option option) {
1002 final OptionGroup group = new OptionGroup();
1003 group.addOption(option);
1004 return group;
1005 }
1006
1007
1008
1009
1010
1011 public static class ARGUMENT {
1012
1013
1014
1015
1016 public static final String SCAN = "scan";
1017
1018
1019
1020 public static final String SCAN_SHORT = "s";
1021
1022
1023
1024
1025 public static final String DISABLE_AUTO_UPDATE = "noupdate";
1026
1027
1028
1029
1030 public static final String DISABLE_AUTO_UPDATE_SHORT = "n";
1031
1032
1033
1034
1035 public static final String UPDATE_ONLY = "updateonly";
1036
1037
1038
1039
1040 public static final String PURGE_NVD = "purge";
1041
1042
1043
1044
1045 public static final String OUT = "out";
1046
1047
1048
1049
1050 public static final String OUT_SHORT = "o";
1051
1052
1053
1054
1055 public static final String OUTPUT_FORMAT = "format";
1056
1057
1058
1059
1060 public static final String OUTPUT_FORMAT_SHORT = "f";
1061
1062
1063
1064
1065 public static final String PROJECT = "project";
1066
1067
1068
1069 public static final String HELP = "help";
1070
1071
1072
1073 public static final String ADVANCED_HELP = "advancedHelp";
1074
1075
1076
1077 public static final String HELP_SHORT = "h";
1078
1079
1080
1081 public static final String VERSION_SHORT = "v";
1082
1083
1084
1085 public static final String VERSION = "version";
1086
1087
1088
1089 public static final String PROXY_PORT = "proxyport";
1090
1091
1092
1093 public static final String PROXY_SERVER = "proxyserver";
1094
1095
1096
1097 public static final String PROXY_USERNAME = "proxyuser";
1098
1099
1100
1101 public static final String PROXY_PASSWORD = "proxypass";
1102
1103
1104
1105 public static final String NON_PROXY_HOSTS = "nonProxyHosts";
1106
1107
1108
1109 public static final String CONNECTION_TIMEOUT_SHORT = "c";
1110
1111
1112
1113 public static final String CONNECTION_TIMEOUT = "connectiontimeout";
1114
1115
1116
1117 public static final String CONNECTION_READ_TIMEOUT = "readtimeout";
1118
1119
1120
1121
1122 public static final String PROP_SHORT = "P";
1123
1124
1125
1126
1127 public static final String PROP = "propertyfile";
1128
1129
1130
1131 public static final String DATA_DIRECTORY = "data";
1132
1133
1134
1135 public static final String NVD_API_ENDPOINT = "nvdApiEndpoint";
1136
1137
1138
1139 public static final String NVD_API_KEY = "nvdApiKey";
1140
1141
1142
1143 public static final String NVD_API_MAX_RETRY_COUNT = "nvdMaxRetryCount";
1144
1145
1146
1147
1148 public static final String NVD_API_VALID_FOR_HOURS = "nvdValidForHours";
1149
1150
1151
1152 public static final String NVD_API_DATAFEED_URL = "nvdDatafeed";
1153
1154
1155
1156 public static final String NVD_API_DATAFEED_USER = "nvdUser";
1157
1158
1159
1160 public static final String NVD_API_DATAFEED_PASSWORD = "nvdPassword";
1161
1162
1163
1164 public static final String NVD_API_DELAY = "nvdApiDelay";
1165
1166
1167
1168
1169 public static final String DATA_DIRECTORY_SHORT = "d";
1170
1171
1172
1173 public static final String VERBOSE_LOG = "log";
1174
1175
1176
1177
1178 public static final String VERBOSE_LOG_SHORT = "l";
1179
1180
1181
1182
1183 public static final String SYM_LINK_DEPTH = "symLink";
1184
1185
1186
1187
1188 public static final String SUPPRESSION_FILES = "suppression";
1189
1190
1191
1192 public static final String HINTS_FILE = "hints";
1193
1194
1195
1196 public static final String DISABLE_JAR = "disableJar";
1197
1198
1199
1200 public static final String DISABLE_MSBUILD = "disableMSBuild";
1201
1202
1203
1204 public static final String DISABLE_ARCHIVE = "disableArchive";
1205
1206
1207
1208 public static final String DISABLE_KEV = "disableKnownExploited";
1209
1210
1211
1212 public static final String KEV_URL = "kevURL";
1213
1214
1215
1216 public static final String DISABLE_PY_DIST = "disablePyDist";
1217
1218
1219
1220 public static final String DISABLE_PY_PKG = "disablePyPkg";
1221
1222
1223
1224 public static final String DISABLE_MIX_AUDIT = "disableMixAudit";
1225
1226
1227
1228 public static final String DISABLE_GO_DEP = "disableGolangDep";
1229
1230
1231
1232 public static final String DISABLE_COMPOSER = "disableComposer";
1233
1234
1235
1236 public static final String DISABLE_CPAN = "disableCpan";
1237
1238
1239
1240 public static final String DISABLE_GOLANG_MOD = "disableGolangMod";
1241
1242
1243
1244 public static final String DISABLE_DART = "disableDart";
1245
1246
1247
1248 public static final String PATH_TO_GO = "go";
1249
1250
1251
1252 public static final String PATH_TO_YARN = "yarn";
1253
1254
1255
1256 public static final String PATH_TO_PNPM = "pnpm";
1257
1258
1259
1260 public static final String DISABLE_RUBYGEMS = "disableRubygems";
1261
1262
1263
1264 public static final String DISABLE_AUTOCONF = "disableAutoconf";
1265
1266
1267
1268 public static final String DISABLE_MAVEN_INSTALL = "disableMavenInstall";
1269
1270
1271
1272 public static final String DISABLE_PIP = "disablePip";
1273
1274
1275
1276 public static final String DISABLE_PIPFILE = "disablePipfile";
1277
1278
1279
1280 public static final String DISABLE_POETRY = "disablePoetry";
1281
1282
1283
1284 public static final String DISABLE_CMAKE = "disableCmake";
1285
1286
1287
1288 public static final String DISABLE_COCOAPODS = "disableCocoapodsAnalyzer";
1289
1290
1291
1292 public static final String DISABLE_SWIFT = "disableSwiftPackageManagerAnalyzer";
1293
1294
1295
1296 public static final String DISABLE_SWIFT_RESOLVED = "disableSwiftPackageResolvedAnalyzer";
1297
1298
1299
1300 public static final String DISABLE_ASSEMBLY = "disableAssembly";
1301
1302
1303
1304 public static final String DISABLE_BUNDLE_AUDIT = "disableBundleAudit";
1305
1306
1307
1308 public static final String DISABLE_FILENAME = "disableFileName";
1309
1310
1311
1312 public static final String DISABLE_NUSPEC = "disableNuspec";
1313
1314
1315
1316 public static final String DISABLE_NUGETCONF = "disableNugetconf";
1317
1318
1319
1320 public static final String DISABLE_CENTRAL = "disableCentral";
1321
1322
1323
1324 public static final String DISABLE_CENTRAL_CACHE = "disableCentralCache";
1325
1326
1327
1328 public static final String CENTRAL_URL = "centralUrl";
1329
1330
1331
1332 public static final String ENABLE_NEXUS = "enableNexus";
1333
1334
1335
1336 public static final String DISABLE_OSSINDEX = "disableOssIndex";
1337
1338
1339
1340
1341 public static final String DISABLE_OSSINDEX_CACHE = "disableOssIndexCache";
1342
1343
1344
1345 public static final String OSSINDEX_URL = "ossIndexUrl";
1346
1347
1348
1349 public static final String OSSINDEX_USERNAME = "ossIndexUsername";
1350
1351
1352
1353 public static final String OSSINDEX_PASSWORD = "ossIndexPassword";
1354
1355
1356
1357 public static final String OSSINDEX_WARN_ONLY_ON_REMOTE_ERRORS = "ossIndexRemoteErrorWarnOnly";
1358
1359
1360
1361 public static final String DISABLE_OPENSSL = "disableOpenSSL";
1362
1363
1364
1365 public static final String DISABLE_NODE_JS = "disableNodeJS";
1366
1367
1368
1369 public static final String NODE_PACKAGE_SKIP_DEV_DEPENDENCIES = "nodePackageSkipDevDependencies";
1370
1371
1372
1373 public static final String DISABLE_NODE_AUDIT = "disableNodeAudit";
1374
1375
1376
1377 public static final String DISABLE_YARN_AUDIT = "disableYarnAudit";
1378
1379
1380
1381 public static final String DISABLE_PNPM_AUDIT = "disablePnpmAudit";
1382
1383
1384
1385 public static final String DISABLE_NODE_AUDIT_CACHE = "disableNodeAuditCache";
1386
1387
1388
1389 public static final String DISABLE_NODE_AUDIT_SKIPDEV = "nodeAuditSkipDevDependencies";
1390
1391
1392
1393 public static final String DISABLE_RETIRE_JS = "disableRetireJS";
1394
1395
1396
1397
1398 public static final String RETIRE_JS_FORCEUPDATE = "retireJsForceUpdate";
1399
1400
1401
1402 public static final String RETIREJS_URL = "retireJsUrl";
1403
1404
1405
1406 public static final String RETIREJS_URL_USER = "retireJsUrlUser";
1407
1408
1409
1410 public static final String RETIREJS_URL_PASSWORD = "retireJsUrlPass";
1411
1412
1413
1414 public static final String NEXUS_URL = "nexus";
1415
1416
1417
1418 public static final String NEXUS_USERNAME = "nexusUser";
1419
1420
1421
1422 public static final String NEXUS_PASSWORD = "nexusPass";
1423
1424
1425
1426
1427 public static final String NEXUS_USES_PROXY = "nexusUsesProxy";
1428
1429
1430
1431 public static final String CONNECTION_STRING = "connectionString";
1432
1433
1434
1435 public static final String DB_NAME = "dbUser";
1436
1437
1438
1439 public static final String DB_PASSWORD = "dbPassword";
1440
1441
1442
1443 public static final String DB_DRIVER = "dbDriverName";
1444
1445
1446
1447
1448 public static final String DB_DRIVER_PATH = "dbDriverPath";
1449
1450
1451
1452 public static final String PATH_TO_CORE = "dotnet";
1453
1454
1455
1456 public static final String ADDITIONAL_ZIP_EXTENSIONS = "zipExtensions";
1457
1458
1459
1460 public static final String EXCLUDE = "exclude";
1461
1462
1463
1464
1465 public static final String PATH_TO_BUNDLE_AUDIT = "bundleAudit";
1466
1467
1468
1469
1470
1471
1472 public static final String PATH_TO_BUNDLE_AUDIT_WORKING_DIRECTORY = "bundleAuditWorkingDirectory";
1473
1474
1475
1476
1477 public static final String PATH_TO_MIX_AUDIT = "mixAudit";
1478
1479
1480
1481 public static final String EXPERIMENTAL = "enableExperimental";
1482
1483
1484
1485 public static final String RETIRED = "enableRetired";
1486
1487
1488
1489 public static final String RETIREJS_FILTERS = "retirejsFilter";
1490
1491
1492
1493 public static final String RETIREJS_FILTER_NON_VULNERABLE = "retirejsFilterNonVulnerable";
1494
1495
1496
1497
1498 public static final String ARTIFACTORY_ENABLED = "enableArtifactory";
1499
1500
1501
1502
1503 public static final String ARTIFACTORY_URL = "artifactoryUrl";
1504
1505
1506
1507 public static final String ARTIFACTORY_USERNAME = "artifactoryUsername";
1508
1509
1510
1511 public static final String ARTIFACTORY_API_TOKEN = "artifactoryApiToken";
1512
1513
1514
1515 public static final String ARTIFACTORY_BEARER_TOKEN = "artifactoryBearerToken";
1516
1517
1518
1519
1520 public static final String ARTIFACTORY_USES_PROXY = "artifactoryUseProxy";
1521
1522
1523
1524
1525 public static final String ARTIFACTORY_PARALLEL_ANALYSIS = "artifactoryParallelAnalysis";
1526
1527
1528
1529
1530 public static final String FAIL_ON_CVSS = "failOnCVSS";
1531
1532
1533
1534
1535 public static final String PRETTY_PRINT = "prettyPrint";
1536
1537
1538
1539
1540 public static final String FAIL_JUNIT_ON_CVSS = "junitFailOnCVSS";
1541
1542
1543
1544
1545 public static final String DISABLE_HOSTED_SUPPRESSIONS = "disableHostedSuppressions";
1546
1547
1548
1549
1550 public static final String HOSTED_SUPPRESSIONS_VALID_FOR_HOURS = "hostedSuppressionsValidForHours";
1551
1552
1553
1554
1555 public static final String HOSTED_SUPPRESSIONS_FORCEUPDATE = "hostedSuppressionsForceUpdate";
1556
1557
1558
1559
1560 public static final String HOSTED_SUPPRESSIONS_URL = "hostedSuppressionsUrl";
1561 }
1562 }