Class RetireJsAnalyzer
java.lang.Object
org.owasp.dependencycheck.analyzer.AbstractAnalyzer
org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer
org.owasp.dependencycheck.analyzer.RetireJsAnalyzer
- All Implemented Interfaces:
FileFilter, Analyzer, FileTypeAnalyzer
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, GHSA,
and various issue trackers.
- Author:
- Steve Springett
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA descriptor for the type of dependencies processed or added by this analyzer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if the file can be analyzed by the analyzer.voidanalyzeDependency(Dependency dependency, Engine engine) Analyzes the specified JavaScript file.protected voidCloses a given Analyzer.Returns the phase that the analyzer is intended to run in.protected StringReturns the key used in the properties file to reference the analyzer's enabled property.protected FileFilterReturns the FileFilter.getName()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 AbstractFileTypeAnalyzer
getFilesMatched, newHashSet, prepareAnalyzer, setFilesMatchedMethods inherited from class AbstractAnalyzer
analyze, close, getSettings, isEnabled, prepare, setEnabled, supportsParallelProcessing
-
Field Details
-
DEPENDENCY_ECOSYSTEM
A descriptor for the type of dependencies processed or added by this analyzer.- See Also:
-
-
Constructor Details
-
RetireJsAnalyzer
public RetireJsAnalyzer()
-
-
Method Details
-
getFileFilter
Returns the FileFilter.- Specified by:
getFileFilterin classAbstractFileTypeAnalyzer- Returns:
- the FileFilter
-
accept
Determines if the file can be analyzed by the analyzer.- Specified by:
acceptin interfaceFileFilter- 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
Initializes the analyzer with the configured settings.- Specified by:
initializein interfaceAnalyzer- Overrides:
initializein classAbstractAnalyzer- Parameters:
settings- the configured settings to use
-
prepareFileTypeAnalyzer
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
-
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 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
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
-
closeAnalyzer
Description copied from class:AbstractAnalyzerCloses a given Analyzer. This will be skipped if the analyzer is disabled.- Overrides:
closeAnalyzerin classAbstractAnalyzer- Throws:
Exception- thrown if there is an exception
-