Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): move ZAP pen testing to scheduled jobs #769

Merged
merged 5 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: false
penetration_test: false
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/database:${{ env.ZONE }}
Expand All @@ -253,7 +252,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
penetration_test: false
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
Expand All @@ -273,7 +271,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
penetration_test: false
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
Expand All @@ -288,7 +285,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
penetration_test: false
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/frontend:${{ env.ZONE }}
Expand All @@ -304,7 +300,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
penetration_test: false
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
Expand Down Expand Up @@ -394,7 +389,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: false
penetration_test: false
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/database:${{ env.PREV }}
Expand All @@ -407,7 +401,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
penetration_test: false
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
Expand All @@ -427,7 +420,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
penetration_test: false
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
Expand All @@ -442,7 +434,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
penetration_test: false
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/frontend:${{ env.PREV }}
Expand All @@ -458,7 +449,6 @@ jobs:
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
penetration_test: false
verification_path: health
parameters:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Pull Request Open

on:
pull_request:
workflow_dispatch:

concurrency:
# PR open and close use the same group, allowing only one at a time
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Scheduled

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]
include:
- name: backend
target: https://nr-forest-client-test-backend.apps.silver.devops.gov.bc.ca
- name: frontend
target: https://nr-forest-client-test-frontend.apps.silver.devops.gov.bc.ca
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: ${{ matrix.target }}
11 changes: 2 additions & 9 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@ name: Unit Tests and Analysis

on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]
push:
branches:
- main
paths-ignore:
- "**.md"
branches: [main]
workflow_dispatch:

concurrency:
Expand Down
Loading