Class RetireJsAnalyzer
- java.lang.Object
-
- org.owasp.dependencycheck.analyzer.AbstractAnalyzer
-
- org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer
-
- org.owasp.dependencycheck.analyzer.RetireJsAnalyzer
-
- All Implemented Interfaces:
java.io.FileFilter
,Analyzer
,FileTypeAnalyzer
@ThreadSafe public class RetireJsAnalyzer extends AbstractFileTypeAnalyzer
The RetireJS analyzer uses the manually curated list of vulnerabilities from the RetireJS community along with the necessary information to assist in identifying vulnerable components. Vulnerabilities documented by the RetireJS community usually originate from other sources such as the NVD, OSVDB, NSP, and various issue trackers.- Author:
- Steve Springett
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEPENDENCY_ECOSYSTEM
A descriptor for the type of dependencies processed or added by this analyzer.
-
Constructor Summary
Constructors Constructor Description RetireJsAnalyzer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(java.io.File pathname)
Determines if the file can be analyzed by the analyzer.void
analyzeDependency(Dependency dependency, Engine engine)
Analyzes the specified JavaScript file.protected void
closeAnalyzer()
Closes a given Analyzer.AnalysisPhase
getAnalysisPhase()
Returns the phase that the analyzer is intended to run in.protected java.lang.String
getAnalyzerEnabledSettingKey()
Returns the key used in the properties file to reference the analyzer's enabled property.protected java.io.FileFilter
getFileFilter()
Returns the FileFilter.java.lang.String
getName()
Returns the name of the analyzer.void
initialize(Settings settings)
Initializes the analyzer with the configured settings.protected void
prepareFileTypeAnalyzer(Engine engine)
Prepares the file type analyzer for dependency analysis.-
Methods inherited from class org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer
getFilesMatched, newHashSet, prepareAnalyzer, setFilesMatched
-
Methods inherited from class org.owasp.dependencycheck.analyzer.AbstractAnalyzer
analyze, close, getSettings, isEnabled, prepare, setEnabled, supportsParallelProcessing
-
-
-
-
Field Detail
-
DEPENDENCY_ECOSYSTEM
public static final java.lang.String DEPENDENCY_ECOSYSTEM
A descriptor for the type of dependencies processed or added by this analyzer.- See Also:
- Constant Field Values
-
-
Method Detail
-
getFileFilter
protected java.io.FileFilter getFileFilter()
Returns the FileFilter.- Specified by:
getFileFilter
in classAbstractFileTypeAnalyzer
- Returns:
- the FileFilter
-
accept
public boolean accept(java.io.File pathname)
Determines if the file can be analyzed by the analyzer.- Specified by:
accept
in interfacejava.io.FileFilter
- Overrides:
accept
in classAbstractFileTypeAnalyzer
- Parameters:
pathname
- the path to the file- Returns:
- true if the file can be analyzed by the given analyzer; otherwise false
-
initialize
public void initialize(Settings settings)
Initializes the analyzer with the configured settings.- Specified by:
initialize
in interfaceAnalyzer
- Overrides:
initialize
in classAbstractAnalyzer
- Parameters:
settings
- the configured settings to use
-
prepareFileTypeAnalyzer
protected void prepareFileTypeAnalyzer(Engine engine) throws InitializationException
Prepares the file type analyzer for dependency analysis.- Specified by:
prepareFileTypeAnalyzer
in classAbstractFileTypeAnalyzer
- Parameters:
engine
- a reference to the dependency-check engine- Throws:
InitializationException
- thrown if there is an exception during initialization
-
getName
public java.lang.String getName()
Returns the name of the analyzer.- Returns:
- the name of the analyzer.
-
getAnalysisPhase
public AnalysisPhase getAnalysisPhase()
Returns the phase that the analyzer is intended to run in.- Returns:
- the phase that the analyzer is intended to run in.
-
getAnalyzerEnabledSettingKey
protected java.lang.String getAnalyzerEnabledSettingKey()
Returns the key used in the properties file to reference the analyzer's enabled property.- Specified by:
getAnalyzerEnabledSettingKey
in classAbstractAnalyzer
- Returns:
- the analyzer's enabled property setting key
-
analyzeDependency
public void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException
Analyzes the specified JavaScript file.- Specified by:
analyzeDependency
in 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 file file.
-
closeAnalyzer
protected void closeAnalyzer() throws java.lang.Exception
Description copied from class:AbstractAnalyzer
Closes a given Analyzer. This will be skipped if the analyzer is disabled.- Overrides:
closeAnalyzer
in classAbstractAnalyzer
- Throws:
java.lang.Exception
- thrown if there is an exception
-
-