CircleCI: Getting "Permission denied: '/zap/wrk/testreport.html' "

243 views
Skip to first unread message

ZAP_Automation

unread,
Aug 2, 2021, 7:23:43 AM8/2/21
to OWASP ZAP User Group

Hi Team,

I am getting Permission denied: '/zap/wrk/testreport.html' error when running in CircleCI pipeline.

Below is the config file of CI pipeline

version: 2.1
jobs:
  build:
    
    docker:
      - image: cimg/openjdk:16.0.1 
    steps:
      - setup_remote_docker
      - checkout      
      - run:
          name: Zap Scanning
          command: |
            sudo mkdir -p $pwd/out
                       
            
            (
              
              docker run -v $pwd/out:/zap/wrk/:rw -t owasp/zap2docker-stable zap-baseline.py \
              -t http://www.example.com/ -d -r testreport.html || \
              if [ $? -ne 1 ]; then exit 0; else exit 1; fi;
              
              
            )

I have created "out" directory , on which i have full permission. Also i had given full permission on pwd. Also i tried running docker run with --user root , still getting permission denied issue. scanning was done but no html reported got generated 

below is the error:

2021-08-02 10:44:25,379 Starting new HTTP connection (1): localhost:60812
2021-08-02 10:44:26,027 http://localhost:60812 "GET http://zap/OTHER/core/other/htmlreport/?apikey= HTTP/1.1" 200 21180
ERROR [Errno 13] Permission denied: '/zap/wrk/testreport.html'
2021-08-02 10:44:26,036 I/O error: [Errno 13] Permission denied: '/zap/wrk/testreport.html'
Traceback (most recent call last):
  File "/zap/zap-baseline.py", line 414, in main
    write_report(base_dir + report_html, zap.core.htmlreport())
  File "/zap/zap_common.py", line 552, in write_report
    with open(file_path, mode='wb') as f:
PermissionError: [Errno 13] Permission denied: '/zap/wrk/testreport.html'

Could you please guide me resolving this issue ?

Thanks. 
Reply all
Reply to author
Forward
0 new messages