generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 9
57 lines (46 loc) · 1.62 KB
/
dast.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: ZAP
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: ZAP API Scan
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: corretto
cache: gradle
- name: ShadowJar
run: ./gradlew clean shadowJar
- name: Install Latest Version of Docker Compose v2
run: |
COMPOSE_VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq '.tag_name' -r)
INSTALL_LOCATION=/usr/libexec/docker/cli-plugins/docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-linux-x86_64" -o ${INSTALL_LOCATION}
sudo chmod +x ${INSTALL_LOCATION}
docker compose version
- name: Run App in Container
run: docker compose up --build -d
- name: Check API Health
run: ./health-check.sh
# - name: Pull ZAP OWASP Image
# run: docker pull owasp/zap2docker-weekly
#
# - name: Create docker network
# run: docker network create zapnet
- name: Run ZAP API Scan
run: sudo docker run -v $(pwd):/zap/wrk/:rw -t owasp/zap2docker-weekly zap-api-scan.py -t http://$(ip -f inet -o addr show docker0 | awk '{print $4}' | cut -d '/' -f 1):8080/openapi -f openapi -r api-scan-report.html
- name: Upload Report
uses: actions/upload-artifact@v3
if: always()
with:
name: zap-scan-report
path: api-scan-report.html