chore: add security http header#1343
Open
achorein wants to merge 2 commits into
Open
Conversation
ac6453d to
83b01ed
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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
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'.
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
console.log<script lang="ts">Testing instructions