Class NpmCPEAnalyzer
java.lang.Object
org.owasp.dependencycheck.analyzer.AbstractAnalyzer
org.owasp.dependencycheck.analyzer.CPEAnalyzer
org.owasp.dependencycheck.analyzer.NpmCPEAnalyzer
- All Implemented Interfaces:
Analyzer
NpmCPEAnalyzer takes a project dependency and attempts to discern if there is
an associated CPE. Unlike the CPEAnalyzer, the NpmCPEAnalyzer only includes
product and vendor associates known to be related to node from the NVD data
set. It uses the evidence contained within the dependency to search the
Lucene index.
- Author:
- Jeremy Long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidanalyzeDependency(Dependency dependency, Engine engine) Analyzes a dependency and attempts to determine if there are any CPE identifiers for this dependency.Returns the analysis phase that this analyzer should run in.protected StringReturns the setting key to determine if the analyzer is enabled.getName()Returns the name of this analyzer.voidOpens the data source.Methods inherited from class CPEAnalyzer
buildSearch, closeAnalyzer, collectTerms, determineCPE, determineIdentifiers, getCveDB, getMemoryIndex, main, prepareAnalyzer, searchCPE, setCpeSuppressionAnalyzer, setCveDB, setMemoryIndexMethods inherited from class AbstractAnalyzer
analyze, close, getSettings, initialize, isEnabled, prepare, setEnabled, supportsParallelProcessing
-
Constructor Details
-
NpmCPEAnalyzer
public NpmCPEAnalyzer()
-
-
Method Details
-
getAnalysisPhase
Returns the analysis phase that this analyzer should run in.- Specified by:
getAnalysisPhasein interfaceAnalyzer- Overrides:
getAnalysisPhasein classCPEAnalyzer- Returns:
- the analysis phase that this analyzer should run in.
-
getName
Returns the name of this analyzer.- Specified by:
getNamein interfaceAnalyzer- Overrides:
getNamein classCPEAnalyzer- Returns:
- the name of this analyzer.
-
getAnalyzerEnabledSettingKey
Returns the setting key to determine if the analyzer is enabled.
- Overrides:
getAnalyzerEnabledSettingKeyin classCPEAnalyzer- Returns:
- the key for the analyzer's enabled property
-
open
Opens the data source.- Overrides:
openin classCPEAnalyzer- Parameters:
cve- a reference to the NVD CVE database- Throws:
IOException- when the Lucene directory to be queried does not exist or is corrupt.DatabaseException- when the database throws an exception. This usually occurs when the database is in use by another process.
-
analyzeDependency
Analyzes a dependency and attempts to determine if there are any CPE identifiers for this dependency.- Overrides:
analyzeDependencyin classCPEAnalyzer- Parameters:
dependency- The Dependency to analyze.engine- The analysis engine- Throws:
AnalysisException- is thrown if there is an issue analyzing the dependency.
-