Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75244

Dependency-Check Reports Overwriting in Jenkins Pipeline for Frontend and Backend Projects

      Hello,

      I am currently working on a Jenkins pipeline where I scan two different projects (Frontend and Backend) sequentially. However, I am facing an issue with the Dependency-Check reports. The reports are being generated correctly, but they seem to overwrite each other, and at the end of the pipeline, I am left with a single report that only reflects the last scanned project (Backend).

      Here's the scenario:

      Frontend Scan: The scan for the frontend application runs, and vulnerabilities are identified and reported.
      Backend Scan: After that, the scan for the backend application runs, but the report from the frontend scan is overwritten by the backend report.
      I have set up two separate stages for scanning the frontend and backend projects, and in each stage, I am directing the scan output to different directories (separate locations). While Jenkins shows two different reports in the workspace, both of them contain identical content, which only pertains to the backend scan—the frontend scan data seems to be lost.

      I've tried generating the reports in separate folders, but the issue persists. Does anyone have any idea why this is happening or how I can ensure that both scan results are kept separate and are not overwritten?

      Here is a simplified pipeline structure I am using:

      example

      `stage('OWASP Dependency-Check Vulnerabilities BE') {
      when

      { expression \{ return params.BUILD_BE }

      }
      steps {
      script {
      dir('some-folder/be-app') {
      dependencyCheck additionalArguments: '''
      -o './dependency-check-be/'
      --project ${env.PROJECT_BE_APP}
      -f 'XML'
      --nvdApiKey ${NVD_API_KEY}
      --disableNodeAudit
      ''', odcInstallation: 'OWASP Dependency-Check'
      dependencyCheckPublisher pattern: '**/dependency-check-be/dependency-check-report.xml'
      }
      }
      }
      }

      stage('OWASP Dependency-Check Vulnerabilities FE') {
      when

      { expression \{ return params.BUILD_FE }

      }
      steps {
      script {
      dir('some-folder/fe-app') {
      dependencyCheck additionalArguments: '''
      -o './dependency-check-fe/'
      --project ${env.PROJECT_FE_APP}
      -f 'xml'
      --nvdApiKey ${NVD_API_KEY}
      --disableYarnAudit
      ''', odcInstallation: 'OWASP Dependency-Check'
      dependencyCheckPublisher pattern: '**/dependency-check-fe/dependency-check-report.xml'
      }
      }
      }
      }`

          [JENKINS-75244] Dependency-Check Reports Overwriting in Jenkins Pipeline for Frontend and Backend Projects

          There are no comments yet on this issue.

            nfalco Nikolas Falco
            ivor Ivor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: