Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tse00 opened this issue Jan 12, 2023 · 1 comment
Open
Labels

Comments

@tse00
Copy link

tse00 commented Jan 12, 2023

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?

@CaroXu
Copy link

CaroXu commented Jun 27, 2023

I meet exactly the same issue. I can confirm the Context.context file is there but it keeps saying "does_not_exist". Really hope someone can help with the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants