Skip to content

Commit

Permalink
feat: add secure default headers to websecure
Browse files Browse the repository at this point in the history
  • Loading branch information
layertwo committed Jan 10, 2025
1 parent e14e7fd commit a981c9e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
37 changes: 37 additions & 0 deletions clusters/home/apps/network/traefik/addons/middleware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: secure-headers-middleware
namespace: traefik-system
spec:
headers:
browserXssFilter: true
contentTypeNosniff: true
frameDeny: true
sslRedirect: true
forceSTSHeader: true
stsIncludeSubdomains: true
stsPreload: true
stsSeconds: 315360000
contentSecurityPolicy: |
default-src 'none';
style-src 'none';
form-action 'none';
frame-ancestors 'none';
script-src 'strict-dynamic' 'nonce-rAnd0m123' 'unsafe-inline' http: https:;
object-src 'none';
base-uri 'none';
require-trusted-types-for 'script';
accessControlAllowMethods:
- "GET"
- "POST"
accessControlAllowOriginListRegex:
- "^(.+)\\.layertwo\\.dev$"
accessControlMaxAge: 100
addVaryHeader: true
referrerPolicy: "same-origin"
customFrameOptionsValue: SAMEORIGIN
customResponseHeaders:
server: "layertwo"
Server: "layertwo"
2 changes: 2 additions & 0 deletions clusters/home/apps/network/traefik/external/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ spec:
transport:
respondingTimeouts:
readTimeout: 0s
middlewares:
- traefik-system-secure-headers-middleware

tlsStore:
default:
Expand Down
2 changes: 2 additions & 0 deletions clusters/home/apps/network/traefik/internal/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ spec:
transport:
respondingTimeouts:
readTimeout: 0s
middlewares:
- traefik-system-secure-headers-middleware
ldap:
port: 389
protocol: TCP
Expand Down

0 comments on commit a981c9e

Please # to comment.