Failed to load context file /zap/wrk/scan.context : internal_error (Gitlab CI/CD)

56 views
Skip to first unread message

Sama

unread,
Mar 14, 2024, 10:30:40 AM3/14/24
to ZAP User Group
I am trying to automate the scanning process within a GitLab job like this.

"
stage: dast 
image: 
  name: owasp/zap2docker-stable 
before_script: 
  - mkdir -p /zap/wrk 
script: 
  - pwd
  - cp templates/scan.context /zap/wrk/scan.context 
  - zap-baseline.py -t https://example.com -d -n scan.context -U test -r report.html 
  - cp /zap/wrk/report.html report.html 
artifacts: 
  when: always 
   paths: 
       - report.html
"

However i find this probleme "Failed to load context file /zap/wrk/scan.context : internal_error"

I tested it locally with this command before, and it worked.

sudo docker run -v ${PWD}:/zap/wrk/:rw -t owasp/zap2docker-stable zap-baseline.py -t https://example.com -d -n scan.context -U test -r report.html

thc...@gmail.com

unread,
Mar 18, 2024, 5:08:27 AM3/18/24
to zaprox...@googlegroups.com
Hi,

Did you check the zap.log file? That should indicate what the problem is.

Best regards.

On 14/03/2024 14:30, Sama wrote:
> I am trying to automate the scanning process within a GitLab job like this.
>
> "
> stage: dast
> image:
> name: owasp/zap2docker-stable
> before_script:
> - mkdir -p /zap/wrk
> script:
> - pwd
> - cp templates/scan.context /zap/wrk/scan.context
> - zap-baseline.py -t https://example.com -d -n scan.context -U test -r
> report.html
> - cp /zap/wrk/report.html report.html
> artifacts:
> when: always
> paths:
> - report.html
> "
>
> However i find this probleme *"Failed to load context file
> /zap/wrk/scan.context : internal_error"*
>
> I tested it locally with this command before, and it worked.
>
> *sudo docker run -v ${PWD}:/zap/wrk/:rw -t owasp/zap2docker-stable
> zap-baseline.py -t https://example.com -d -n scan.context -U test -r
> report.html*
>
Reply all
Reply to author
Forward
0 new messages