Skip to content
This is the documentation for pieceofcake2/security-dast, a CakePHP 2.x plugin for pieceofcake2/cakephp. About this fork.

The Report ​

Samples ​

The baseline scan of a page without the security headers, with a form without a token and an error page:

The cover, the alerts by risk, the page of an alert and its requests

The full scan of a CakePHP 2 application, with an End-to-End test as the scenario: a form of SecurityComponent that prints its value without h(), found as a reflected XSS:

The cover of a full scan with the End-to-End tests, the alerts by risk, and the page of the XSS with its attack

The Pages ​

  1. Cover: the result, the numbers of alerts by risk, the repository, branch and commit, and what was scanned: the URL, the server (the built-in web server and its APP_ENV, or a running application), the scan (baseline or full, its minutes), the End-to-End tests and their result, the user of the login, the number of URLs with alerts, the ignored alerts and the threshold; then the date, environment and software of the run (ZAP and its version)
  2. Alerts by risk: High, Medium, Low and Informational; each alert with its number of requests, and a link to its page
  3. A page for each alert: its name, alert ID, risk, confidence, CWE and WASC, what it means and how to fix it (as ZAP writes them, in the language of the report), each request where it was found, up to 50, and the links: the page of the alert on zaproxy.org first

Each request shows its method and URL, then what ZAP found in it:

ParameterThe parameter, header or cookie of the alert, e.g. data[Contact][message]
AttackThe value that ZAP sent, for the alerts of the full scan
EvidenceWhat the response showed, e.g. the attack printed as it was sent, or the header that is missing
Other infoMore details of ZAP

See Alerts for the fixes of the alerts in a CakePHP 2 application.

Risk and Confidence ​

The risk is how bad the issue is when it is real: High (e.g. XSS, SQL injection), Medium (e.g. a missing CSP or anti-clickjacking header), Low (e.g. a cookie without SameSite), and Informational (to know, rarely to fix). The confidence is how sure ZAP is that the issue is real: Low, Medium, High or Confirmed. Check an alert of low confidence in the code before fixing it: it can be a false positive.

--fail-on fails the run on a risk, whatever the confidence:

--fail-onFails on
high (default)High
mediumHigh and Medium
lowHigh, Medium and Low
infoEvery alert
noneNothing: the report only

For an existing application, start with --fail-on=none, fix the alerts of the report, then raise the threshold.

Ignoring an Alert ​

Fix the alerts first: most of them are fixed once for the whole application, in AppController or the web server (Alerts). When an alert does not apply, leave it out of the report with its ID:

bash
vendor/bin/security-dast --ignore=10038,10020
  • An ID leaves out its variants too: 10038 leaves out 10038-1.
  • The IDs are those of the report (Alert ID) and of the alerts of ZAP.
  • The cover of the report lists the ignored alerts, so that they are not forgotten.

The alerts to ignore are those of the scan environment, not of the application: e.g. the security headers that a proxy in front of production adds, which the built-in web server of the scan does not have, or the X-Powered-By of the PHP of CI. Keep the reason in the settings file:

php
'dast' => [
    // The load balancer of production adds CSP and X-Frame-Options; checked on staging with --url
    'ignore' => ['10038', '10020'],
],

See LICENSE for copyright and license information. Not affiliated with the Cake Software Foundation.