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.StringDEPENDENCY_ECOSYSTEMA 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 booleanaccept(java.io.File pathname)Determines if the file can be analyzed by the analyzer.voidanalyzeDependency(Dependency dependency, Engine engine)Analyzes the specified JavaScript file.protected voidcloseAnalyzer()Closes a given Analyzer.AnalysisPhasegetAnalysisPhase()Returns the phase that the analyzer is intended to run in.protected java.lang.StringgetAnalyzerEnabledSettingKey()Returns the key used in the properties file to reference the analyzer's enabled property.protected java.io.FileFiltergetFileFilter()Returns the FileFilter.java.lang.StringgetName()Returns the name of the analyzer.voidinitialize(Settings settings)Initializes the analyzer with the configured settings.protected voidprepareFileTypeAnalyzer(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:
getFileFilterin classAbstractFileTypeAnalyzer- Returns:
- the FileFilter
-
accept
public boolean accept(java.io.File pathname)
Determines if the file can be analyzed by the analyzer.- Specified by:
acceptin interfacejava.io.FileFilter- Overrides:
acceptin 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:
initializein interfaceAnalyzer- Overrides:
initializein 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:
prepareFileTypeAnalyzerin 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:
getAnalyzerEnabledSettingKeyin 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:
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 file file.
-
closeAnalyzer
protected void closeAnalyzer() throws java.lang.ExceptionDescription copied from class:AbstractAnalyzerCloses a given Analyzer. This will be skipped if the analyzer is disabled.- Overrides:
closeAnalyzerin classAbstractAnalyzer- Throws:
java.lang.Exception- thrown if there is an exception
-
-