Class FalsePositiveAnalyzer
java.lang.Object
org.owasp.dependencycheck.analyzer.AbstractAnalyzer
org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer
- All Implemented Interfaces:
Analyzer
This analyzer attempts to remove some well known false positives -
specifically regarding the java runtime.
- Author:
- Jeremy Long
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PatternRegex to identify core java library files.static final PatternRegex to identify core java libraries and a few other commonly misidentified ones.static final PatternRegex to identify core jsf libraries.static final PatternRegex to identify core jsf java library files. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidanalyzeDependency(Dependency dependency, Engine engine) Analyzes the dependencies and removes bad/incorrect CPE associations based on various heuristics.Returns the phase that the analyzer is intended to run in.protected StringReturns the setting key to determine if the analyzer is enabled.getName()Returns the name of the analyzer.protected voidremoveBadMatches(Dependency dependency) Removes bad CPE matches for a dependency.Methods inherited from class AbstractAnalyzer
analyze, close, closeAnalyzer, getSettings, initialize, isEnabled, prepare, prepareAnalyzer, setEnabled, supportsParallelProcessing
-
Field Details
-
CORE_JAVA
Regex to identify core java libraries and a few other commonly misidentified ones. -
CORE_JAVA_JSF
Regex to identify core jsf libraries. -
CORE_FILES
Regex to identify core java library files. This is currently incomplete. -
CORE_JSF_FILES
Regex to identify core jsf java library files. This is currently incomplete.
-
-
Constructor Details
-
FalsePositiveAnalyzer
public FalsePositiveAnalyzer()
-
-
Method Details
-
getName
-
getAnalysisPhase
Returns the phase that the analyzer is intended to run in.- Returns:
- the phase that the analyzer is intended to run in.
-
getAnalyzerEnabledSettingKey
Returns the setting key to determine if the analyzer is enabled.
- Specified by:
getAnalyzerEnabledSettingKeyin classAbstractAnalyzer- Returns:
- the key for the analyzer's enabled property
-
analyzeDependency
Analyzes the dependencies and removes bad/incorrect CPE associations based on various heuristics.- Specified by:
analyzeDependencyin classAbstractAnalyzer- Parameters:
dependency- the dependency to analyze.engine- the engine that is scanning the dependencies- Throws:
AnalysisException- is thrown if there is an error reading the JAR file.
-
removeBadMatches
Removes bad CPE matches for a dependency. Unfortunately, right now these are hard-coded patches for specific problems identified when testing this on a LARGE volume of jar files.- Parameters:
dependency- the dependency to analyze
-