feat: complete remediation phase 3
Some checks failed
Automated Container Build / build-and-push (push) Failing after 15s

This commit is contained in:
Elijah 2026-05-26 14:23:50 -07:00
parent 0221e277a6
commit 6772ba8c43
10 changed files with 63 additions and 20 deletions

View file

@ -104,9 +104,14 @@ func main() {
return c.Next()
})
app.Use(helmet.New())
app.Use(func(c *fiber.Ctx) error {
c.Set("Content-Security-Policy", "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self' wss: https: http:;")
return c.Next()
})
allowedOrigins := os.Getenv("ALLOWED_ORIGINS")
if allowedOrigins == "" {
allowedOrigins = "http://localhost:3000"
log.Println("WARNING: ALLOWED_ORIGINS not set \u2014 CORS will reject all cross-origin requests")
allowedOrigins = "https://no-origin-configured.invalid"
}
app.Use(cors.New(cors.Config{