From e421c785445c0a9fc0ac62f170d1f9347a998b67 Mon Sep 17 00:00:00 2001 From: Kenechukwu Akubue Date: Fri, 4 Oct 2024 00:23:12 +0100 Subject: [PATCH 1/2] setup dependency scan action --- .github/workflows/scan_dependencies.yml | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/scan_dependencies.yml diff --git a/.github/workflows/scan_dependencies.yml b/.github/workflows/scan_dependencies.yml new file mode 100644 index 0000000..bf30377 --- /dev/null +++ b/.github/workflows/scan_dependencies.yml @@ -0,0 +1,49 @@ +name: OWASP Dependency-Check + +on: + push: + branches: + - main + pull_request: + branches: + - "*" + +jobs: + dependency-check: + name: Run OWASP Dependency-Check with GraalVM Java 21 + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up GraalVM Java 21 + uses: graalvm/setup-graalvm@v1 + with: + java-version: '21' + + - name: Cache Gradle packages + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper/ + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build Project + run: ./gradlew build --no-daemon + + - name: Run OWASP Dependency-Check + run: ./gradlew dependencyCheckAnalyze + + - name: Upload Dependency-Check Report + uses: actions/upload-artifact@v3 + with: + name: dependency-check-report + path: build/reports/dependency-check-report/dependency-check-report.html + + - name: Fail if high vulnerabilities found + if: failure() + run: echo "High severity vulnerabilities found! Check the Dependency-Check report." From c483ec9ff47137cf5df3b56f9f1868e3c6153068 Mon Sep 17 00:00:00 2001 From: Kenechukwu Akubue Date: Fri, 4 Oct 2024 00:27:48 +0100 Subject: [PATCH 2/2] add dependencyCheck check task --- build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle b/build.gradle index ee3035b..7c66271 100644 --- a/build.gradle +++ b/build.gradle @@ -210,6 +210,11 @@ dependencies { testImplementation("com.squareup.okhttp3:mockwebserver:5.0.0-alpha.14") } +dependencyCheck { + format = 'HTML' + outputDirectory = 'build/reports/dependency-check-report' // Change to match expected location +} + // Apply a specific Java toolchain to ease working on different environments. java { toolchain {