Skip to content

Commit

Permalink
5082 - Make content-security-policy more strict
Browse files Browse the repository at this point in the history
  • Loading branch information
kennsippell committed Dec 17, 2018
1 parent aa9847b commit 914a661
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion api/src/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,29 @@ app.use(
// runs with a bunch of defaults: https://github.com/helmetjs/helmet
hpkp: false, // explicitly block dangerous header
contentSecurityPolicy: {
/* jshint ignore:start */
directives: {
frameSrc: ['\'self\''] // prettier-ignore
defaultSrc: ["'none'"],
fontSrc: ["'self'"],
manifestSrc: ["'self'"],
connectSrc: ["'self'"],
formAction: ["'self'"],
imgSrc: [
"'self'",
'data:' // unsafe
],
scriptSrc: [
"'self'",
"'sha256-6i0jYw/zxQO6q9fIxqI++wftTrPWB3yxt4tQqy6By6k='", // Explicitly allow the telemetry script setting startupTimes
"'unsafe-eval'" // AngularJS and several dependencies require this
],
styleSrc: [
"'self'",
"'unsafe-inline'" // angular-ui-bootstrap
],
},
/* jshint ignore:end */
browserSniff: false,
},
})
);
Expand Down

0 comments on commit 914a661

Please sign in to comment.