-
Notifications
You must be signed in to change notification settings - Fork 4
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(sec): add security headers #311
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
default-src 'self'; | ||
connect-src 'self' https://variant.innocraft.cloud/; | ||
script-src 'self' 'sha256-j6xN8x073Dhm+Ee4HKwIIRXsHIqI5aIRHC0pgnhVcJY=' https://variant.innocraft.cloud/ ${ | ||
process.env.NODE_ENV !== 'production' ? "'unsafe-eval'" : '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'unsafe-eval' needed for hot reload in dev build
const ContentSecurityPolicy = ` | ||
default-src 'self'; | ||
connect-src 'self' https://variant.innocraft.cloud/; | ||
script-src 'self' 'sha256-j6xN8x073Dhm+Ee4HKwIIRXsHIqI5aIRHC0pgnhVcJY=' https://variant.innocraft.cloud/ ${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have used 'strict-dynamic' but there is no good way of using generated nonces in Nextjs vercel/next.js#21587
0e2aac9
to
40489d4
Compare
Haven't gone through all potential external references here, but at a glance it looks to cover the things I can think of at least. Now there will be a new implementation of variant webpage, so this would have to be ported over. In that port I also think we could transition to using middleware which I belive now can support nonce. |
40489d4
to
827ffa5
Compare
About Nextjs security headers https://nextjs.org/docs/advanced-features/security-headers
About CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy