@softistx/alxia-secure-headers 0.0.0-stage → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +231 -2
- package/dist/clear-site-data.d.ts +49 -0
- package/dist/clear-site-data.d.ts.map +1 -0
- package/dist/csp.d.ts +36 -0
- package/dist/csp.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +292 -0
- package/dist/index.js.map +14 -0
- package/dist/nonce.d.ts +34 -0
- package/dist/nonce.d.ts.map +1 -0
- package/dist/page.d.ts +58 -0
- package/dist/page.d.ts.map +1 -0
- package/dist/secure-headers.d.ts +64 -0
- package/dist/secure-headers.d.ts.map +1 -0
- package/docs/README.md +11 -0
- package/docs/guide.md +749 -0
- package/docs/roadmap.md +77 -0
- package/docs/troubleshooting.md +959 -0
- package/package.json +51 -5
package/docs/roadmap.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
What `@softistx/alxia-secure-headers` gives an app, and what is coming. This page is
|
|
4
|
+
a direction, not a commitment: the version something shipped in is the only
|
|
5
|
+
number on it. Every release, with each change it made, is in
|
|
6
|
+
[`CHANGELOG.md`](https://github.com/softistx/alxia/blob/develop/packages/secure-headers/CHANGELOG.md).
|
|
7
|
+
|
|
8
|
+
## Now
|
|
9
|
+
|
|
10
|
+
- **Moving to the `@softistx` scope.** The package is now `@softistx/alxia-secure-headers` (it was `@alxia/secure-headers`). Same code and API; replace the dependency and the imports ([migration guide](https://github.com/softistx/alxia/blob/develop/packages/core/docs/guide/migrating-from-alxia-scope.md)). The old name is deprecated.
|
|
11
|
+
|
|
12
|
+
## Next
|
|
13
|
+
|
|
14
|
+
Nothing scheduled yet.
|
|
15
|
+
|
|
16
|
+
## Later
|
|
17
|
+
|
|
18
|
+
- **Reporting (`report-to` / `Reporting-Endpoints`).** Name an endpoint for
|
|
19
|
+
policy violations, written as options next to the policy.
|
|
20
|
+
- **One error-message prefix.** `secureHeaders():` for the older
|
|
21
|
+
`secureHeaders:` messages, so every error of the package starts the same
|
|
22
|
+
way as `csp():`, `pageHeaders():` and `clearSiteData():`.
|
|
23
|
+
|
|
24
|
+
## Not planned
|
|
25
|
+
|
|
26
|
+
- **A runtime dependency.** The package installs nothing beside itself: the
|
|
27
|
+
headers are written on `@softistx/alxia`'s public API, its peer, so adding it
|
|
28
|
+
to an app adds no transitive package to audit or update.
|
|
29
|
+
|
|
30
|
+
## Shipped
|
|
31
|
+
|
|
32
|
+
### 0.5.0
|
|
33
|
+
|
|
34
|
+
- **Headers for server-rendered pages.** `csp()` writes a policy from
|
|
35
|
+
directives and refuses one a browser would misread, a keyword without its
|
|
36
|
+
quotes included. `pageHeaders({ https })` is the strict preset for a page
|
|
37
|
+
with a nonce (`PAGE_DIRECTIVES`, frozen), with HSTS and
|
|
38
|
+
`upgrade-insecure-requests` only over HTTPS; it refuses a `script-src`
|
|
39
|
+
without the nonce and the removal of `default-src`, `base-uri` or
|
|
40
|
+
`object-src`. `cacheControl` keeps a page out of caches, and
|
|
41
|
+
`clearSiteData()` empties the browser's cache on a successful sign-out, not
|
|
42
|
+
on a request another site made.
|
|
43
|
+
|
|
44
|
+
### 0.4.0
|
|
45
|
+
|
|
46
|
+
- **Secure headers as a middleware.** `app.use(secureHeaders())`, declared
|
|
47
|
+
first, sets the headers on every response that comes back through it, a
|
|
48
|
+
404's, an error's and a 500's included; `NonceMiddleware` gives `nonce` to the
|
|
49
|
+
routes after it and `SecureHeaders` is the plain one.
|
|
50
|
+
`app.plugin(secureHeaders())`, the deprecated alias, was removed in 0.5.
|
|
51
|
+
|
|
52
|
+
### 0.2.0
|
|
53
|
+
|
|
54
|
+
- **A nonce per request.** `secureHeaders({ nonce: true })` makes a fresh,
|
|
55
|
+
random nonce for each request, adds it to the policy's `script-src`, or
|
|
56
|
+
wherever the policy names `NONCE`, and gives the same one to the routes
|
|
57
|
+
after it as `ctx.nonce`, typed. A page's inline scripts run without
|
|
58
|
+
`'unsafe-inline'`; `@alxia/react-router`'s `nonceOf` hands it to React
|
|
59
|
+
Router. Without the option, nothing changes.
|
|
60
|
+
|
|
61
|
+
### 0.1.0
|
|
62
|
+
|
|
63
|
+
- **Secure headers on every response.** `secureHeaders()` is a plugin for
|
|
64
|
+
`app.plugin` that sends `Content-Security-Policy`, `Strict-Transport-Security`,
|
|
65
|
+
`X-Content-Type-Options`, `X-Frame-Options`, `Referrer-Policy`,
|
|
66
|
+
`Cross-Origin-Opener-Policy`, `Cross-Origin-Resource-Policy`,
|
|
67
|
+
`Origin-Agent-Cluster`, `X-DNS-Prefetch-Control` and
|
|
68
|
+
`X-Permitted-Cross-Domain-Policies` with strict defaults for an API, on
|
|
69
|
+
every response — 404s, 405s and 500s included.
|
|
70
|
+
- **Each header adjustable.** Every option takes the header's value, or
|
|
71
|
+
`false` to leave it out, and an empty value is refused at startup;
|
|
72
|
+
`Cross-Origin-Embedder-Policy` and `Permissions-Policy` are sent only when
|
|
73
|
+
given.
|
|
74
|
+
- **A route's own header wins.** A header a route sets on its reply is kept,
|
|
75
|
+
so a page that needs its own policy sets it there.
|
|
76
|
+
- **No `X-Powered-By` or `Server`.** Both are removed from every response,
|
|
77
|
+
unless `hidePoweredBy: false`.
|