jenkins zap integration issue on my ubuntu

12 views
Skip to first unread message

CHRISTOPHER ANTONY

unread,
Sep 6, 2024, 11:49:12 AM9/6/24
to ZAP Jenkins Plugin
Hi Team,

I have installed ZAP pluging using custom tool in jenkins. I have not installed zap in my local machine.

ZAP home directory path: /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0

The below error coming while run the jenkins job:

Started by user admin

Running as SYSTEM
[CustomTools] - ZAP_2.15.0: Starting installation
[CustomTools] - ZAP_2.15.0: Tool is installed at /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0
[CustomTools] - ZAP_2.15.0: Setting ZAP_2.15.0_HOME=/var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0
Building in workspace /var/lib/jenkins/workspace/ZAP_Pipeline1

[ZAP Jenkins Plugin] START PRE-BUILD ENVIRONMENT VARIABLE REPLACEMENT
HOST = [ localhost ]
PORT = [ 8090 ]

SESSION FILENAME = [  ]
INTERNAL SITES = [  ]

CONTEXT NAME = [ ZAP_Pipeline1_4 ]

INCLUDE IN CONTEXT = [ https://sandbox-staging.assessappglobal.com.au/login.* ]

EXCLUDE FROM CONTEXT = [  ]

STARTING POINT (URL) = [ https://sandbox-staging.assessappglobal.com.au/login ]
REPORT FILENAME = [ JENKINS_ZAP_VULNERABILITY_REPORT ]
REPORT TITLE = [ ZAP_Pipeline1_4 ]

COMMAND LINE =

[ZAP Jenkins Plugin] END PRE-BUILD ENVIRONMENT VARIABLE REPLACEMENT

[ZAP Jenkins Plugin] CLEAR LOGS IN SETTINGS...
ZAP HOME DIRECTORY [ /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0 ]
JENKINS WORKSPACE [ /var/lib/jenkins/workspace/ZAP_Pipeline1 ]
CLEARING ZAP HOME DIRECTORY/LOGS


[ZAP Jenkins Plugin] START BUILD STEP

[ZAP Jenkins Plugin] PLUGIN VALIDATION (PLG), VARIABLE VALIDATION AND ENVIRONMENT INJECTOR EXPANSION (EXP)
ZAP INSTALLATION DIRECTORY = [ /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0 ]
(EXP) HOST = [ localhost ]
(EXP) PORT = [ 8090 ]
(EXP) LOAD SESSION = [ /var/lib/jenkins/workspace/ZAP_Pipeline1/api Session.session ]
(EXP) CONTEXT NAME = [ ZAP_Pipeline1_4 ]
(EXP) INCLUDE IN CONTEXT = [ https://sandbox-staging.assessappglobal.com.au/login.* ]
(EXP) EXCLUDE FROM CONTEXT = [  ]
(EXP) STARTING POINT (URL) = [ https://sandbox-staging.assessappglobal.com.au/login ]
(EXP) REPORT FILENAME = [ JENKINS_ZAP_VULNERABILITY_REPORT ]

[ZAP Jenkins Plugin] CONFIGURE RUN COMMANDS for [ /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0/zap.sh ]
[ZAP Jenkins Plugin] EXECUTE LAUNCH COMMAND
[ZAP_2.15.0] $ /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0/zap.sh -daemon -host localhost -port 8090 -config api.key=ZAPROXY-PLUGIN -dir /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0

[ZAP Jenkins Plugin] INITIALIZATION [ START ]
Found Java version 17.0.12
Available memory: 7798 MB
Using JVM args: -Xmx1949m
The install dir should not be used as home dir: /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0
ERROR: java.net.ConnectException: Connection refused
at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:547)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:602)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver.waitForSuccessfulConnectionToZap(ZAPDriver.java:746)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver.access$100(ZAPDriver.java:112)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver$WaitZAPDriverInitCallable.invoke(ZAPDriver.java:2710)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver$WaitZAPDriverInitCallable.invoke(ZAPDriver.java:2696)
at hudson.FilePath.act(FilePath.java:1235)
at hudson.FilePath.act(FilePath.java:1218)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver.startZAP(ZAPDriver.java:659)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPBuilder.perform(ZAPBuilder.java:277)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:164)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
at hudson.model.Run.execute(Run.java:1894)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:446)

ERROR: Unable to connect to ZAP's proxy after 60 seconds.
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver.waitForSuccessfulConnectionToZap(ZAPDriver.java:767)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver.access$100(ZAPDriver.java:112)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver$WaitZAPDriverInitCallable.invoke(ZAPDriver.java:2710)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver$WaitZAPDriverInitCallable.invoke(ZAPDriver.java:2696)
at hudson.FilePath.act(FilePath.java:1235)
at hudson.FilePath.act(FilePath.java:1218)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPDriver.startZAP(ZAPDriver.java:659)
at PluginClassLoader for zap//org.jenkinsci.plugins.zap.ZAPBuilder.perform(ZAPBuilder.java:277)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:164)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
at hudson.model.Run.execute(Run.java:1894)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:446)

Build step 'Execute ZAP' marked build as failure
Archiving artifacts
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /var/lib/jenkins/workspace/ZAP_Pipeline1/Reports to /var/lib/jenkins/jobs/ZAP_Pipeline1/htmlreports/Final_20Report
ERROR: Specified HTML directory '/var/lib/jenkins/workspace/ZAP_Pipeline1/Reports' does not exist.
Finished: FAILURE


Kindly help in this.

psi...@gmail.com

unread,
Sep 6, 2024, 12:01:35 PM9/6/24
to ZAP Jenkins Plugin
"The install dir should not be used as home dir: /var/lib/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ZAP_2.15.0/ZAP_2.15.0"

Dont use the install directory for the home one.
Use a different directory.

Cheers,

Simon
Reply all
Reply to author
Forward
0 new messages