Skip to content

Commit

Permalink
Configurable OwaspDependencyParserSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouis-r7 committed Nov 24, 2020
1 parent 32f171a commit 8048580
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<commons.compress.version>1.19</commons.compress.version>
<commons.io.version>2.6</commons.io.version>
<jackson.version>[2.9.9,2.10.0)</jackson.version>
<slf4j.version>1.7.25</slf4j.version>
<slf4j.version>1.7.30</slf4j.version>
<dependency.check.version>5.3.2</dependency.check.version>
<!-- test dependencies -->
<hamcrest.version>1.3</hamcrest.version>
Expand Down Expand Up @@ -114,6 +114,12 @@
<groupId>org.owasp</groupId>
<artifactId>dependency-check-core</artifactId>
<version>${dependency.check.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-beanutils</artifactId>
<groupId>commons-beanutils</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public class DockerImageAnalyzerService {
private List<ImageHandler> imageHandlers;

public DockerImageAnalyzerService(String rpmDockerImage) {
this(rpmDockerImage, OwaspDependencyParserSettingsBuilder.EXPERIMENTAL);
}

public DockerImageAnalyzerService(String rpmDockerImage, OwaspDependencyParserSettingsBuilder builder) {
objectMapper = new ObjectMapper();
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
objectMapper.registerModule(new InstantParserModule());
Expand All @@ -88,7 +92,7 @@ public DockerImageAnalyzerService(String rpmDockerImage) {
layerHandlers.add(new DpkgFingerprinter(new DpkgParser()));
layerHandlers.add(new ApkgFingerprinter(new ApkgParser()));
layerHandlers.add(new PacmanFingerprinter(new PacmanPackageParser()));
layerHandlers.add(new OwaspDependencyFingerprinter(new OwaspDependencyParser(OwaspDependencyParserSettingsBuilder.EXPERIMENTAL)));
layerHandlers.add(new OwaspDependencyFingerprinter(new OwaspDependencyParser(builder)));
}

public void addFileHandler(LayerFileHandler handler) {
Expand Down

0 comments on commit 8048580

Please sign in to comment.