Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56075

Script based authentication unable to load authentication script file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • zap-plugin
    • None
    • Jenkins Version: Jenkins ver. 2.121.1
      Latest - zap-plugin
      Windows 7 x64
      ZAP - Weekly Build : ZAP_D-2019-01-28

      Trying to use the Script based authentication for zap-plugin to scan a site.

      I created the JavaScript based authentication script and saved it using the GUI.

      Created a Jenkins job to use the official owasp zap plugin.

      In the configuration I was able to find the authentication script in the drop down list and was able to configure and save successfully.

      When running the job, I get error unable to load the script with the following stack trace:

       

      [ZAP Jenkins Plugin] LOAD SCRIPT FOR AUTHENTICATION
      5428 [ZAP-ProxyThread-6] ERROR org.zaproxy.zap.authentication.ScriptBasedAuthenticationMethodType - Unable to find script while loading Script Based Authentication Method for name: MyAuth.js
      5430 [ZAP-ProxyThread-6] WARN org.zaproxy.zap.extension.api.API - Bad request to API endpoint [/xml/authentication/action/setAuthenticationMethod/] from [127.0.0.1]:
      No script with the provided name has been found (script_not_found) : MyAuth.js
      at org.zaproxy.zap.authentication.ScriptBasedAuthenticationMethodType$1.handleAction(ScriptBasedAuthenticationMethodType.java:751)
      at org.zaproxy.zap.extension.authentication.AuthenticationAPI.handleApiAction(AuthenticationAPI.java:179)
      at org.zaproxy.zap.extension.api.API.handleApiRequest(API.java:449)
      at org.parosproxy.paros.core.proxy.ProxyThread.processHttp(ProxyThread.java:456)
      at org.parosproxy.paros.core.proxy.ProxyThread.run(ProxyThread.java:318)
      at java.lang.Thread.run(Unknown Source)
      ERROR: org.zaproxy.clientapi.core.ClientApiException: No script with the provided name has been found
      at org.zaproxy.clientapi.core.ApiResponseFactory.getResponse(ApiResponseFactory.java:32)
      at org.zaproxy.clientapi.core.ClientApi.callApi(ClientApi.java:312)
      at org.zaproxy.clientapi.gen.Authentication.setAuthenticationMethod(Authentication.java:78)
      at org.jenkinsci.plugins.zap.ZAPDriver.setUpScriptBasedAuth(ZAPDriver.java:1526)
      at org.jenkinsci.plugins.zap.ZAPDriver.setUpAuthentication(ZAPDriver.java:1715)
      at org.jenkinsci.plugins.zap.ZAPDriver.executeZAP(ZAPDriver.java:1184)
      at org.jenkinsci.plugins.zap.ZAPBuilder$ZAPDriverCallable.invoke(ZAPBuilder.java:448)
      at org.jenkinsci.plugins.zap.ZAPBuilder$ZAPDriverCallable.invoke(ZAPBuilder.java:436)
      at hudson.FilePath.act(FilePath.java:1047)
      at hudson.FilePath.act(FilePath.java:1025)
      at org.jenkinsci.plugins.zap.ZAPBuilder.perform(ZAPBuilder.java:292)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      at hudson.model.Build$BuildExecution.build(Build.java:206)
      at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1794)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)

      [ZAP Jenkins Plugin] SHUTDOWN [ START ]

       

            jordangs Goran Sarenkapa
            pexus Pradeep Nambiar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: