fix(security): zap rules #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: reuse-zap | ||
on: | ||
workflow_call: | ||
inputs: | ||
service_name: { required: true, type: string } | ||
target_url: { required: true, type: string } | ||
auth_type: { required: false, type: string, default: "none" } | ||
secret_name: { required: false, type: string } | ||
secrets: | ||
GITHUB_TOKEN: | ||
required: false | ||
jobs: | ||
zap: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
security-events: write | ||
actions: read | ||
issues: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run ZAP Baseline | ||
uses: zaproxy/[email protected] | ||
with: | ||
target: ${{ inputs.target_url }} | ||
rules_file_name: ".zap/rules.tsv" # optional: to ignore known FP | ||
cmd_options: "-a" # attack mode lite | ||
artifact_name: zap-scan | ||
- name: Convert ZAP report to SARIF | ||
run: | | ||
pipx install zap2sarif | ||
zap2sarif -i zap_scan.xml -o zap.sarif || true | ||
- name: Upload SARIF to code scanning | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: zap.sarif | ||
- name: Persist full HTML report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: zap-report-${{ inputs.service_name }} | ||
path: | | ||
report_html.html |