Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to match upstream #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ ENV ZAP_PORT 8080

COPY policies /var/lib/jenkins/.ZAP/policies/
COPY .xinitrc /var/lib/jenkins/
COPY scripts /var/lib/jenkins/.ZAP_D/scripts/

WORKDIR /zap
# Download and expand the latest stable release
RUN curl -s https://raw.githubusercontent.com/zaproxy/zap-admin/master/ZapVersions-dev.xml | xmlstarlet sel -t -v //url |grep -i Linux | wget -q --content-disposition -i - -O - | tar zx --strip-components=1 && \
curl -s -L https://bitbucket.org/meszarv/webswing/downloads/webswing-2.3-distribution.zip | jar -x && \
RUN curl -s https://raw.githubusercontent.com/zaproxy/zap-admin/master/ZapVersions.xml | xmlstarlet sel -t -v //url |grep -i Linux | wget -q --content-disposition -i - -O - | tar zx --strip-components=1 && \
curl -s -L https://bitbucket.org/meszarv/webswing/downloads/webswing-2.5.10-distribution.zip | jar -x && \
touch AcceptedLicense
ADD webswing.config /zap/webswing-2.3/webswing.config
ADD webswing.config /zap/webswing/webswing.config

RUN chown root:root /zap -R && \
chown root:root -R /var/lib/jenkins && \
Expand Down
14 changes: 6 additions & 8 deletions scripts/scripts/httpsender/Alert_on_HTTP_Response_Code_Errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
// By default it will raise 'Info' level alerts for Client Errors (4xx) (apart from 404s) and 'Low' Level alerts for Server Errors (5xx)
// But it can be easily changed.

// The following handles differences in printing between Java 7's Rhino JS engine
// and Java 8's Nashorn JS engine
if (typeof println == 'undefined') this.println = print;

pluginid = 100000 // https://github.com/zaproxy/zaproxy/blob/develop/src/doc/scanners.md
pluginid = 100000 // https://github.com/zaproxy/zaproxy/blob/develop/docs/scanners.md

function sendingRequest(msg, initiator, helper) {
// Nothing to do
}

function responseReceived(msg, initiator, helper) {
if (initiator == 7) { // CHECK_FOR_UPDATES_INITIATOR
// Not of interest.
return
}

var extensionAlert = org.parosproxy.paros.control.Control.getSingleton().getExtensionLoader().getExtension(
org.zaproxy.zap.extension.alert.ExtensionAlert.NAME)
if (extensionAlert != null) {
Expand Down Expand Up @@ -57,9 +58,6 @@ function responseReceived(msg, initiator, helper) {
case 6: // MANUAL_REQUEST_INITIATOR
type = 15 // User
break
case 7: // CHECK_FOR_UPDATES_INITIATOR
type = 1 // Proxied
break
case 8: // BEAN_SHELL_INITIATOR
type = 15 // User
break
Expand Down
17 changes: 9 additions & 8 deletions scripts/scripts/httpsender/Alert_on_Unexpected_Content_Types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
// By default it will raise 'Low' level alerts for content types that are not expected to be returned by APIs.
// But it can be easily changed.

// The following handles differences in printing between Java 7's Rhino JS engine
// and Java 8's Nashorn JS engine
if (typeof println == 'undefined') this.println = print;

var pluginid = 100001 // https://github.com/zaproxy/zaproxy/blob/develop/src/doc/scanners.md
var pluginid = 100001 // https://github.com/zaproxy/zaproxy/blob/develop/docs/scanners.md

var extensionAlert = org.parosproxy.paros.control.Control.getSingleton().getExtensionLoader().getExtension(
org.zaproxy.zap.extension.alert.ExtensionAlert.NAME)

var expectedTypes = [
"application/json",
"application/octet-stream",
"application/problem+json",
"application/problem+xml",
"application/soap+xml",
"application/vnd.api+json",
"application/xml",
"application/x-yaml",
"text/x-json",
Expand All @@ -26,6 +25,11 @@ function sendingRequest(msg, initiator, helper) {
}

function responseReceived(msg, initiator, helper) {
if (initiator == 7) { // CHECK_FOR_UPDATES_INITIATOR
// Not of interest.
return
}

if (extensionAlert != null) {
var ctype = msg.getResponseHeader().getHeader("Content-Type")
if (ctype != null) {
Expand Down Expand Up @@ -67,9 +71,6 @@ function responseReceived(msg, initiator, helper) {
case 6: // MANUAL_REQUEST_INITIATOR
type = 15 // User
break
case 7: // CHECK_FOR_UPDATES_INITIATOR
type = 1 // Proxied
break
case 8: // BEAN_SHELL_INITIATOR
type = 15 // User
break
Expand Down
Loading