Class AssemblyAnalyzer
java.lang.Object
org.owasp.dependencycheck.analyzer.AbstractAnalyzer
org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer
org.owasp.dependencycheck.analyzer.AssemblyAnalyzer
- All Implemented Interfaces:
FileFilter, Analyzer, FileTypeAnalyzer
Analyzer for getting company, product, and version information from a .NET
assembly.
- Author:
- colezlaw
-
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 TypeMethodDescriptionprotected static voidaddMatchingValues(List<String> packages, String value, Dependency dep, EvidenceType type) Cycles through the collection of class name information to see if parts of the package names are contained in the provided value.voidanalyzeDependency(Dependency dependency, Engine engine) Performs the analysis on a single Dependency.Builds the beginnings of a List for ProcessBuildervoidRemoves resources used from the local file system.Returns the phase this analyzer runs under.protected StringReturns the key used in the properties file to reference the analyzer's enabled property.protected FileFilterReturns theFileFilterused to determine which files are to be analyzed.getName()Gets this analyzer's name.voidprepareFileTypeAnalyzer(Engine engine) Initialize the analyzer.Methods inherited from class AbstractFileTypeAnalyzer
accept, getFilesMatched, newHashSet, prepareAnalyzer, setFilesMatchedMethods inherited from class AbstractAnalyzer
analyze, close, getSettings, initialize, isEnabled, prepare, setEnabled, supportsParallelProcessingMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Analyzer
analyze, close, initialize, isEnabled, prepare, supportsParallelProcessing
-
Field Details
-
DEPENDENCY_ECOSYSTEM
A descriptor for the type of dependencies processed or added by this analyzer.- See Also:
-
-
Constructor Details
-
AssemblyAnalyzer
public AssemblyAnalyzer()
-
-
Method Details
-
buildArgumentList
-
analyzeDependency
Performs the analysis on a single Dependency.- Specified by:
analyzeDependencyin classAbstractAnalyzer- Parameters:
dependency- the dependency to analyzeengine- the engine to perform the analysis under- Throws:
AnalysisException- if anything goes sideways
-
prepareFileTypeAnalyzer
Initialize the analyzer. In this case, extract GrokAssembly.dll to a temporary location.- Specified by:
prepareFileTypeAnalyzerin classAbstractFileTypeAnalyzer- Parameters:
engine- a reference to the dependency-check engine- Throws:
InitializationException- thrown if anything goes wrong
-
closeAnalyzer
Removes resources used from the local file system.- Overrides:
closeAnalyzerin classAbstractAnalyzer- Throws:
Exception- thrown if there is a problem closing the analyzer
-
getFileFilter
Description copied from class:AbstractFileTypeAnalyzerReturns the
FileFilterused to determine which files are to be analyzed. An example would be an analyzer that inspected Java jar files. Implementors may useFileFilterBuilder.If the analyzer returns null it will not cause additional files to be analyzed, but will be executed against every file loaded.
- Specified by:
getFileFilterin classAbstractFileTypeAnalyzer- Returns:
- the file filter used to determine which files are to be analyzed
-
getName
-
getAnalysisPhase
Returns the phase this analyzer runs under.- Returns:
- the phase this runs under
-
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
-
addMatchingValues
protected static void addMatchingValues(List<String> packages, String value, Dependency dep, EvidenceType type) Cycles through the collection of class name information to see if parts of the package names are contained in the provided value. If found, it will be added as the HIGHEST confidence evidence because we have more then one source corroborating the value.- Parameters:
packages- a collection of class name informationvalue- the value to check to see if it contains a package namedep- the dependency to add new entries tootype- the type of evidence (vendor, product, or version)
-