Skip to content

Commit

Permalink
feat: penetration tests in cronjob (#658)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Berg <[email protected]>
Co-authored-by: cberg-aot <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2023
1 parent 9efb05a commit f8c1a73
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ on:
default: 'test'
required: true
type: string
penetration_test:
description: 'If penetration test is required'
default: false
required: true
type: boolean
vault_zone:
description: 'Which vault zone to use'
default: 'dev'
Expand Down Expand Up @@ -46,11 +41,6 @@ on:
default: 'test'
required: true
type: string
penetration_test:
description: 'If penetration test is required'
default: false
required: true
type: boolean
vault_zone:
description: 'Which vault zone to use'
default: 'dev'
Expand Down Expand Up @@ -168,5 +158,3 @@ jobs:
-p MOTIPAY_MERCHANT_ID=${{steps.vault.outputs.VAULT_MOTIPAY_MERCHANT_ID}}
-p MOTIPAY_BASE_URL=${{steps.vault.outputs.VAULT_MOTIPAY_BASE_URL}}
${{ matrix.parameters }}
penetration_test: ${{ github.event_name != 'pull_request'}}
penetration_test_issue: ${{ matrix.name }}
2 changes: 0 additions & 2 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ jobs:
with:
environment: 'test'
imagetag: 'latest' # we promote AFTER successful deploy of candidate
penetration_test: true
vault_zone: 'test'
zone: 'test'
secrets: inherit
Expand Down Expand Up @@ -192,7 +191,6 @@ jobs:
with:
environment: 'prod'
imagetag: 'test'
penetration_test: false
vault_zone: 'prod'
zone: 'prod'
secrets: inherit
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:
name: Penetration Tests
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}-test
runs-on: ubuntu-latest
strategy:
matrix:
name: [backend-dops, backend-vehicles, 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 }}
2 changes: 1 addition & 1 deletion .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
Once merged, code will be promoted and handed off to following workflow run.
[Main Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge-main.yml)
builds:
name: Builds
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -66,7 +67,6 @@ jobs:
with:
environment: 'dev'
imagetag: ${{ github.event.number }}
penetration_test: false
vault_zone: 'dev'
zone: ${{ github.event.number }}
secrets: inherit

0 comments on commit f8c1a73

Please sign in to comment.