Skip to content

Commit 16ea536

Browse files
Fixing owasp action (#84)
1 parent 2b943e6 commit 16ea536

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/oswasp-zap-default.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ jobs:
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
23+
24+
- name: Extract domain name # Extract domain name from URL
25+
id: extract_domain
26+
run: |
27+
STRIPPED_DOMAIN=$(echo "${{ matrix.domain }}" | sed -E 's|^https?://||' | sed 's|/.*||')
28+
echo "domain_name=$STRIPPED_DOMAIN" >> $GITHUB_OUTPUT
29+
2330
- name: OWASP ZAP - Baseline Vulnerability Scan
2431
uses: zaproxy/action-baseline@7c4deb10e6261301961c86d65d54a516394f9aed # v0.14.0
2532
with:
@@ -29,10 +36,13 @@ jobs:
2936
cmd_options: '-s -j'
3037
target: ${{ matrix.domain }}
3138
rules_file_name: "owasp_zap_rules.tsv"
39+
artifact_name: "zap_scan_${{ steps.extract_domain.outputs.domain_name }}_${{ github.run_id }}"
40+
3241
- name: Extract alerts
3342
run: |
3443
jq -c '.site[] as $site | .site[] | .alerts[] | .host = $site."@host" | .' report_json.json > output.jsonl
3544
sort -u output.jsonl > unique_output.jsonl
45+
3646
- name: Forward results to Sentinel
3747
uses: cds-snc/sentinel-forward-data-action@main
3848
with:

0 commit comments

Comments
 (0)