Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

harden web security #259

Merged
merged 40 commits into from
Jan 4, 2022
Merged

harden web security #259

merged 40 commits into from
Jan 4, 2022

Conversation

abhinavkgrd
Copy link
Member

@abhinavkgrd abhinavkgrd commented Nov 30, 2021

Description

  • Moved headers from Next config to _headers because static exported files don't retain the headers [1]
  • added security headers suggested by observatory with some caveats
  • style-src unsafe-inline allowed [2][3]
  • script-src unsafe-eval allowed [4][5]
  • use ente domain URLs for workers
  • added connect-src https://ente-prod-eu.s3.eu-central-003.backblazeb2.com

[1] https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features
[2] vercel/next.js#18557
[3] styled-components/styled-components#2363
[4] WebAssembly/content-security-policy#7
[5] strukturag/libheif#173

Test Plan

Observatory shows that the intended directives have been activated:
https://observatory.mozilla.org/analyze/web-security.bada-frame.pages.dev

@abhinavkgrd abhinavkgrd marked this pull request as draft November 30, 2021 17:13
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 30, 2021

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 72ed18f
Status:⚡️  Build in progress...

View logs

@abhinavkgrd abhinavkgrd force-pushed the web-security branch 2 times, most recently from 5c9d19e to 1e53886 Compare December 2, 2021 09:02
@abhinavkgrd abhinavkgrd marked this pull request as ready for review December 3, 2021 15:38
@abhinavkgrd abhinavkgrd marked this pull request as draft January 4, 2022 07:30
@abhinavkgrd abhinavkgrd merged commit 1d0aa42 into master Jan 4, 2022
@abhinavkgrd abhinavkgrd deleted the web-security branch January 16, 2022 11:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants