@@ -105,7 +105,7 @@ origins:
105105 variables : { ... }
106106 vaults : { ... }
107107 secrets : { ... }
108- session_config : { ... }
108+ session : { ... }
109109 events : [ ... ]
110110 cors : { ... }
111111 compression : { ... }
@@ -258,7 +258,7 @@ origins:
258258 variables: { ... } # Optional: template variables
259259 vaults: { ... } # Optional: secret vault backends
260260 secrets: { ... } # Optional: secret references
261- session_config : { ... } # Optional: session/cookie settings
261+ session : { ... } # Optional: session/cookie settings
262262 on_load: [ ... ] # Optional: startup callbacks
263263 on_request: [ ... ] # Optional: per-request callbacks
264264 on_response: [ ... ] # Optional: post-response callbacks
@@ -982,35 +982,34 @@ Inject security headers into every response. Use this to harden browser security
982982` ` ` yaml
983983policies:
984984 - type: security_headers
985- strict_transport_security:
986- enabled: true
987- max_age: 31536000
988- include_subdomains: true
989- preload: true
985+ headers:
986+ - name: Strict-Transport-Security
987+ value: "max-age=31536000; includeSubDomains; preload"
988+ - name: X-Frame-Options
989+ value: DENY
990+ - name: X-Content-Type-Options
991+ value: nosniff
992+ - name: Referrer-Policy
993+ value: strict-origin-when-cross-origin
994+ - name: Permissions-Policy
995+ value: "camera=(), microphone=(), geolocation=()"
996+ # Optional: detailed CSP block for nonce / dynamic routes only.
990997 content_security_policy:
991998 policy: "default-src 'self'; script-src 'self' https://cdn.example.com"
992- x_frame_options:
993- value: DENY
994- x_content_type_options:
995- enabled: true
996- referrer_policy:
997- value: strict-origin-when-cross-origin
998- permissions_policy:
999- policy: "camera=(), microphone=(), geolocation=()"
999+ enable_nonce: false # true to inject per-request nonce in script-src/style-src
1000+ report_only: false
1001+ report_uri: ""
1002+ # dynamic_routes:
1003+ # "/admin":
1004+ # policy: "default-src 'self' admin.example.com"
10001005` ` `
10011006
1007+ Use `headers` as a simple list of `{name, value}` pairs for any response header (HSTS, Cross-Origin-*, COEP/COOP/CORP, Referrer-Policy, Permissions-Policy, etc.). The optional `content_security_policy` block is for advanced CSP behavior only (per-request nonce injection, report-only mode, per-route overrides). For a plain CSP without nonce or dynamic routes, just add a `Content-Security-Policy` entry to `headers` directly.
1008+
10021009| Field | Type | Default | Description |
10031010|-------|------|---------|-------------|
1004- | `strict_transport_security` | object | | HSTS settings (max_age, include_subdomains, preload) |
1005- | `content_security_policy` | object | | CSP policy string |
1006- | `x_frame_options` | object | | Frame embedding control (DENY, SAMEORIGIN) |
1007- | `x_content_type_options` | object | | Prevent MIME type sniffing |
1008- | `x_xss_protection` | object | | XSS filter (legacy browsers) |
1009- | `referrer_policy` | object | | Controls Referer header |
1010- | `permissions_policy` | object | | Feature permissions |
1011- | `cross_origin_embedder_policy` | object | | COEP header |
1012- | `cross_origin_opener_policy` | object | | COOP header |
1013- | `cross_origin_resource_policy` | object | | CORP header |
1011+ | `headers` | []object | | List of `{name, value}` response headers to inject |
1012+ | `content_security_policy` | object | | Advanced CSP block (nonce injection, report-only, per-route policies) |
10141013
10151014# ## csrf
10161015
@@ -1577,10 +1576,10 @@ Configure session behavior for an origin. Sessions are stored in encrypted cooki
15771576` ` ` yaml
15781577origins:
15791578 "app.example.com":
1580- session_config :
1579+ session :
15811580 cookie_name: sb_session
1582- cookie_max_age : 3600
1583- cookie_same_site : Strict
1581+ max_age : 3600
1582+ same_site : Strict
15841583 disable_http_only: false
15851584 allow_non_ssl: false
15861585 enable_cookie_jar: true
@@ -1594,8 +1593,8 @@ origins:
15941593|-------|------|---------|-------------|
15951594| `disabled` | bool | false | Disable sessions entirely |
15961595| `cookie_name` | string | sb_session | Session cookie name |
1597- | `cookie_max_age ` | int | 3600 | Cookie lifetime in seconds |
1598- | `cookie_same_site ` | string | Lax | SameSite attribute (Strict, Lax, None) |
1596+ | `max_age ` | int | 3600 | Cookie lifetime in seconds |
1597+ | `same_site ` | string | Lax | SameSite attribute (Strict, Lax, None) |
15991598| `disable_http_only` | bool | false | If true, cookie is accessible to JavaScript |
16001599| `allow_non_ssl` | bool | false | Allow sessions over HTTP (not just HTTPS) |
16011600| `enable_cookie_jar` | bool | false | Store backend cookies in the session |
@@ -1905,7 +1904,7 @@ origins:
19051904 variables: { ... }
19061905 vaults: { ... }
19071906 secrets: { ... }
1908- session_config : { ... }
1907+ session : { ... }
19091908 events: [ ... ]
19101909 cors: { ... }
19111910 compression: { ... }
0 commit comments