com.danielsomerfield.cvecheck.FileVulnerabilities.groovy Maven / Gradle / Ivy
package com.danielsomerfield.cvecheck
import org.owasp.dependencycheck.Engine
import org.owasp.dependencycheck.dependency.Dependency
import org.owasp.dependencycheck.dependency.Vulnerability
class FileVulnerabilities {
def static List getVulnerabilitiesForFiles(Engine engine, Collection files){
files.each {
engine.scan(it)
}
engine.analyzeDependencies()
engine.getDependencies().collect { Dependency dependency ->
dependency.getVulnerabilities()
}.flatten()
}
}