Coder Social home page Coder Social logo

cybernhl / dependency-check-gradle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dependency-check/dependency-check-gradle

0.0 1.0 0.0 672 KB

The dependency-check gradle plugin allows projects to monitor dependent libraries for known, published vulnerabilities.

Home Page: http://jeremylong.github.io/DependencyCheck/

License: Apache License 2.0

Groovy 100.00%

dependency-check-gradle's Introduction

Dependency-Check-Gradle

Build Status

The dependency-check gradle plugin allows projects to monitor dependent libraries for known, published vulnerabilities.

Current Release

The latest version is Maven Central

With the release of 2.1.1 the task name was changed from dependencyCheck to dependencyCheckAnalyze.

Usage

Below are the quick start instructions. Please see the documentation site for more detailed information on configuration and usage.

Step 1, Apply dependency check gradle plugin

Install from Maven central repo

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.owasp:dependency-check-gradle:5.2.1'
    }
}

apply plugin: 'org.owasp.dependencycheck'

Step 2, Run gradle task

Once gradle plugin applied, run following gradle task to check dependencies:

gradle dependencyCheckAnalyze --info

The reports will be generated automatically under build/reports directory.

If your project includes multiple sub-projects, the report will be generated for each sub-project in their own build/reports.

FAQ

Questions List:

  • What if I'm behind a proxy?
  • What if my project includes multiple sub-project? How can I use this plugin for each of them including the root project?
  • How to customize the report directory?

What if I'm behind a proxy?

Maybe you have to use proxy to access internet, in this case, you could configure proxy settings for this plugin (in addition you should read the proxy configuration page):

dependencyCheck {
    proxy {
        server = "127.0.0.1"      // required, the server name or IP address of the proxy
        port = 3128               // required, the port number of the proxy

        // optional, the proxy server might require username
        // username = "username"

        // optional, the proxy server might require password
        // password = "password"
    }
}

In addition, if the proxy only allow HTTP GET or POST methods, you will find that the update process will always fail, the root cause is that every time you run dependencyCheck task, it will try to query the latest timestamp to determine whether need to perform an update action, and for performance reason the HTTP method it uses by default is HEAD, which probably is disabled or not supported by the proxy. To avoid this problem, you can simply change the HTTP method by below configuration:

dependencyCheck {
    quickQueryTimestamp = false    // when set to false, it means use HTTP GET method to query timestamp. (default value is true)
}

What if my project includes multiple sub-project? How can I use this plugin for each of them including the root project?

Try put 'apply plugin: "dependency-check"' inside the 'allprojects' or 'subprojects' if you'd like to check all sub-projects only, see below:

(1) For all projects including root project:

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'org.owasp:dependency-check-gradle:5.2.1'
  }
}

allprojects {
    apply plugin: 'org.owasp.dependencycheck'
}

(2) For all sub-projects:

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'org.owasp:dependency-check-gradle:5.2.1'
  }
}

subprojects {
    apply plugin: 'org.owasp.dependencycheck'
}

In this way, the dependency check will be executed for all projects (including root project) or just sub projects.

How to customize the report directory?

By default, all reports will be placed under build/reports folder, to change the default reporting folder name modify the configuration section like this:

subprojects {
    apply plugin: 'org.owasp.dependencycheck'

    dependencyCheck {
        outputDirectory = "security-report"
    }
}

dependency-check-gradle's People

Contributors

jeremylong avatar wmaintw avatar stefanneuhaus avatar bdhave avatar awhitford avatar raysinnema avatar bloihl avatar bodewig avatar willis7 avatar chrisbadalucco avatar marx314 avatar caligin avatar hakanai avatar skjolber avatar shevek avatar robertoschwald avatar savvasmisaghmoayyed avatar n0rthdev avatar lkoe avatar florianschmitt avatar davidmigloz avatar reddyalready avatar deepy avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.