Skip to content

Commit

Permalink
Impliment security headers
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangeRanger committed Aug 19, 2024
1 parent 823dd47 commit e1f16ee
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 253 deletions.
38 changes: 37 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,49 @@ export default defineNuxtConfig({
transpile: ["vuetify"],
},
modules: [
"@nuxt/eslint",
"nuxt-security",
(_options, nuxt) => {
nuxt.hooks.hook("vite:extendConfig", (config) => {
config.plugins.push(vuetify({ autoImport: true }));
});
},
"@nuxt/eslint",
],
security: {
headers: {
contentSecurityPolicy: {
"default-src": ["'self'", "https://analytics.hthompson.dev"],
"script-src": [
"'self'",
"https://analytics.hthompson.dev",
"https://files.hthompson.dev/scripts/tracking.js",
"https://static.cloudflareinsights.com",
],
"style-src": ["'self'", "'unsafe-inline'"],
"img-src": ["'self'", "blob:"],
"base-uri": ["'none'"],
"object-src": ["'none'"],
"upgrade-insecure-requests": true
},
permissionsPolicy: {
"camera": [],
"display-capture": [],
"fullscreen": [],
"geolocation": [],
"microphone": [],
"web-share": [],
},
referrerPolicy: "strict-origin",
strictTransportSecurity: {
maxAge: 31536000,
includeSubdomains: true,
preload: true,
},
xContentTypeOptions: "nosniff",
xFrameOptions: "SAMEORIGIN",
xXSSProtection: "1; mode=block",
},
},
vite: {
vue: {
template: {
Expand Down
Loading

0 comments on commit e1f16ee

Please sign in to comment.