Browse Source

fix(security): restrictive production CSP

Adjust our Content Security Policy on production so that it is more
restrictive than when we run in development mode. Changes include:

 - Do not allow loading content/scripts/fonts from localhost
 - Do not allow running code that contains `eval` statements
renovate/lint-staged-8.x
Tom Kirkpatrick 7 years ago
parent
commit
593113449b
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 21
      webpack.config.renderer.prod.js

21
webpack.config.renderer.prod.js

@ -157,15 +157,26 @@ export default merge.smart(baseConfig, {
'object-src': "'none'", 'object-src': "'none'",
'connect-src': [ 'connect-src': [
"'self'", "'self'",
'http://localhost:*',
'ws://localhost:*',
'https://api.coinmarketcap.com', 'https://api.coinmarketcap.com',
'https://zap.jackmallers.com', 'https://zap.jackmallers.com',
'https://testnet-api.smartbit.com.au' 'https://testnet-api.smartbit.com.au'
], ],
'script-src': ["'self'", 'http://localhost:*', "'unsafe-eval'"], 'script-src': ["'self'"],
'font-src': ["'self'", 'data:', 'http://localhost:*', 'https://fonts.googleapis.com', 'https://s3.amazonaws.com', 'https://fonts.gstatic.com'], 'font-src': [
'style-src': ["'self'", 'blob:', 'https://fonts.googleapis.com', 'https://s3.amazonaws.com', 'https://fonts.gstatic.com', "'unsafe-inline'"] "'self'",
'data:',
'https://fonts.googleapis.com',
'https://s3.amazonaws.com',
'https://fonts.gstatic.com'
],
'style-src': [
"'self'",
'blob:',
'https://fonts.googleapis.com',
'https://s3.amazonaws.com',
'https://fonts.gstatic.com',
"'unsafe-inline'"
]
}) })
] ]
}) })

Loading…
Cancel
Save