add required security HTTP headers (#568)
This commit is contained in:
parent
14e9719bcc
commit
204c6729e7
1 changed files with 9 additions and 0 deletions
|
@ -73,6 +73,15 @@ func serve(cctx *cli.Context) error {
|
||||||
|
|
||||||
e := echo.New()
|
e := echo.New()
|
||||||
e.HideBanner = true
|
e.HideBanner = true
|
||||||
|
// SECURITY: Do not modify without due consideration.
|
||||||
|
e.Use(middleware.SecureWithConfig(middleware.SecureConfig{
|
||||||
|
ContentTypeNosniff: "nosniff",
|
||||||
|
XFrameOptions: "SAMEORIGIN",
|
||||||
|
HSTSMaxAge: 31536000, // 365 days
|
||||||
|
// TODO:
|
||||||
|
// ContentSecurityPolicy
|
||||||
|
// 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.
|
||||||
Skipper: func(c echo.Context) bool {
|
Skipper: func(c echo.Context) bool {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue