OWASP依赖性检查和詹金斯管道

时间:2019-12-16 19:03:21

标签: jenkins dependencies jenkins-pipeline owasp

我试图将依赖项检查添加到我的JenkinsFile中,但是没有成功。

插件已完成安装和配置。
全局工具配置
名称:漏洞5
自动安装(选中)
版本:依赖项检查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 .'
        }
      }
   }
}

在工具中添加依赖项检查会破坏管道文件。对我想念的东西有任何想法吗?

1 个答案:

答案 0 :(得分:0)

我使用这样的指令,效果很好:

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'已在我的Jenkins上预安装并配置了插件OWASP依赖项检查