From 5e755fff9d70a7fd3c4f85bb524f1b774dd85b25 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Thu, 13 Dec 2018 09:49:45 +0100 Subject: add Content Security Policy (#1252) * add Content Security Policy * remove reflect-metadata on production builds to get rid of unsafe-eval * fix baseCSP usage * add SRI to CSP * add blob: to media-src * remove SRI * CSP set to reportOnly * adding data: to connect-src CSP * remove block-all-mixed-content * add report-uri support --- server.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server.ts') diff --git a/server.ts b/server.ts index 4a2a6ddf5..6dff16f46 100644 --- a/server.ts +++ b/server.ts @@ -53,6 +53,9 @@ if (errorMessage !== null) { app.set('trust proxy', CONFIG.TRUST_PROXY) // Security middleware +import { baseCSP } from './server/middlewares' + +app.use(baseCSP) app.use(helmet({ frameguard: { action: 'deny' // we only allow it for /videos/embed, see server/controllers/client.ts -- cgit v1.2.3