Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Failed to load context file - file does not exist in the docker container #39

@tse00

Description

@tse00

Hi everyone,

I added the context file to the pipeline configuration. The file is being recognized from the docker run command otherwise it would throw an error. The docker run command creates a volume from the owasp folder path to the container. Somehow it seems like the file it's not being copied from /home/vsts/work/1/s/owaspzap/context-file.context to the container. After the docker image is pulled and the container starts, I get the error message that the context file wasn't found.

/usr/bin/chmod 777 /home/vsts/work/1/s/owaspzap
/usr/bin/id -u root
0
/usr/bin/docker run -u 0 -v /home/vsts/work/1/s/owaspzap:/zap/wrk/:rw owasp/zap2docker-stable zap-baseline.py -t [https://****:443](https://****/) -J report.json -r report.html -n /home/vsts/work/1/s/owaspzap/context-file.context
...

owasp zap docker image is pulled

...
df35e5174ca6: Pull complete
Digest: sha256:215795fee30319d4d46007e1d9bb0999d9bafdfa423bcfb690de3d40e642f302
Status: Downloaded newer image for owasp/zap2docker-stable:latest
2023-01-10 17:10:54,380 Failed to load context file /home/vsts/work/1/s/owaspzap/context-file.context : does_not_exist
Total of 815 URLs
PASS: Vulnerable JS Library (Powered by Retire.js) [10003]
...

azure-pipelines-yml config:

        - task: owaspzap@1
          inputs:
            threshold: '50'
            scantype: 'targetedScan'
            url: 'https://****'
            providedCustomContext: true
            contextPath: '$(Build.SourcesDirectory)/owaspzap/context-file.context'
            port: '443'

Was someone able to use the context file succefully?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions