-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (84 loc) · 2.42 KB
/
dast.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: DAST
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
dast:
timeout-minutes: 60
runs-on: ubuntu-latest
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: crappy_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Run migrations
run: psql -f migrations/init.sql postgresql://postgres:postgres@localhost:5432/crappy_test
- name: Run seeds
run: |
psql -f .github/workflows/seeds/users.sql postgresql://postgres:postgres@localhost:5432/crappy_test &&
psql -f .github/workflows/seeds/boards.sql postgresql://postgres:postgres@localhost:5432/crappy_test
- name: Set up Gleam, Beam
uses: erlef/setup-beam@v1
with:
otp-version: "26.0.2"
gleam-version: "1.4.1"
rebar3-version: "3"
- run: gleam deps download
- run: gleam build
- name: "Start Backend"
env:
BASE_URL: http://localhost:8000
SECRET_KEY_BASE: test-secret-key
EMAIL_API_KEY: "fake-emil-api-key"
REDIS_HOST: localhost
PG_USER: postgres
PG_PASSWORD: postgres
PG_HOST: localhost
PG_PORT: 5432
PG_DB: crappy_test
run: |
gleam run &
sleep 30 &&
curl http://localhost:8000 -I
- name: ZAP Scan
uses: zaproxy/[email protected]
with:
docker_name: 'ictu/zap2docker-weekly:latest'
target: 'http://localhost:8000'
allow_issue_writing: false
cmd_options: |
'-a --hook=/zap/auth_hook.py -z "auth.loginurl=http://localhost:8000/signin
auth.auto
auth.username='[email protected]'
auth.password='aaaaaaaa'
auth.username_field="email"
auth.password_field="password"
auth.auto=1
auth.submit_field="submit"
auth.exclude='.*signout.*'
"'