From 44eb0fd9a534a694a402b252654ed6303a8d9ca1 Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 23 Jun 2026 17:02:53 +0200 Subject: [PATCH 01/12] improve ci --- .github/workflows/dependency-check-develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dependency-check-develop.yml b/.github/workflows/dependency-check-develop.yml index ff66c32..c5c5a92 100644 --- a/.github/workflows/dependency-check-develop.yml +++ b/.github/workflows/dependency-check-develop.yml @@ -1,6 +1,7 @@ name: Dependency Check (Develop Cache Builder) on: + push: schedule: - cron: "0 0 * * *" # midnight daily workflow_dispatch: From 6ab08a6063274397d14fec7e74dedb421f8c98d4 Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 23 Jun 2026 17:11:57 +0200 Subject: [PATCH 02/12] update CI --- .github/workflows/dependency-check-develop.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/dependency-check-develop.yml b/.github/workflows/dependency-check-develop.yml index c5c5a92..a5643ea 100644 --- a/.github/workflows/dependency-check-develop.yml +++ b/.github/workflows/dependency-check-develop.yml @@ -67,6 +67,15 @@ jobs: run: | echo " No changes and no force → skipping." exit 0 + + # Restore Maven dependencies + - name: Cache Maven dependencies + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2- # Restore cache (always) - name: Restore Dependency-Check cache From 375ef15e01c8d0887023c057cf3ae0d47a5381b9 Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 23 Jun 2026 17:15:54 +0200 Subject: [PATCH 03/12] Fix CI --- .github/workflows/dependency-check-develop.yml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependency-check-develop.yml b/.github/workflows/dependency-check-develop.yml index a5643ea..e1e3bf3 100644 --- a/.github/workflows/dependency-check-develop.yml +++ b/.github/workflows/dependency-check-develop.yml @@ -98,7 +98,7 @@ jobs: if [ "$STATUS" = "200" ]; then echo "Updating DB..." - if mvn org.owasp:dependency-check-maven:12.2.0:update-only \ + if mvn org.owasp:dependency-check-maven:update-only \ -DnvdApiKey=${NVD_API_KEY}; then echo "success=true" >> $GITHUB_OUTPUT else diff --git a/pom.xml b/pom.xml index 63f1a4a..459f7b2 100644 --- a/pom.xml +++ b/pom.xml @@ -145,8 +145,8 @@ 0 resources/dependency-check-suppress.xml - ${env.OSS_INDEX_USERNAME} ${env.OSS_INDEX_PASSWORD} + ${env.NVD_API_KEY} From a967007ddfc63c4bcaf5965ba8a4146f8191a5e2 Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 23 Jun 2026 17:19:57 +0200 Subject: [PATCH 04/12] improve CI --- .github/workflows/dependency-check-develop.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/dependency-check-develop.yml b/.github/workflows/dependency-check-develop.yml index e1e3bf3..5af0257 100644 --- a/.github/workflows/dependency-check-develop.yml +++ b/.github/workflows/dependency-check-develop.yml @@ -87,6 +87,8 @@ jobs: # Try updating the DB (safe) - name: Update NVD DB id: update + env: + NVD_API_KEY: ${{ secrets.NVD_API_KEY }} run: | echo "Checking NVD availability..." @@ -124,6 +126,8 @@ jobs: # Run scan (ONLY if not update-only) - name: Run Dependency-Check if: github.event.inputs.update_only != 'true' + env: + NVD_API_KEY: ${{ secrets.NVD_API_KEY }} run: | mvn dependency-check:check \ -Ddependency-check.skipUpdates=true \ From bc362839d593774696d1b596c71cb13aadb4422d Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 23 Jun 2026 17:30:57 +0200 Subject: [PATCH 05/12] Improve CI --- .../workflows/dependency-check-develop.yml | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependency-check-develop.yml b/.github/workflows/dependency-check-develop.yml index 5af0257..6abb587 100644 --- a/.github/workflows/dependency-check-develop.yml +++ b/.github/workflows/dependency-check-develop.yml @@ -89,6 +89,10 @@ jobs: id: update env: NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + NVD_MAX_RETRY: "50" + NVD_API_DELAY: "6000" + NVD_VALID_HOURS: "720" + NVD_RESULTS_PER_PAGE: "2000" run: | echo "Checking NVD availability..." @@ -101,7 +105,11 @@ jobs: echo "Updating DB..." if mvn org.owasp:dependency-check-maven:update-only \ - -DnvdApiKey=${NVD_API_KEY}; then + -DnvdApiKey=${NVD_API_KEY} \ + -DnvdMaxRetryCount=${NVD_MAX_RETRY} \ + -DnvdApiDelay=${NVD_API_DELAY} \ + -DnvdValidForHours=${NVD_VALID_HOURS} \ + -DnvdApiResultsPerPage=${NVD_RESULTS_PER_PAGE}; then echo "success=true" >> $GITHUB_OUTPUT else echo "success=false" >> $GITHUB_OUTPUT @@ -128,10 +136,19 @@ jobs: if: github.event.inputs.update_only != 'true' env: NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + NVD_MAX_RETRY: "50" + NVD_API_DELAY: "6000" + NVD_VALID_HOURS: "720" + NVD_RESULTS_PER_PAGE: "2000" run: | mvn dependency-check:check \ -Ddependency-check.skipUpdates=true \ - -DfailOnError=false + -DfailOnError=false \ + -DnvdApiKey=${NVD_API_KEY} \ + -DnvdMaxRetryCount=${NVD_MAX_RETRY} \ + -DnvdApiDelay=${NVD_API_DELAY} \ + -DnvdValidForHours=${NVD_VALID_HOURS} \ + -DnvdApiResultsPerPage=${NVD_RESULTS_PER_PAGE} # Persist last commit - name: Save commit state From e87a9f46f305f1a480e166def4d6ca08fc8e6a5a Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 30 Jun 2026 08:49:52 +0200 Subject: [PATCH 06/12] add OSS_INDEX_PASSWORD --- .github/workflows/dependency-check-develop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dependency-check-develop.yml b/.github/workflows/dependency-check-develop.yml index 6abb587..1681877 100644 --- a/.github/workflows/dependency-check-develop.yml +++ b/.github/workflows/dependency-check-develop.yml @@ -89,6 +89,7 @@ jobs: id: update env: NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} NVD_MAX_RETRY: "50" NVD_API_DELAY: "6000" NVD_VALID_HOURS: "720" @@ -136,6 +137,7 @@ jobs: if: github.event.inputs.update_only != 'true' env: NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} NVD_MAX_RETRY: "50" NVD_API_DELAY: "6000" NVD_VALID_HOURS: "720" From a238e9e87dedee3b5976cb9c0de94a3fabfbf91b Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 30 Jun 2026 08:56:00 +0200 Subject: [PATCH 07/12] Upgrade dependency --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 459f7b2..583ca48 100644 --- a/pom.xml +++ b/pom.xml @@ -262,7 +262,7 @@ com.fasterxml.jackson.core jackson-databind - 2.20.0 + 2.22.0 com.fasterxml.jackson.datatype @@ -273,7 +273,7 @@ com.fasterxml.jackson.dataformat jackson-dataformat-yaml - 2.20.1 + 2.22.0 From a77591d10c77c1828f7f404c2624b3fa279750d5 Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 30 Jun 2026 09:08:55 +0200 Subject: [PATCH 08/12] Update CI/CD --- .github/workflows/dependency-check-develop.yml | 2 ++ .github/workflows/dependency-check.yml | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dependency-check-develop.yml b/.github/workflows/dependency-check-develop.yml index 1681877..da4faec 100644 --- a/.github/workflows/dependency-check-develop.yml +++ b/.github/workflows/dependency-check-develop.yml @@ -2,6 +2,8 @@ name: Dependency Check (Develop Cache Builder) on: push: + branches: + - develop schedule: - cron: "0 0 * * *" # midnight daily workflow_dispatch: diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index d6bba78..a4389f2 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -7,11 +7,24 @@ on: jobs: dependency-check: runs-on: ubuntu-latest + + env: + NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} steps: # Checkout current branch - name: Checkout uses: actions/checkout@v4 + + # Restore Maven dependencies + - name: Cache Maven dependencies + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2- # Restore cache - name: Restore Dependency-Check cache @@ -43,7 +56,7 @@ jobs: - name: Skip if DB missing if: steps.dbcheck.outputs.exists != 'true' run: | - echo "⚠️ No cached DB available — skipping scan." + echo "No cached DB available — skipping scan." # Upload report - name: Upload report From e4fd757c398eefcf5fd5f6618bc476c25929fbfd Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 30 Jun 2026 09:38:25 +0200 Subject: [PATCH 09/12] Adding username for OSS --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 583ca48..00d7818 100644 --- a/pom.xml +++ b/pom.xml @@ -145,6 +145,7 @@ 0 resources/dependency-check-suppress.xml + ${env.OSS_INDEX_USERNAME} ${env.OSS_INDEX_PASSWORD} ${env.NVD_API_KEY} From e6b65b752ad65d0aa39d6abedb0cc5e90d1e4f04 Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 30 Jun 2026 10:00:44 +0200 Subject: [PATCH 10/12] Update workflows --- .../workflows/dependency-check-develop.yml | 105 +++++------------- .github/workflows/dependency-check.yml | 29 +++-- 2 files changed, 39 insertions(+), 95 deletions(-) diff --git a/.github/workflows/dependency-check-develop.yml b/.github/workflows/dependency-check-develop.yml index da4faec..00cdf5e 100644 --- a/.github/workflows/dependency-check-develop.yml +++ b/.github/workflows/dependency-check-develop.yml @@ -1,15 +1,12 @@ -name: Dependency Check (Develop Cache Builder) +name: Dependency Check (Cache Builder) on: - push: - branches: - - develop schedule: - - cron: "0 0 * * *" # midnight daily + - cron: "0 0 * * *" # runs daily at 00:00 UTC workflow_dispatch: inputs: force_update: - description: "Force update even if no changes" + description: "Force update even if already fresh" required: false default: "false" update_only: @@ -18,58 +15,14 @@ on: default: "false" jobs: - dependency-check-develop: + dependency-check-cache: runs-on: ubuntu-latest - env: - NVD_API_KEY: ${{ secrets.NVD_API_KEY }} - steps: - # Checkout develop branch - - name: Checkout develop + # Checkout repository (default branch) + - name: Checkout uses: actions/checkout@v4 - with: - ref: develop - - # Get current commit hash - - name: Get current commit - id: current - run: echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - # Restore last processed commit - - name: Restore last state - uses: actions/download-artifact@v4 - with: - name: last-run-state - continue-on-error: true - - - name: Read last commit - id: lastcommit - run: | - if [ -f last_commit.txt ]; then - LAST=$(cat last_commit.txt) - else - LAST="none" - fi - echo "last=$LAST" >> $GITHUB_OUTPUT - - # Detect changes - - name: Detect changes - id: compare - run: | - if [ "${{ steps.current.outputs.commit }}" = "${{ steps.lastcommit.outputs.last }}" ]; then - echo "changed=false" >> $GITHUB_OUTPUT - else - echo "changed=true" >> $GITHUB_OUTPUT - fi - # Skip unless change OR forced - - name: Skip if no changes - if: steps.compare.outputs.changed == 'false' && github.event.inputs.force_update != 'true' - run: | - echo " No changes and no force → skipping." - exit 0 - # Restore Maven dependencies - name: Cache Maven dependencies uses: actions/cache@v4 @@ -79,22 +32,31 @@ jobs: restore-keys: | ${{ runner.os }}-m2- - # Restore cache (always) + # Restore Dependency-Check cache - name: Restore Dependency-Check cache + id: dccache uses: actions/cache/restore@v4 with: path: ~/.m2/repository/org/owasp/dependency-check-data key: dependency-check-${{ runner.os }}-${{ runner.arch }} - # Try updating the DB (safe) + # Debug cache state + - name: Debug cache state + run: | + echo "Cache hit: ${{ steps.dccache.outputs.cache-hit }}" + ls -la ~/.m2/repository/org/owasp || true + ls -la ~/.m2/repository/org/owasp/dependency-check-data || true + + # Update NVD DB - name: Update NVD DB id: update env: NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }} OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} NVD_MAX_RETRY: "50" NVD_API_DELAY: "6000" - NVD_VALID_HOURS: "720" + NVD_VALID_HOURS: "24" NVD_RESULTS_PER_PAGE: "2000" run: | echo "Checking NVD availability..." @@ -118,6 +80,7 @@ jobs: echo "success=false" >> $GITHUB_OUTPUT fi else + echo "NVD unavailable → skipping update" echo "success=false" >> $GITHUB_OUTPUT fi @@ -129,46 +92,28 @@ jobs: path: ~/.m2/repository/org/owasp/dependency-check-data key: dependency-check-${{ runner.os }}-${{ runner.arch }} - # Info for update-only mode + # Update-only mode info - name: Info (update-only mode) if: github.event.inputs.update_only == 'true' run: echo "Update-only mode enabled → skipping scan" - # Run scan (ONLY if not update-only) + # Run scan (optional) - name: Run Dependency-Check if: github.event.inputs.update_only != 'true' env: NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }} OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} - NVD_MAX_RETRY: "50" - NVD_API_DELAY: "6000" - NVD_VALID_HOURS: "720" - NVD_RESULTS_PER_PAGE: "2000" run: | mvn dependency-check:check \ -Ddependency-check.skipUpdates=true \ - -DfailOnError=false \ - -DnvdApiKey=${NVD_API_KEY} \ - -DnvdMaxRetryCount=${NVD_MAX_RETRY} \ - -DnvdApiDelay=${NVD_API_DELAY} \ - -DnvdValidForHours=${NVD_VALID_HOURS} \ - -DnvdApiResultsPerPage=${NVD_RESULTS_PER_PAGE} - - # Persist last commit - - name: Save commit state - run: echo "${{ steps.current.outputs.commit }}" > last_commit.txt - - - name: Upload commit state - uses: actions/upload-artifact@v4 - with: - name: last-run-state - path: last_commit.txt - + -DfailOnError=false + # Upload report - name: Upload report if: github.event.inputs.update_only != 'true' uses: actions/upload-artifact@v4 with: - name: dependency-check-report-develop + name: dependency-check-report path: target/dependency-check-report.html if-no-files-found: ignore \ No newline at end of file diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index a4389f2..3ccbe92 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -7,18 +7,12 @@ on: jobs: dependency-check: runs-on: ubuntu-latest - - env: - NVD_API_KEY: ${{ secrets.NVD_API_KEY }} - OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} steps: - # Checkout current branch - - name: Checkout + - name: Checkout Current Branch uses: actions/checkout@v4 - - # Restore Maven dependencies - - name: Cache Maven dependencies + + - name: Restore Cached Maven Dependencies uses: actions/cache@v4 with: path: ~/.m2/repository @@ -26,7 +20,6 @@ jobs: restore-keys: | ${{ runner.os }}-m2- - # Restore cache - name: Restore Dependency-Check cache id: cache uses: actions/cache/restore@v4 @@ -34,26 +27,32 @@ jobs: path: ~/.m2/repository/org/owasp/dependency-check-data key: dependency-check-${{ runner.os }}-${{ runner.arch }} - # Check DB availability - - name: Check DB existence + - name: Check Cached Dependency-Check DB existence id: dbcheck run: | - if [ -d ~/.m2/repository/org/owasp/dependency-check-data ]; then + echo "Checking Dependency-Check DB..." + if ls ~/.m2/repository/org/owasp/dependency-check-data/*.db 1> /dev/null 2>&1; then + echo "Valid DB found" echo "exists=true" >> $GITHUB_OUTPUT else + echo "No DB files found" echo "exists=false" >> $GITHUB_OUTPUT fi # Run scan (offline only) - - name: Run Dependency-Check + - name: Run Dependency-Check (if cached DB awailable) if: steps.dbcheck.outputs.exists == 'true' + env: + NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }} + OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} run: | mvn dependency-check:check \ -Ddependency-check.skipUpdates=true \ -DfailOnError=false # Skip safely if no DB - - name: Skip if DB missing + - name: Skip if cached Dependency DB missing if: steps.dbcheck.outputs.exists != 'true' run: | echo "No cached DB available — skipping scan." From 8be814d6ec29fb7bb5a02fb1cfd0e54eeb2ffc72 Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 7 Jul 2026 09:46:32 +0200 Subject: [PATCH 11/12] Exclude dependency check plugin --- .../workflows/code-quality-check-sonar.yml | 3 +- .../workflows/dependency-check-develop.yml | 119 ------------------ .github/workflows/dependency-check.yml | 67 ---------- pom.xml | 4 +- 4 files changed, 4 insertions(+), 189 deletions(-) delete mode 100644 .github/workflows/dependency-check-develop.yml delete mode 100644 .github/workflows/dependency-check.yml diff --git a/.github/workflows/code-quality-check-sonar.yml b/.github/workflows/code-quality-check-sonar.yml index 92963ef..da768c3 100644 --- a/.github/workflows/code-quality-check-sonar.yml +++ b/.github/workflows/code-quality-check-sonar.yml @@ -42,7 +42,8 @@ jobs: # note that we deliberately turn off the OWASP dependency checker here, it will run in a separate job, # such that its results can be viewed independently of what Sonar has to say run: | - mvn -B verify sonar:sonar -Dsonar.projectKey=siemens_cmp-ra-component -Ddependency-check.skip=true -Dgpg.skip + mvn -B verify sonar:sonar -Dsonar.projectKey=siemens_cmp-ra-component -Dgpg.skip + # mvn -B verify sonar:sonar -Dsonar.projectKey=siemens_cmp-ra-component -Ddependency-check.skip=true -Dgpg.skip # analyze_dependencies_owasp: # name: Check dependencies with OWASP diff --git a/.github/workflows/dependency-check-develop.yml b/.github/workflows/dependency-check-develop.yml deleted file mode 100644 index 00cdf5e..0000000 --- a/.github/workflows/dependency-check-develop.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Dependency Check (Cache Builder) - -on: - schedule: - - cron: "0 0 * * *" # runs daily at 00:00 UTC - workflow_dispatch: - inputs: - force_update: - description: "Force update even if already fresh" - required: false - default: "false" - update_only: - description: "Only update cache (skip scan)" - required: false - default: "false" - -jobs: - dependency-check-cache: - runs-on: ubuntu-latest - - steps: - # Checkout repository (default branch) - - name: Checkout - uses: actions/checkout@v4 - - # Restore Maven dependencies - - name: Cache Maven dependencies - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-m2- - - # Restore Dependency-Check cache - - name: Restore Dependency-Check cache - id: dccache - uses: actions/cache/restore@v4 - with: - path: ~/.m2/repository/org/owasp/dependency-check-data - key: dependency-check-${{ runner.os }}-${{ runner.arch }} - - # Debug cache state - - name: Debug cache state - run: | - echo "Cache hit: ${{ steps.dccache.outputs.cache-hit }}" - ls -la ~/.m2/repository/org/owasp || true - ls -la ~/.m2/repository/org/owasp/dependency-check-data || true - - # Update NVD DB - - name: Update NVD DB - id: update - env: - NVD_API_KEY: ${{ secrets.NVD_API_KEY }} - OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }} - OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} - NVD_MAX_RETRY: "50" - NVD_API_DELAY: "6000" - NVD_VALID_HOURS: "24" - NVD_RESULTS_PER_PAGE: "2000" - run: | - echo "Checking NVD availability..." - - STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ - "https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=1") - - echo "NVD status: $STATUS" - - if [ "$STATUS" = "200" ]; then - echo "Updating DB..." - - if mvn org.owasp:dependency-check-maven:update-only \ - -DnvdApiKey=${NVD_API_KEY} \ - -DnvdMaxRetryCount=${NVD_MAX_RETRY} \ - -DnvdApiDelay=${NVD_API_DELAY} \ - -DnvdValidForHours=${NVD_VALID_HOURS} \ - -DnvdApiResultsPerPage=${NVD_RESULTS_PER_PAGE}; then - echo "success=true" >> $GITHUB_OUTPUT - else - echo "success=false" >> $GITHUB_OUTPUT - fi - else - echo "NVD unavailable → skipping update" - echo "success=false" >> $GITHUB_OUTPUT - fi - - # Save cache ONLY if update succeeded - - name: Save updated cache - if: steps.update.outputs.success == 'true' - uses: actions/cache/save@v4 - with: - path: ~/.m2/repository/org/owasp/dependency-check-data - key: dependency-check-${{ runner.os }}-${{ runner.arch }} - - # Update-only mode info - - name: Info (update-only mode) - if: github.event.inputs.update_only == 'true' - run: echo "Update-only mode enabled → skipping scan" - - # Run scan (optional) - - name: Run Dependency-Check - if: github.event.inputs.update_only != 'true' - env: - NVD_API_KEY: ${{ secrets.NVD_API_KEY }} - OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }} - OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} - run: | - mvn dependency-check:check \ - -Ddependency-check.skipUpdates=true \ - -DfailOnError=false - - # Upload report - - name: Upload report - if: github.event.inputs.update_only != 'true' - uses: actions/upload-artifact@v4 - with: - name: dependency-check-report - path: target/dependency-check-report.html - if-no-files-found: ignore \ No newline at end of file diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml deleted file mode 100644 index 3ccbe92..0000000 --- a/.github/workflows/dependency-check.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Dependency Check (Cached Only) - -on: - push: - pull_request: - -jobs: - dependency-check: - runs-on: ubuntu-latest - - steps: - - name: Checkout Current Branch - uses: actions/checkout@v4 - - - name: Restore Cached Maven Dependencies - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-m2- - - - name: Restore Dependency-Check cache - id: cache - uses: actions/cache/restore@v4 - with: - path: ~/.m2/repository/org/owasp/dependency-check-data - key: dependency-check-${{ runner.os }}-${{ runner.arch }} - - - name: Check Cached Dependency-Check DB existence - id: dbcheck - run: | - echo "Checking Dependency-Check DB..." - if ls ~/.m2/repository/org/owasp/dependency-check-data/*.db 1> /dev/null 2>&1; then - echo "Valid DB found" - echo "exists=true" >> $GITHUB_OUTPUT - else - echo "No DB files found" - echo "exists=false" >> $GITHUB_OUTPUT - fi - - # Run scan (offline only) - - name: Run Dependency-Check (if cached DB awailable) - if: steps.dbcheck.outputs.exists == 'true' - env: - NVD_API_KEY: ${{ secrets.NVD_API_KEY }} - OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }} - OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} - run: | - mvn dependency-check:check \ - -Ddependency-check.skipUpdates=true \ - -DfailOnError=false - - # Skip safely if no DB - - name: Skip if cached Dependency DB missing - if: steps.dbcheck.outputs.exists != 'true' - run: | - echo "No cached DB available — skipping scan." - - # Upload report - - name: Upload report - if: always() - uses: actions/upload-artifact@v4 - with: - name: dependency-check-report - path: target/dependency-check-report.html - if-no-files-found: ignore \ No newline at end of file diff --git a/pom.xml b/pom.xml index 00d7818..55ceb00 100644 --- a/pom.xml +++ b/pom.xml @@ -131,7 +131,7 @@ - + org.jacoco jacoco-maven-plugin From 6cfa3204b729c483d09dc4d03bfb8c8687a0adb0 Mon Sep 17 00:00:00 2001 From: Zoltan Maradics Date: Tue, 7 Jul 2026 09:57:52 +0200 Subject: [PATCH 12/12] Remove unused codes --- .../workflows/code-quality-check-sonar.yml | 26 ------------------- pom.xml | 21 +-------------- 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/.github/workflows/code-quality-check-sonar.yml b/.github/workflows/code-quality-check-sonar.yml index da768c3..c727eb8 100644 --- a/.github/workflows/code-quality-check-sonar.yml +++ b/.github/workflows/code-quality-check-sonar.yml @@ -43,29 +43,3 @@ jobs: # such that its results can be viewed independently of what Sonar has to say run: | mvn -B verify sonar:sonar -Dsonar.projectKey=siemens_cmp-ra-component -Dgpg.skip - # mvn -B verify sonar:sonar -Dsonar.projectKey=siemens_cmp-ra-component -Ddependency-check.skip=true -Dgpg.skip - -# analyze_dependencies_owasp: -# name: Check dependencies with OWASP -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# with: -# fetch-depth: 0 -# - name: Set up JDK 17 -# uses: actions/setup-java@v4 -# with: -# java-version: 17 -# distribution: 'temurin' -# - name: Cache Maven packages -# uses: actions/cache@v4 -# with: -# path: ~/.m2 -# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} -# restore-keys: ${{ runner.os }}-m2 -# - name: Analyze dependencies -# env: -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} -# OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }} -# run: mvn dependency-check:check -DnvdApiKey=${{ secrets.NVD_TOKEN }} diff --git a/pom.xml b/pom.xml index 55ceb00..090e410 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ com.siemens.pki CmpRaComponent jar - 4.3.0 + 4.4.0 UTF-8 . @@ -131,25 +131,6 @@ - org.jacoco jacoco-maven-plugin