Skip to content

Commit af55159

Browse files
committed
Add security headers to frontend
1 parent 016b08b commit af55159

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

frontend/next.config.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,33 @@ const nextConfig: NextConfig = {
1010
},
1111
],
1212
},
13+
async headers() {
14+
return [
15+
{
16+
source: '/(.*)',
17+
headers: [
18+
{ key: 'X-Content-Type-Options', value: 'nosniff' },
19+
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
20+
{ key: 'Permissions-Policy', value: 'geolocation=(), microphone=(), camera=()' },
21+
{ key: 'X-Frame-Options', value: 'DENY' },
22+
{
23+
key: 'Content-Security-Policy',
24+
value: [
25+
"default-src 'self'",
26+
"script-src 'self' 'unsafe-inline' 'unsafe-eval'",
27+
"style-src 'self' 'unsafe-inline'",
28+
"img-src 'self' data: https://raw.githubusercontent.com",
29+
"font-src 'self'",
30+
"connect-src 'self' wss://monode-mainnet.monadinfra.com https://*.vercel-insights.com https://*.vercel-analytics.com",
31+
"frame-ancestors 'none'",
32+
"base-uri 'self'",
33+
"form-action 'self'",
34+
].join('; '),
35+
},
36+
],
37+
},
38+
]
39+
},
1340
}
1441

1542
export default nextConfig

0 commit comments

Comments
 (0)