Using ghcr.io/zaproxy/zaproxy:stable in the Github Actions

87 views
Skip to first unread message

Mohsin Rasheed

unread,
Jul 9, 2024, 4:34:15 AM7/9/24
to ZAP User Group
Hi,
I am trying to use ghcr.io/zaproxy/zaproxy:stable as a service in github action to use it as a proxy for my Playwright automated tests

  • that's how my yaml looks for the Workflow

  • jobs:
    e2eTests_run:
    runs-on: vcc-azure-ubuntu-latest
    services:
    zap:
    image: ghcr.io/zaproxy/zaproxy:stable
    ports:
    - 8090:8090

  • But the container failed to start in the Github actions


    Digest: sha256:39b1ebe74fba7f3048f6a6801c66b1d0f36dcc970813b65847a724ceb3837b94
    Status: Downloaded newer image for ghcr.io/zaproxy/zaproxy:stable
    ghcr.io/zaproxy/zaproxy:stable
    /usr/bin/docker create --name 9d2fdafaf4f84d069fe04c8c97a624e4_ghcriozaproxyzaproxystable_d037f7 --label 75afe4 --network github_network_0037e3b637ab46008fe19a53aaed59a6 --network-alias zap -p 8090:8090 -e GITHUB_ACTIONS=true -e CI=true ghcr.io/zaproxy/zaproxy:stable
    50f4a30719d5a8544dd5c843a606afa86d4e33c0c290f3810419338838959eb4
    /usr/bin/docker start 50f4a30719d5a8544dd5c843a606afa86d4e33c0c290f3810419338838959eb4
    50f4a30719d5a8544dd5c843a606afa86d4e33c0c290f3810419338838959eb4
    /usr/bin/docker ps --all --filter id=50f4a30719d5a8544dd5c843a606afa86d4e33c0c290f3810419338838959eb4 --filter status=running --no-trunc --format "{{.ID}} {{.Status}}"
    50f4a30719d5a8544dd5c843a606afa86d4e33c0c290f3810419338838959eb4 Up Less than a second (health: starting)
    /usr/bin/docker port 50f4a30719d5a8544dd5c843a606afa86d4e33c0c290f3810419338838959eb4
    Waiting for all services to be ready
    /usr/bin/docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" 50f4a30719d5a8544dd5c843a606afa86d4e33c0c290f3810419338838959eb4
    unhealthy
    Service container zap failed.
    /usr/bin/docker logs --details 50f4a30719d5a8544dd5c843a606afa86d4e33c0c290f3810419338838959eb4
    Error: Failed to initialize container ghcr.io/zaproxy/zaproxy:stable
    Error: One or more containers failed to start.

Can Someone please help?

Simon Bennetts

unread,
Jul 11, 2024, 5:33:25 AM7/11/24
to ZAP User Group
For info, answered on the OWASP Slack project-zap channel:

ZAP is not designed to be run as a long running service.
In this case you can use the Automation Framework - that has a delay job which is designed for pausing while tests are proxied through ZAP


Cheers,

Simon
Reply all
Reply to author
Forward
0 new messages