-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (93 loc) · 3.2 KB
/
owasp-zap-scan.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# name: owasp-scan
# on:
# workflow_call:
# inputs:
# ZAP_SCAN_TYPE:
# required: true
# type: string
# ZAP_TARGET_URL:
# required: true
# type: string
# ZAP_DURATION:
# required: true
# type: string
# ZAP_MAX_DURATION:
# required: true
# type: string
# ZAP_GCP_PUBLISH:
# required: true
# type: boolean
# ZAP_GCP_PROJECT:
# required: false
# type: string
# ZAP_GCP_BUCKET:
# required: false
# type: string
# secrets:
# GCP_SA_KEY:
# required: false
# jobs:
# owasp-scan:
# runs-on: ubuntu-latest
# name: owasp-scan
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.9'
# - name: Set up Cloud SDK
# if: ${{ inputs.ZAP_GCP_PUBLISH }}
# uses: google-github-actions/setup-gcloud@v1
# with:
# project_id: ${{ inputs.ZAP_GCP_PROJECT }}
# service_account_key: ${{ secrets.GCP_SA_KEY }}
# export_default_credentials: true
# - name: ZAP Base Scan
# if: ${{ inputs.ZAP_SCAN_TYPE == 'base' }}
# uses: zaproxy/action-baseline@v0.6.1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# docker_name: 'owasp/zap2docker-stable'
# target: ${{ inputs.ZAP_TARGET_URL }}
# rules_file_name: '.zap/rules.tsv'
# cmd_options: '-a -d -T ${{ inputs.ZAP_MAX_DURATION }} -m ${{ inputs.ZAP_DURATION }}'
# issue_title: OWAP Baseline
# - name: ZAP Full Scan
# if: ${{ inputs.ZAP_SCAN_TYPE == 'full' }}
# uses: zaproxy/action-full-scan@v0.3.0
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# docker_name: 'owasp/zap2docker-stable'
# target: ${{ inputs.ZAP_TARGET_URL }}
# rules_file_name: '.zap/rules.tsv'
# cmd_options: '-a -d -T ${{ inputs.ZAP_MAX_DURATION }} -m ${{ inputs.ZAP_DURATION }}'
# - name: Create Artifact Directory
# if: ${{ inputs.ZAP_GCP_PUBLISH }}
# run: |
# mkdir -p public/zap
# - name: Publish Reports to Github
# uses: actions/download-artifact@v2
# with:
# name: zap_scan
# path: public/zap
# - name: Rename Markdown
# if: ${{ inputs.ZAP_GCP_PUBLISH }}
# run: |
# mv public/zap/report_md.md public/zap/README.md
# - name: ZAP Results
# uses: JamesIves/github-pages-deploy-action@4.1.6
# with:
# branch: zap-scan
# folder: public/zap
# - name: GCP Publish Results URL
# if: ${{ inputs.ZAP_GCP_PUBLISH }}
# run: |
# echo "$GCP_SA_KEY" > gcp-sa-key.json
# gsutil mb gs://${{ inputs.ZAP_GCP_BUCKET }} || echo "Bucket already exists..."
# gsutil cp public/zap/report_html.html gs://${{ inputs.ZAP_GCP_BUCKET }}
# echo "URL expires in 10 minutes..."
# gsutil signurl -d 10m gcp-sa-key.json gs://${{ inputs.ZAP_GCP_BUCKET }}/report_html.html
# env:
# GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}