Skip to content

Commit

Permalink
let hsts use settings from cdap config
Browse files Browse the repository at this point in the history
add hsts settings to cdap.json

add root flag
  • Loading branch information
sumengwang committed Aug 4, 2023
1 parent 8790f91 commit dd80900
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 1 deletion server/config/development/cdap.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
"session.secret.key": "sample-secret-key-for-encryption",
"feature.lifecycle.management.edit.enabled": "true",
"ui.analyticsTag": "",
"ui.GTM": ""
"ui.GTM": "",
"hsts.enabled": "false",
"hsts.max.age": 15552000,
"hsts.include.sub.domains": "true",
"hsts.preload": "true"
}
11 changes: 7 additions & 4 deletions server/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,13 @@ function makeApp(authAddress, cdapConfig, uiSettings) {
reportUri: `https://csp.withgoogle.com/csp/cdap`,
},
},
hsts: {
includeSubDomains: true,
preload: true,
},
strictTransportSecurity: cdapConfig["hsts.enabled"]
? {
maxAge: cdapConfig["hsts.max.age"],
includeSubDomains: cdapConfig["hsts.include.sub.domains"],
preload: cdapConfig["hsts.preload"],
}
: false,
// Hub icons are cross-origin but don't supply CORS headers
// TODO credentialless will also work but isn't supported by FF and Safari
crossOriginEmbedderPolicy: false
Expand Down

0 comments on commit dd80900

Please sign in to comment.