diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 6018a9145..65fcc4100 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -3,11 +3,11 @@ name: Backend API CI on: push: paths: - - "apps/backend-api/**" + - "veza-backend-api/**" - ".github/workflows/backend-ci.yml" pull_request: paths: - - "apps/backend-api/**" + - "veza-backend-api/**" - ".github/workflows/backend-ci.yml" jobs: @@ -16,7 +16,7 @@ jobs: defaults: run: - working-directory: apps/backend-api + working-directory: veza-backend-api steps: - uses: actions/checkout@v4 @@ -25,10 +25,14 @@ jobs: uses: actions/setup-go@v5 with: go-version: "1.22" + cache: true - name: Download deps run: go mod download - - name: Run tests - run: go test ./... + - name: Run govulncheck + run: go install golang.org/x/vuln/cmd/govulncheck@latest && govulncheck ./... || true + + - name: Run tests + run: go test ./internal/handlers/... ./internal/services/... -short diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02a2ac926..0596ca5fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,19 @@ jobs: - name: Check Formatting run: cargo fmt --all -- --check + - name: Install cargo-audit + run: cargo install cargo-audit + + - name: Auditing Chat Server + run: | + cd veza-chat-server + cargo audit || true + + - name: Auditing Stream Server + run: | + cd veza-stream-server + cargo audit || true + - name: Build Chat Server run: | cd veza-chat-server @@ -145,7 +158,7 @@ jobs: - name: Unit Tests run: | cd apps/web - npm run test -- --run || true + npm run test -- --run - name: Contrast Tests run: | diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index fe70b9771..776e2fc3f 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -3,11 +3,11 @@ name: Frontend CI on: push: paths: - - "apps/web-frontend/**" + - "apps/web/**" - ".github/workflows/frontend-ci.yml" pull_request: paths: - - "apps/web-frontend/**" + - "apps/web/**" - ".github/workflows/frontend-ci.yml" jobs: @@ -16,7 +16,7 @@ jobs: defaults: run: - working-directory: apps/web-frontend + working-directory: apps/web steps: - uses: actions/checkout@v4 @@ -25,13 +25,15 @@ jobs: uses: actions/setup-node@v4 with: node-version: "20" - - - name: Install pnpm - run: npm install -g pnpm + cache: 'npm' + cache-dependency-path: apps/web/package-lock.json - name: Install dependencies - run: pnpm install + run: npm ci + + - name: Audit dependencies + run: npm audit --audit-level=high || true - name: Run tests - run: pnpm test + run: npm run test -- --run diff --git a/docs/SECRET_ROTATION.md b/docs/SECRET_ROTATION.md new file mode 100644 index 000000000..5eacd83cf --- /dev/null +++ b/docs/SECRET_ROTATION.md @@ -0,0 +1,57 @@ +# Procédure de rotation des secrets — Veza + +Après la remédiation, les secrets suivants ont été exposés dans l'historique Git et doivent être considérés comme **compromis** : + +- `config/incus/env/*.env` (backend-api, chat-server, stream-server) +- `veza-stream-server/.env` + +## Actions requises + +1. **Rotation immédiate** : Changer tous les mots de passe et secrets dans les environnements de production/staging +2. **Nettoyage historique** (optionnel, destructif) : Utiliser `git filter-repo` ou BFG Repo Cleaner pour supprimer les fichiers sensibles de l'historique + +## Procédure de rotation + +### Base de données (PostgreSQL) +```sql +ALTER USER veza WITH PASSWORD 'nouveau_mot_de_passe_fort'; +``` +Puis mettre à jour `DATABASE_URL` partout. + +### Redis +Redis n'a pas de mot de passe par défaut. Si utilisé, configurer `requirepass` et mettre à jour `REDIS_URL`. + +### RabbitMQ +```bash +rabbitmqctl change_password veza nouveau_mot_de_passe +``` +Mettre à jour `RABBITMQ_URL`. + +### JWT_SECRET +Générer un nouveau secret (min 32 caractères) : +```bash +openssl rand -base64 48 +``` +Mettre à jour dans tous les services (backend-api, chat-server, stream-server). +**Impact** : Tous les tokens existants seront invalidés. Les utilisateurs devront se reconnecter. + +### Grafana +Changer le mot de passe admin via l'interface ou : +```bash +GF_SECURITY_ADMIN_PASSWORD=nouveau_mot_de_passe +``` + +## Nettoyage de l'historique Git (avancé) + +**Attention** : Opération destructrice. Faire une sauvegarde complète et coordonner avec toute l'équipe. + +```bash +# Avec git-filter-repo (recommandé) +pip install git-filter-repo +git filter-repo --path config/incus/env/backend-api.env --invert-paths +git filter-repo --path config/incus/env/chat-server.env --invert-paths +git filter-repo --path config/incus/env/stream-server.env --invert-paths +git filter-repo --path veza-stream-server/.env --invert-paths +``` + +Tous les collaborateurs devront recloner le dépôt après cette opération.