2

I wanted to use OWASP ZAP in my Azure DevOps pipelines and wanted to use the Docker Image that is available. Also wanted to run the docker container on demand. Found an article on Microsoft DevBlog that addresses this use case. When I tried to replicate that I ran into an issue. When i tried to execute the following command using Azure CLI i came across this error message.

az container exec --resource-group $resourceGroupName --name $aciInstanceName --exec-command "zap-baseline.py -t https://example.com -x OWASP-ZAP-Report.xml"

rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"zap-baseline.py -t https://example.com -x OWASP-ZAP-Report.xml\": stat zap-baseline.py -t https://example.com -x OWASP-ZAP-Report.xm l: no such file or directory"

When i did some digging around, I found that az container exec command does not support using arguments on the official documentation.

Then I created a custom docker image based off of owasp/zap2docker-stable image where I added a bash script that basically runs the same command and tried to call the bash file from Azure CLI

az container exec --resource-group $resourceGroupName --name $aciInstanceName --exec-command "execute-zap-baseline-test.sh"

But then i get the following error message.

rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec format error"

Would really appreciate some help resolving this issue. How can i execute the scan on the OWASP ZAP docker container running on Azure Container Instances

Kasun Kodagoda
  • 3,956
  • 5
  • 31
  • 54
  • Any more questions? Does the solution solve your problem? If it works for you please accept it as the answer. – Charles Xu Sep 27 '19 at 01:19
  • Why don't you leave any response to someone who wants to help you solve the problem?!! – Charles Xu Sep 27 '19 at 08:57
  • @CharlesXu You need to chill out. I did not find time to try your answer yet. I will and accept the answer if its correct. Moving from ACI to AKS is not an option for me, i don't want to have a whole AKS cluster just to run this. i want this to be on demand. Also, I know about the ACI limitation on the docs, its there on the question as well. I want do see why the exact solution that is described in the DevBlog does not work for me. – Kasun Kodagoda Sep 27 '19 at 12:51

0 Answers0