Automation Framework

The new Automation Framework will in time replace the Command Line and Packaged Scan options. It allows you to control ZAP via one YAML file and provides more flexibility while not being tied to any specific container technology.

The Automation Framework is included with the latest version of ZAP as well as the stable docker image. The framework is plugable and many of the existing add-ons have been enhanced to support it.

The framework is covered in the following ZAP Chat videos:

Framework Overview

For details of how to get started with the framework see the main framework help page.

The framework supports:

  • environment - which defines all of the applications the plan can act on
  • Authentication - all of the authentication mechanisms supported by ZAP
  • Job Tests - which can be used to validate the outcome of jobs

The full set of jobs currently supported by the framework and other add-ons are:

For details of future changes planned see the tracker issue.

Updating Add-ons

The addOns job has been found to cause problems when updating add-ons which are defined in the current plan. This job has been depreciated and no longer does anything.

You can use the standard ZAP command line options with the AF -autorun option:

  • -addoninstall <addOnId> to install an add-on
  • -addonuninstall <addOnId> to uninstall an add-on
  • -addonupdate to update all add-ons

You can use -addoninstall and -addonuninstall as many times as you need:

./zap.sh -addonupdate\
    -addoninstall example-1 \
    -addoninstall example-2 \
    -addonuninstall example-3 \
    -cmd -autorun zap.yaml <any other ZAP options>

Exit Value

If you run the framework from the command line then ZAP will by default exit with:

  • 0: The plan ran without any problems reported
  • 1: The plan failed with an error
  • 2: The plan ran but there were warnings

The framework will exit with 2 if there are warnings even if the environment failOnWarning parameter is set to false.

The exitStatus job allows you to set ZAP’s exit code based on scan results.