Skip to content

chore: add security http header#1343

Open
achorein wants to merge 2 commits into
mainfrom
chore/security-http-header
Open

chore: add security http header#1343
achorein wants to merge 2 commits into
mainfrom
chore/security-http-header

Conversation

@achorein

Copy link
Copy Markdown
Collaborator

Ticket(s) lié(s)

Description

Les en-têtes de sécurité HTTP sont maintenant alignés avec les recommandations d’audit.

Cause principale
En production, les frontends sont servis par l’image nginx4spa, qui imposait encore :

X-XSS-Protection: 1; mode=block (à remplacer par 0)
pas de Referrer-Policy
pas de Content-Security-Policy
La config nuxt-security ne s’applique pas au build statique (generate + nginx).

Modifications

  1. Nginx (production) — docker/nginx-spa.conf
    Utilisé par les deux Dockerfiles front :

Referrer-Policy: no-referrer
X-XSS-Protection: 0
Content-Security-Policy avec object-src 'none' et script-src restreint (aligné sur la config Nuxt existante)
conservation de X-Frame-Options et X-Content-Type-Options
2. Nuxt (dev / preview) — nuxt.config.ts (usagers + BO)
Ajout explicite de referrerPolicy, xXSSProtection: "0" et object-src: 'none'.

  1. API — packages/backend/src/app.ts et packages/external-api/src/main.ts
    Même politique côté Express / Nest (helmet + X-XSS-Protection: 0 pour le backend).

Vérification après déploiement
curl -sI https:/// | grep -iE 'referrer-policy|content-security-policy|x-xss-protection'
Attendu :

Referrer-Policy: no-referrer
X-XSS-Protection: 0
Content-Security-Policy: ... object-src 'none' ...

Screenshot / liens loom

Check-list

  • Ma branche est rebase sur main
  • Des tests ont été écrits pour tous les endpoints créés ou modifiés
  • Refacto "à la volée" des parties sur lesquelles j'ai codée
  • Plus de console.log
  • J'ai ajouté une validation de schéma sur la route que j'ai ajouté ou modifié
  • J'ai converti les fichiers vue en <script lang="ts">
  • Mon code est en Typescript (autant que possible)

Testing instructions

@achorein achorein self-assigned this May 19, 2026
@revu-bot revu-bot Bot requested a review from revu-bot May 19, 2026 12:47

@revu-bot revu-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An internal error occurred. Please check the logs for details.

Revu logs

@achorein achorein force-pushed the chore/security-http-header branch from ac6453d to 83b01ed Compare June 3, 2026 07:45
@achorein achorein temporarily deployed to build-review-auto June 3, 2026 07:45 — with GitHub Actions Inactive
@achorein achorein had a problem deploying to build-review-auto June 3, 2026 07:45 — with GitHub Actions Failure
@achorein achorein temporarily deployed to build-review-auto June 3, 2026 07:45 — with GitHub Actions Inactive
@achorein achorein temporarily deployed to build-review-auto June 3, 2026 07:45 — with GitHub Actions Inactive
@achorein achorein had a problem deploying to build-review-auto June 3, 2026 07:45 — with GitHub Actions Failure
@achorein achorein temporarily deployed to build-review-auto June 3, 2026 07:45 — with GitHub Actions Inactive
@sonarqubecloud

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants