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 \
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
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'