feat(securite): en-tetes HTTP, trust proxies et configuration de production durcie
- middleware SecurityHeaders (HSTS, CSP, X-Frame-Options, etc.) - trustProxies pour le reverse proxy Nginx Proxy Manager - .env.production.example (APP_DEBUG=false, sessions chiffrees, cookies Secure) - politique de securite SECURITY.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Middleware\SecurityHeaders;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
@@ -12,7 +13,13 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware): void {
|
||||
//
|
||||
// L'application est servie derrière un reverse proxy (Nginx Proxy Manager)
|
||||
// qui termine le TLS : on lui fait confiance pour détecter HTTPS,
|
||||
// l'IP réelle du client et le bon schéma d'URL.
|
||||
$middleware->trustProxies(at: '*');
|
||||
|
||||
// En-têtes de sécurité HTTP appliqués à toutes les réponses.
|
||||
$middleware->append(SecurityHeaders::class);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user