Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(familie-backend/headers.ts): legg til Nav telemetry URL-er i CSP… #1586

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/familie-backend/src/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ const fontSource = 'https://fonts.gstatic.com';
const navFontSource = 'https://cdn.nav.no';
const amplitude = 'https://amplitude.nav.no';
const sentry = 'https://sentry.gc.nav.no';
const navTelemetry = 'https://telemetry.nav.no';
const navTelemetryDev = 'https://telemetry.ekstern.dev.nav.no';

const cspString = `default-src 'self' data: ${amplitude} ${sentry}; style-src 'self' ${styleSource} data: 'unsafe-inline'; font-src 'self' ${fontSource} ${navFontSource} data:; frame-src 'self' blob:;`;
const cspString = `default-src 'self' data: ${amplitude} ${sentry} ${navTelemetry} ${navTelemetryDev}; style-src 'self' ${styleSource} data: 'unsafe-inline'; font-src 'self' ${fontSource} ${navFontSource} data:; frame-src 'self' blob:;`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Er ikke helt heldig å stappe inn begge to hver gang, men kom ikke frem til en god måte å finne nåværende miljø når det er et fellesbibliotek. Åpen for innspill

Copy link
Contributor

Choose a reason for hiding this comment

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

Er enig, dette er enkleste løsning, som sannsynligvis er beste løsning ☺️


const setup = (app: Express) => {
app.disable('x-powered-by');
Expand Down