Skip to content

Commit

Permalink
feat: move pen tests to cronjob (#24)
Browse files Browse the repository at this point in the history
* Remove penetration tests from main merge
* Cronjob for penentration tests
  • Loading branch information
DerekRoberts authored Sep 22, 2023
1 parent 773c5bc commit 0e66926
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
schedule:
- cron: "0 11 * * 0" # 3 AM PST = 12 PM UDT, runs sundays
- cron: "0 11 * * 0" # 3 AM PST = 12 PM UDT, Sundays
workflow_dispatch:

concurrency:
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: backend
file: backend/openshift.deploy.yml
overwrite: true
verification_path: /api
verification_path: /health
- name: frontend
file: frontend/openshift.deploy.yml
overwrite: true
Expand All @@ -39,10 +39,6 @@ jobs:
parameters:
-p ZONE=test -p PROMOTE=${{ github.repository }}/${{ matrix.name }}:test
-p NAME=${{ github.event.repository.name }} ${{ matrix.parameters }}
penetration_test: true
penetration_test_artifact: ${{ matrix.name }}
penetration_test_issue: ${{ matrix.name }}
penetration_test_token: ${{ secrets.GITHUB_TOKEN }}
verification_path: ${{ matrix.verification_path }}

deploys-prod:
Expand All @@ -57,7 +53,7 @@ jobs:
- name: backend
file: backend/openshift.deploy.yml
overwrite: true
verification_path: /api
verification_path: /health
- name: frontend
file: frontend/openshift.deploy.yml
overwrite: true
Expand All @@ -72,7 +68,6 @@ jobs:
parameters:
-p ZONE=prod -p PROMOTE=${{ github.repository }}/${{ matrix.name }}:test
-p NAME=${{ github.event.repository.name }} ${{ matrix.parameters }}
penetration_test: false
verification_path: ${{ matrix.verification_path }}

image-promotions:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/pentests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Penetration Tests

on:
schedule: [cron: "0 11 * * 6"] # 3 AM PST = 12 PM UDT, Saturdays
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
zap_scan:
runs-on: ubuntu-latest
name: Penetration Tests
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}-test
strategy:
matrix:
name: [backend, frontend]
steps:
- name: ZAP Scan
uses: zaproxy/[email protected]
with:
allow_issue_writing: true
artifact_name: "zap_${{ matrix.name }}"
cmd_options: "-a"
issue_title: "ZAP: ${{ matrix.name }}"
target: https://${{ env.PREFIX }}-${{ matrix.name }}.${{ env.DOMAIN }}

0 comments on commit 0e66926

Please sign in to comment.