Skip to content

Add DAST ZAP full scan workflow configuration #24

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

Merged
merged 2 commits into from
Apr 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/DAST-ZAP-Zed-Attach-Proxy-Checkmarx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# https://www.zaproxy.org/
# https://www.zaproxy.org/docs/
# https://github.com/zaproxy/
# https://www.zaproxy.org/docs/automate/
# https://github.com/zaproxy/action-full-scan

name: DAST - Zed Attack Proxy (ZAP) Full Scan

on:
push:
branches: [main]
schedule:
- cron: 0 1 * * 0

env:
ZAP_TARGET: "http://127.0.0.1:8080/" # Change this to your target URL
buildAndStart: "true" # Change to "true" to build and start the application if not running
imageName: "webapp01"
tag: ${{ github.sha }}
HOST_PORT: "8080"
CONTAINER_PORT: "8000"

permissions:
contents: read

jobs:
zap_scan:
name: ZAP Full Scan
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
# build and start your application here
# conditionally run the build step
# assuming the application is a Docker container
- name: Check if application is running, if not, build and start it
if: env.buildAndStart == 'true'
run: |
if ! curl -s --head --request GET ${{ env.ZAP_TARGET }} | grep "200 OK" > /dev/null; then
echo "Application is not running. Building and starting the application..."
docker build ./src/webapp01 --file ./src/webapp01/Dockerfile -t ${{ env.imageName }}:${{ env.tag }}
docker run -d --rm -p ${{ env.HOST_PORT }}:${{ env.CONTAINER_PORT }} ${{ env.imageName }}:${{ env.tag }}
else
echo "Application is already running."
fi
- name: Run ZAP Scan
uses: zaproxy/action-full-scan@v0.12.0

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'DAST - Zed Attack Proxy (ZAP) Full Scan' step
Uses Step: zap
uses 'zaproxy/action-full-scan' with ref 'v0.12.0', not a pinned commit hash
id: zap
with:
target: "${{ env.ZAP_TARGET }}"
Loading