chore: root commit of OWSAP security testing/tightening
This commit is contained in:
@@ -8,12 +8,21 @@ jobs:
|
||||
deploy:
|
||||
runs-on: vps-host
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Supply chain checks (production dependencies)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd api
|
||||
npm ci
|
||||
npm audit --omit=dev --audit-level=high
|
||||
cd ../web
|
||||
npm ci
|
||||
npm audit --omit=dev --audit-level=high
|
||||
|
||||
- name: Build Web
|
||||
run: |
|
||||
cd web
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Deploy with Docker Compose
|
||||
@@ -48,4 +57,4 @@ jobs:
|
||||
sudo docker-compose exec -T api npx prisma migrate deploy
|
||||
|
||||
- name: Reload Nginx
|
||||
run: sudo systemctl reload nginx
|
||||
run: sudo systemctl reload nginx
|
||||
|
||||
54
.gitea/workflows/security.yml
Normal file
54
.gitea/workflows/security.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Security Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
security-non-db:
|
||||
runs-on: vps-host
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: "npm"
|
||||
cache-dependency-path: api/package-lock.json
|
||||
|
||||
- name: Install API dependencies
|
||||
run: |
|
||||
cd api
|
||||
npm ci
|
||||
|
||||
- name: Run OWASP security suite (non-DB)
|
||||
run: |
|
||||
cd api
|
||||
SECURITY_DB_TESTS=0 npx vitest run -c vitest.security.config.ts
|
||||
|
||||
security-db:
|
||||
if: ${{ secrets.TEST_DATABASE_URL != '' }}
|
||||
runs-on: vps-host
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: "npm"
|
||||
cache-dependency-path: api/package-lock.json
|
||||
|
||||
- name: Install API dependencies
|
||||
run: |
|
||||
cd api
|
||||
npm ci
|
||||
|
||||
- name: Run OWASP security suite (DB-backed)
|
||||
env:
|
||||
TEST_DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
|
||||
run: |
|
||||
cd api
|
||||
SECURITY_DB_TESTS=1 npx vitest run -c vitest.security.config.ts
|
||||
Reference in New Issue
Block a user