Official OWASP ZAP

The Jenkins project announced an unresolved security vulnerability affecting the current version of this plugin (why?):

 

Official OWASP Zed Attack Proxy Jenkins Plugin

The OWASP Zed Attack Proxy (ZAP) is one of the world’s most popular free security tools and is actively maintained by hundreds of
international volunteers. It can help you automatically find security vulnerabilities in your web applications while you are developing and
testing your applications. It's also a great tool for experienced pen-testers to use for manual security testing.

The Official OWASP ZAP Jenkins Plugin extends the functionality of the ZAP security tool into a CI Environment.

    • Manage Sessions (Load or Persist)
    • Define Context (Name, Include URLs and Exclude URLs)
    • Attack Contexts (Spider Scan, AJAX Spider, Active Scan)

You can also:

    • Setup Authentication (Form Based or Script Based)
    • Run as Pre-Build as part of a Selenium Build
    • Generate Reports (.xhtml, .xml, .json)

Table of Contents

ZAP as a part of a CI Environment

  1. A Jenkins CI Build step initializes ZAP
  2. Traffic flows (Regression Pack) through ZAP (Web Proxy)
  3. ZAP modifies requests to include Vulnerability Tests
  4. Target Application/Server sends Response back through ZAP
  5. ZAP sends reporting data back to Jenkins
  6. Jenkins publishes and archives the report(s)
  7. Jenkins creates JIRA tickets for the alerts

Tech

ZAP Jenkins plugin uses a number of open source plugins to work properly:

    • ZAP API(info) A REST API which allows you to interact with ZAP programmatically.

And of course the Official ZAP Jenkins plugin is open source with a public repository on GitHub

Questions/Troubleshooting

Please use the Google Group for any questions about using the plugin.

Notice:

  • Include the following:

    • Java version
    • Jenkins version
    • ZAP version
    • ZAP Jenkins Plugin version
    • Firefox version (if running AJAX Spider or a Selenium build)
    • Selenium (if applicable)
  • Upload copies of the zap.log files and a copy of the console output of the Jenkins log to pastebin.

  • Jenkins is always running on a master, is ZAP running on the master as well or on a separate slave machine?

  • Relevant Jenkins Job Configurations sanitized screenshots.

Issue Tracking

Notice: GitHub Issues have been disabled.

Security Vulnerabilities

If you find any security vulnerabilities or exploits caused by the plugin, please send a private email  to one of the maintainer(s).

Notice: These should be kept private until a fix is issued.

Installation

Jenkins
    • ZAP Jenkins plugin requires Jenkins 1.580.1+ to run.
    • Download and extract the desired war release.
Zed Attack Proxy(info) Documentation, how to configure ZAP can be found here
Firefox(info) Documentation, how to configure Firefox can be found here** **

Usage

Detailed instructions on how to configure a Job from start to finish can be found here.

Recommended: for first time users, the plugin requires special instructions to setup for first run.

Development

The Official OWASP ZAP Jenkins plugin is a Maven Jelly Project.

Start the local Jenkins instance: $ mvn hpi:run

Building the Plugin

Requires: JDK 8 to compile and JDK 7+ to run on Jenkins.

Prerequisites
  1. Ensure that your Maven Environment is setup and configured properly by following the Plugin tutorial.
  2. Ensure that your various hosting permissions are configured properly and additional project settings are configured properly by following the Hosting Plugins tutorial.

Warning: Do NOT attempt to perform a production release until you have completed the Pre-Production Release steps below.

Development Build
  1. Run $ mvn clean package -e to create the plugin .hpi file.
To Install:
  • copy the resulting ../target/zap.hpi file to the $JENKINS_HOME/plugins directory. Restart Jenkins.
  • or use the plugin management console 127.0.0.1:8080/pluginManager/advanced to upload the .hpi file. Restart Jenkins.
Pre-Production Release
  1. Validate and make sure that your ssh connection is working and configured properly with: $ ssh -T git@github.com
  2. Validate and sure your Jenkins credentials are correctly recognized by Maven with: $ mvn deploy

Warning: If there are any SSL handshake issues, please see the following document on how to resolve them.

Production Release

$ mvn release:prepare release:perform

Development Rules and Guidelines

Required: Only ONE Pull Request per JIRA Issue/Ticket.

See Code Style Guidelines** **

Contributors

See Contributors** **

Version History

See History** **

Other

YouTube: ZAP Official Jenkins plugin walkthrough & demo

Previous Release (Deprecated)

See Wiki Documentation
See Source Code
See Contributors

License

The MIT License (MIT)

Copyright (c) Copyright (c) 2016 Goran Sarenkapa (JordanGS), and a number of other of contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

See License