Skip to content

Commit

Permalink
Check for security vulnerabilities
Browse files Browse the repository at this point in the history
Use Gradle dependency-check plugin to check for security
vulnerabilities.

Command:

   ./gradlew dependencyCheckAnalyze

Documentation:
https://jeremylong.github.io/DependencyCheck/dependency-check-cli
https://github.com/dependency-check/dependency-check-gradle
  • Loading branch information
nicokosi committed May 2, 2024
1 parent 07a8e16 commit b5cfc24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ jobs:

- name: Build with Gradle
run: ./gradlew build

- name: Check for security vulnerabilities
run: ./gradlew dependencyCheckAnalyze --nvdApiKey ${{ secrets.NVD_API_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,4 @@ gradle-app.setting

# My stuff 🙂
pullpitoK.build_artifacts.txt
/dependency-check-report.html
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id("com.adarshr.test-logger") version "4.0.0"
id("com.diffplug.spotless") version "6.25.0"
id("org.sonarqube") version "4.4.1.3373"
id("org.owasp.dependencycheck") version "9.1.0" apply false
application
}

Expand All @@ -18,6 +19,7 @@ repositories {
dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:2.17.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.owasp:dependency-check-gradle:9.1.0")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
testImplementation("com.github.tomakehurst:wiremock-jre8:3.0.1")
Expand Down Expand Up @@ -79,3 +81,11 @@ tasks.register<Jar>("uberJar") {
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}

allprojects {
apply(plugin = "org.owasp.dependencycheck")
}

configure<org.owasp.dependencycheck.gradle.extension.DependencyCheckExtension> {
format = org.owasp.dependencycheck.reporting.ReportGenerator.Format.ALL.toString()
}

0 comments on commit b5cfc24

Please sign in to comment.