Testing #31
Workflow file for this run
This file contains 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: Security | |
on: | |
schedule: | |
- cron: "30 5 * * MON-FRI" # Every weekday at 05:30 UTC | |
workflow_dispatch: | |
push: # TODO remove after testing | |
jobs: | |
zap: | |
runs-on: moj-cloud-platform | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup ZAP | |
uses: ./.github/actions/setup-zap | |
- name: Setup Firefox | |
id: firefox | |
uses: browser-actions/setup-firefox@233224b712fc07910ded8c15fb95a555c86da76f # v1 | |
with: | |
firefox-version: latest-esr | |
- name: Replace variables in config file | |
run: envsubst < "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE" && cat "$CONFIG_FILE" | |
env: | |
CONFIG_FILE: ${{ github.workspace }}/.zap/autorun.yml | |
ZAP_USERNAME: ${{ secrets.ZAP_USERNAME }} | |
ZAP_PASSWORD: ${{ secrets.ZAP_PASSWORD }} | |
shell: bash | |
- name: Run scan | |
run: owasp-zap -cmd -autorun "$CONFIG_FILE" -config selenium.firefoxBinary="$FIREFOX_BINARY" | |
env: | |
FIREFOX_BINARY: ${{ steps.firefox.outputs.firefox-path }} | |
CONFIG_FILE: ${{ github.workspace }}/.zap/autorun.yml | |
shell: bash | |
- name: Publish HTML report | |
uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e # v4.5.0 | |
with: | |
folder: ${{ github.workspace }}/.zap/zap-report | |
target-folder: zap-report | |
- name: Add HTML report URL to the job summary | |
run: echo '[🛡️ OWASP ZAP Report](https://ministryofjustice.github.io/hmpps-manage-a-supervision-ui/zap-report)' | tee -a "$GITHUB_STEP_SUMMARY" | |
- name: Upload report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: zap-report | |
path: ${{ github.workspace }}/.zap/zap-report |