Class NpmCPEAnalyzer
- java.lang.Object
- 
- org.owasp.dependencycheck.analyzer.AbstractAnalyzer
- 
- org.owasp.dependencycheck.analyzer.CPEAnalyzer
- 
- org.owasp.dependencycheck.analyzer.NpmCPEAnalyzer
 
 
 
- 
- All Implemented Interfaces:
- Analyzer
 
 @ThreadSafe public class NpmCPEAnalyzer extends CPEAnalyzer 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 SummaryConstructors Constructor Description NpmCPEAnalyzer()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidanalyzeDependency(Dependency dependency, Engine engine)Analyzes a dependency and attempts to determine if there are any CPE identifiers for this dependency.AnalysisPhasegetAnalysisPhase()Returns the analysis phase that this analyzer should run in.protected java.lang.StringgetAnalyzerEnabledSettingKey()Returns the setting key to determine if the analyzer is enabled.java.lang.StringgetName()Returns the name of this analyzer.voidopen(CveDB cve)Opens the data source.- 
Methods inherited from class org.owasp.dependencycheck.analyzer.CPEAnalyzerbuildSearch, closeAnalyzer, collectTerms, determineCPE, determineIdentifiers, getCveDB, getMemoryIndex, main, prepareAnalyzer, searchCPE, setCpeSuppressionAnalyzer, setCveDB, setMemoryIndex
 - 
Methods inherited from class org.owasp.dependencycheck.analyzer.AbstractAnalyzeranalyze, close, getSettings, initialize, isEnabled, prepare, setEnabled, supportsParallelProcessing
 
- 
 
- 
- 
- 
Method Detail- 
getAnalysisPhasepublic AnalysisPhase getAnalysisPhase() Returns the analysis phase that this analyzer should run in.- Specified by:
- getAnalysisPhasein interface- Analyzer
- Overrides:
- getAnalysisPhasein class- CPEAnalyzer
- Returns:
- the analysis phase that this analyzer should run in.
 
 - 
getNamepublic java.lang.String getName() Returns the name of this analyzer.- Specified by:
- getNamein interface- Analyzer
- Overrides:
- getNamein class- CPEAnalyzer
- Returns:
- the name of this analyzer.
 
 - 
getAnalyzerEnabledSettingKeyprotected java.lang.String getAnalyzerEnabledSettingKey() Returns the setting key to determine if the analyzer is enabled. - Overrides:
- getAnalyzerEnabledSettingKeyin class- CPEAnalyzer
- Returns:
- the key for the analyzer's enabled property
 
 - 
openpublic void open(CveDB cve) throws java.io.IOException, DatabaseException Opens the data source.- Overrides:
- openin class- CPEAnalyzer
- Parameters:
- cve- a reference to the NVD CVE database
- Throws:
- java.io.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.
 
 - 
analyzeDependencyprotected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException Analyzes a dependency and attempts to determine if there are any CPE identifiers for this dependency.- Overrides:
- analyzeDependencyin class- CPEAnalyzer
- Parameters:
- dependency- The Dependency to analyze.
- engine- The analysis engine
- Throws:
- AnalysisException- is thrown if there is an issue analyzing the dependency.
 
 
- 
 
-