bskyweb: configure basic CSP
This commit is contained in:
@@ -135,12 +135,11 @@ func serve(cctx *cli.Context) error {
|
|||||||
|
|
||||||
// SECURITY: Do not modify without due consideration.
|
// SECURITY: Do not modify without due consideration.
|
||||||
e.Use(middleware.SecureWithConfig(middleware.SecureConfig{
|
e.Use(middleware.SecureWithConfig(middleware.SecureConfig{
|
||||||
ContentTypeNosniff: "nosniff",
|
ContentTypeNosniff: "nosniff",
|
||||||
XFrameOptions: "SAMEORIGIN",
|
XFrameOptions: "SAMEORIGIN",
|
||||||
HSTSMaxAge: 31536000, // 365 days
|
HSTSMaxAge: 31536000, // 365 days
|
||||||
// TODO:
|
ContentSecurityPolicy: fmt.Sprintf("default-src * 'unsafe-inline' blob:; script-src 'self' %s", staticCDNHost),
|
||||||
// ContentSecurityPolicy
|
// Note: XSSProtection not configured because it is deprecated, superseded by CSP
|
||||||
// XSSProtection
|
|
||||||
}))
|
}))
|
||||||
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
|
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
|
||||||
// Don't log requests for static content.
|
// Don't log requests for static content.
|
||||||
|
|||||||
Reference in New Issue
Block a user