Use custom report template via docker

101 views
Skip to first unread message

Kineye

unread,
Sep 4, 2023, 9:01:10 AM9/4/23
to ZAP User Group
i have created a custom report template that is a mixture of the modern, risk confidence and high level report. I now need to generate a report via this template in docker  with the Automation Framework but I cannot find the report template directory,  I have attempted to create a volume with the report template in /home/.ZAP_D/reports and /home/.ZAP/reports but i get an error "invalid template". I don't think this is due to the template being invalid as it works without error in the GUI. I assume zap cannot find it, or the the automation framework doesn't accept custom reports. Any help would be appreciated

Simon Bennetts

unread,
Sep 4, 2023, 9:58:26 AM9/4/23
to ZAP User Group
Make sure you have the latest ZAP docker image, e.g.
  • docker pull softwaresecurityproject/zap-stable
Then start a docker image with whatever commandline options you are using to map the network drive, but use a bash shell instead of running ZAP
  • docker run <your options> -i -t softwaresecurityproject/zap-stable bash
You should get a bash shell. In their type:
  • ./zap.sh -h
This will display the ZAP command line options .. and also set up the directory ZAP will use.
You should see something like:
  • Found Java version 11.0.18
    Available memory: 7851 MB
    Using JVM args: -Xmx1962m
    317 [main] INFO  org.parosproxy.paros.Constant - Copying default configuration to /home/zap/.ZAP/config.xml
    375 [main] INFO  org.parosproxy.paros.Constant - Creating directory /home/zap/.ZAP/session
    375 [main] INFO  org.parosproxy.paros.Constant - Creating directory /home/zap/.ZAP/dirbuster
    376 [main] INFO  org.parosproxy.paros.Constant - Creating directory /home/zap/.ZAP/fuzzers
    376 [main] INFO  org.parosproxy.paros.Constant - Creating directory /home/zap/.ZAP/plugin
    Sep 04, 2023 1:53:00 PM java.util.prefs.FileSystemPreferences$1 run
    INFO: Created user preferences directory.
    Usage:
    zap.sh [Options]
See the "/home/zap/.ZAP/" above?
It may be different if you're using a different image, so use the one you see not the one shown to me.
List the files under the "reports" sub directory:
  • ls /home/zap/.ZAP/reports
Is your report directory there?
If it is then I would expect it to work.
If it is not then it wont work - you have not managed to put the report template where ZAP expects to find it.

Cheers,

Simon

Kineye

unread,
Sep 5, 2023, 5:36:14 AM9/5/23
to ZAP User Group
Thanks Simon, I found that docker wasn't copying the directory over via docker volume, I Have fixed this by copying it over in the dockerfile with docker copy and now it works. 

Simon Bennetts

unread,
Sep 5, 2023, 5:37:07 AM9/5/23
to ZAP User Group
Thanks for letting us know!

Ali

unread,
Sep 5, 2023, 6:23:27 AM9/5/23
to ZAP User Group
i am trying to post a aror but question deleted , i dont know why, cn i ask my question here????

Ali

unread,
Sep 5, 2023, 8:54:19 AM9/5/23
to ZAP User Group

Simon Bennetts

unread,
Sep 5, 2023, 9:01:30 AM9/5/23
to ZAP User Group
It was Google Groups spam detection being too aggressive :(
I've flagged it as not spam and will answer on that thread..

Kineye

unread,
Sep 5, 2023, 9:05:39 AM9/5/23
to ZAP User Group
It is hard to answer it due to formatting and the way the question is being asked, maybe review the question and if English is a second language use a translator if possible. Then to ask a question here click the New conversation button at the top left of the page and ask the question there. Asking a new question on a thread that is unrelated will just confuse and make it hard to answer you.
Hope this helps a bit :)

On Tuesday, 5 September 2023 at 14:54:19 UTC+2 alila...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages