feat: tighten CSP on the public status page document
Layer a stricter Content-Security-Policy on the /status/public document so custom CSS cannot load external images, fonts, or stylesheets. Browsers enforce the intersection of all CSP headers, so this only narrows the public status page and never loosens the global policy, while keeping the app's Google Fonts. Browser-enforced backstop behind the validator.
This commit is contained in:
1 parent
96021b7479
commit
ffbf223288
3 files changed
+55
No files matched your search
@@ -14,6 +14,7 @@ import { InitializedControllers } from "@/config/controllers.js";
|
||||
import { EnvConfig } from "@/domain/app-settings/app-settings.service.js";
|
||||
import { createStatusPageCorsOrigin } from "@/api/middleware/statusPageCorsOrigin.js";
|
||||
import { isPublicStatusPageApiPath } from "@/api/middleware/statusPagePublicApiPath.js";
|
||||
import { statusPageDocumentCsp } from "@/api/middleware/statusPageDocumentCsp.js";
|
||||
|
||||
export const createApp = ({
|
||||
services,
|
||||
@@ -70,6 +71,7 @@ export const createApp = ({
|
||||
},
|
||||
})
|
||||
);
|
||||
app.use(statusPageDocumentCsp);
|
||||
app.use(
|
||||
compression({
|
||||
level: 6,
|
||||
|
||||
Reference in new issue
Block a user