OWASP Dependency Check and Jenkins Pipeline

10.6k Views Asked by At

I am trying to add Dependency Check into my JenkinsFile without success.

Plugins Installation and configuration done.
Global Tool Configuration
Name : Vulnerability5
Install automatically (checked)
Version : dependency-check 5.2.4

pipeline {

   agent any

    tools {
       nodejs "node8"
       dependency-check "vulnerability5"
    }

   stages {
       stage('Install Deps') {
        steps {
            //Install dependecies
            sh 'yarn install'
        }
      }
      stage('Dependency Check') {
        steps {
            // Run OWASP Dependency Check
            dependencyCheck additionalArguments: '-f "HTML, XML,CSV" -s .'
        }
      }
   }
}

adding the dependency check in tools is breaking the pipeline file. Any Idea of what I am missing?

1

There are 1 best solutions below

3
On

I use instruction like this and it works fine:

stages {
        stage ('OWASP Dependency-Check Vulnerabilities') {
            steps {
                dependencyCheck additionalArguments: ''' 
                    -o "./" 
                    -s "./"
                    -f "ALL" 
                    --prettyPrint''', odcInstallation: 'OWASP-DC'

                dependencyCheckPublisher pattern: 'dependency-check-report.xml'
            }
        }     
    }

odcInstallation: 'OWASP-DC' is preinstalled and configured plugin OWASP dependency check on my Jenkins