@roboteby/parry 2.0.0 → 2.0.1
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/CHANGELOG.md +6 -4
- package/README.md +67 -55
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,8 @@ Versioning for public APIs and documented runtime behavior.
|
|
|
19
19
|
|
|
20
20
|
### Changed
|
|
21
21
|
|
|
22
|
+
- Raised the minimum supported Node.js version from `>=18` to `>=22`. The package
|
|
23
|
+
remains CommonJS and keeps Express `^5.2.1` as its peer dependency.
|
|
22
24
|
- Made `createParry` and `ParryOptions` the recommended API names while retaining
|
|
23
25
|
every existing public export and the deprecated `Parry_DDoS`/
|
|
24
26
|
`Parry_DDoSOptions` aliases.
|
|
@@ -27,21 +29,21 @@ Versioning for public APIs and documented runtime behavior.
|
|
|
27
29
|
removed, and aggregate severity uses the most severe finding.
|
|
28
30
|
- Resolved trusted proxy chains from right to left and changed generated request
|
|
29
31
|
IDs to `req_${crypto.randomUUID()}`.
|
|
30
|
-
- Migrated tests to `node:test`/`node:assert`, ESLint
|
|
31
|
-
Prettier checks,
|
|
32
|
+
- Migrated tests to `node:test`/`node:assert`, ESLint flat configuration, full
|
|
33
|
+
Prettier checks, GitHub Actions npm publishing with provenance, and an optional
|
|
32
34
|
Terraform example under `infra/examples/aws`.
|
|
33
35
|
- Updated repository metadata and links to `RobotEby/parry`.
|
|
34
36
|
|
|
35
37
|
### Security
|
|
36
38
|
|
|
37
|
-
- **
|
|
39
|
+
- **Breaking change:** `createParryAdminRouter` no longer permits
|
|
38
40
|
anonymous access by default. It fails during construction unless real auth is
|
|
39
41
|
configured or insecure access is explicitly selected outside production.
|
|
40
42
|
- In production, `allowInsecureAdminApi`, `auth.mode: "none"`, and legacy
|
|
41
43
|
`requireAuth: false` are always rejected. Empty tokens and invalid IP/CIDR
|
|
42
44
|
boundaries are rejected, and `verifyJwt: true` continues to fail explicitly.
|
|
43
45
|
- Removed stale monitor-only fixtures for Command Injection and SSRF because
|
|
44
|
-
Parry
|
|
46
|
+
Parry does not implement those detectors.
|
|
45
47
|
|
|
46
48
|
## [1.1.1] - 2026-07-02
|
|
47
49
|
|
package/README.md
CHANGED
|
@@ -4,23 +4,21 @@
|
|
|
4
4
|
[](./LICENSE)
|
|
5
5
|
[](https://www.npmjs.com/package/@roboteby/parry)
|
|
6
6
|
|
|
7
|
-
Application-layer security middleware for Express
|
|
7
|
+
Application-layer security middleware for Express that combines abuse detection,
|
|
8
|
+
request guards, rate limiting, brute-force protection and security observability.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
route policies, brute-force protection, sanitized Threat Events, and an optional
|
|
12
|
-
read-only Admin API. It is CommonJS and has no mandatory Redis dependency.
|
|
13
|
-
|
|
14
|
-
The stable npm release is `1.1.1` on `latest`. The earlier `1.1.0-rc.1` remains
|
|
15
|
-
available on the `rc` dist-tag; it is not the recommended installation.
|
|
10
|
+
The current stable release is `@roboteby/parry@2.0.0` on the npm `latest`
|
|
11
|
+
dist-tag.
|
|
16
12
|
|
|
17
13
|
## Install
|
|
18
14
|
|
|
19
15
|
```bash
|
|
20
|
-
npm install @roboteby/parry
|
|
16
|
+
npm install @roboteby/parry express@^5.2.1
|
|
21
17
|
```
|
|
22
18
|
|
|
23
|
-
Express `^5.2.1
|
|
19
|
+
Parry 2 requires Node.js `>=22` and Express `^5.2.1`.
|
|
20
|
+
|
|
21
|
+
## Minimal example
|
|
24
22
|
|
|
25
23
|
```js
|
|
26
24
|
const express = require('express');
|
|
@@ -36,49 +34,59 @@ app.get('/health', (_req, res) => res.json({ ok: true }));
|
|
|
36
34
|
app.listen(3000);
|
|
37
35
|
```
|
|
38
36
|
|
|
39
|
-
Body parsers must run before Parry
|
|
40
|
-
Parry before the routes it protects.
|
|
37
|
+
Body parsers must run before Parry when request bodies should be inspected.
|
|
38
|
+
Mount Parry before the routes it protects.
|
|
41
39
|
|
|
42
|
-
##
|
|
40
|
+
## Main capabilities
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
- Request Shape limits for depth, key count, array length and string length.
|
|
43
|
+
- Heuristic SQL injection and XSS detection, plus NoSQL operator guards.
|
|
44
|
+
- HTTP parameter pollution, prototype pollution and path traversal guards.
|
|
45
|
+
- Global and route-specific rate limiting.
|
|
46
|
+
- Brute-force counters and temporary blocks for authentication routes.
|
|
47
|
+
- Sanitized Threat Events, process-local metrics and an optional read-only Admin
|
|
48
|
+
API.
|
|
49
|
+
- In-memory state by default, with an optional `RedisStore` for shared protection
|
|
50
|
+
state.
|
|
51
|
+
|
|
52
|
+
## Security boundaries
|
|
48
53
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
Parry is a defense-in-depth control for the Express application layer. It is not
|
|
55
|
+
a WAF and does not replace a CDN, reverse proxy, load balancer or volumetric
|
|
56
|
+
L3/L4 DDoS protection. It also does not replace authentication, authorization,
|
|
57
|
+
schema validation, parameterized queries, context-aware escaping/output
|
|
58
|
+
encoding or CSP.
|
|
53
59
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
process unless the application exports them through `onEvent` or another
|
|
58
|
-
observability integration.
|
|
60
|
+
SQLi and XSS detection is heuristic, so false positives and false negatives are
|
|
61
|
+
possible. Request Shape runs before heavier scans to bound their cost, but an
|
|
62
|
+
allowed request is not proof that its input is safe for downstream use.
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
Trusted proxy handling depends on narrow, correct `trustedProxies`
|
|
65
|
+
configuration. See the [security model](./docs/security-model.md) before enabling
|
|
66
|
+
forwarded-header trust.
|
|
61
67
|
|
|
62
68
|
## Public API
|
|
63
69
|
|
|
64
|
-
The
|
|
70
|
+
The recommended root exports are:
|
|
65
71
|
|
|
66
|
-
- `createParry(options)` —
|
|
67
|
-
- `createParryAdminRouter(parry, options)` —
|
|
68
|
-
- `MemoryStore` —
|
|
69
|
-
- `RedisStore` —
|
|
72
|
+
- `createParry(options)` — creates the middleware and its observability context.
|
|
73
|
+
- `createParryAdminRouter(parry, options)` — creates the optional Admin router.
|
|
74
|
+
- `MemoryStore` — keeps protection state in one process.
|
|
75
|
+
- `RedisStore` — uses an application-owned Redis client for shared protection
|
|
76
|
+
state.
|
|
70
77
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
`Parry_DDoSOptions`
|
|
78
|
+
Existing exports remain available. `Parry_DDoS(options)` is a deprecated
|
|
79
|
+
compatibility wrapper around `createParry(options).middleware()`, and
|
|
80
|
+
`Parry_DDoSOptions` is a deprecated TypeScript alias for `ParryOptions`.
|
|
74
81
|
|
|
75
|
-
Advanced
|
|
76
|
-
`/brute-force`, `/events`, `/observability
|
|
82
|
+
Advanced typed exports are available from `/core`, `/detectors`, `/stores`,
|
|
83
|
+
`/policies`, `/brute-force`, `/events`, `/observability` and `/admin`.
|
|
77
84
|
|
|
78
|
-
## Admin API
|
|
85
|
+
## Admin API
|
|
79
86
|
|
|
80
|
-
The Admin
|
|
81
|
-
is
|
|
87
|
+
The Admin API exposes health, process metrics, recent sanitized events, active
|
|
88
|
+
bans and normalized policies. It is never mounted automatically and fails during
|
|
89
|
+
construction unless authentication is configured:
|
|
82
90
|
|
|
83
91
|
```js
|
|
84
92
|
const { createParryAdminRouter } = require('@roboteby/parry');
|
|
@@ -94,19 +102,18 @@ app.use(
|
|
|
94
102
|
);
|
|
95
103
|
```
|
|
96
104
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
boundary but do not pretend that decoding a JWT is cryptographic verification;
|
|
102
|
-
`verifyJwt: true` fails explicitly in this 1.x implementation.
|
|
105
|
+
Anonymous Admin access is an explicit local-development opt-in and is rejected
|
|
106
|
+
in production. External identity modes depend on a configured trusted boundary;
|
|
107
|
+
Parry does not perform cryptographic JWT/JWKS verification, and `verifyJwt: true`
|
|
108
|
+
fails explicitly.
|
|
103
109
|
|
|
104
|
-
|
|
110
|
+
See [Admin API](./docs/admin-api.md) for authentication modes and deployment
|
|
111
|
+
guidance.
|
|
105
112
|
|
|
106
113
|
## Redis
|
|
107
114
|
|
|
108
|
-
|
|
109
|
-
|
|
115
|
+
The application creates and connects the Redis client. Parry does not install or
|
|
116
|
+
own a Redis package implicitly.
|
|
110
117
|
|
|
111
118
|
```js
|
|
112
119
|
const { createClient } = require('redis');
|
|
@@ -121,26 +128,31 @@ const parry = createParry({
|
|
|
121
128
|
});
|
|
122
129
|
```
|
|
123
130
|
|
|
131
|
+
`RedisStore` shares rate-limit state, brute-force state, counters and related
|
|
132
|
+
bans/blocks across instances. Threat Events, the default event buffer and
|
|
133
|
+
metrics remain local to each process unless the application exports them.
|
|
134
|
+
|
|
124
135
|
## Runtime support
|
|
125
136
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
137
|
+
- Node.js `>=22`
|
|
138
|
+
- Express `^5.2.1`
|
|
139
|
+
- CommonJS
|
|
140
|
+
|
|
141
|
+
CI covers Node.js 22 and 24. Parry 2 does not imply or announce an ESM migration.
|
|
130
142
|
|
|
131
143
|
## Documentation
|
|
132
144
|
|
|
133
145
|
- [Configuration](./docs/configuration.md)
|
|
134
146
|
- [Security model](./docs/security-model.md)
|
|
135
147
|
- [Admin API](./docs/admin-api.md)
|
|
136
|
-
- [Testing](./docs/testing.md)
|
|
137
148
|
- [Deployment](./docs/deployment.md)
|
|
149
|
+
- [Testing](./docs/testing.md)
|
|
138
150
|
- [Architecture](./docs/architecture.md)
|
|
139
151
|
- [Releasing](./docs/releasing.md)
|
|
140
152
|
- [OpenAPI contract](./docs/openapi/parry-admin-api.yaml)
|
|
141
153
|
- [Generated payload regression report](./docs/payload-regression-report.md)
|
|
142
154
|
|
|
143
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development workflow and
|
|
155
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for the development workflow and
|
|
144
156
|
[SECURITY.md](./SECURITY.md) for vulnerability reporting.
|
|
145
157
|
|
|
146
158
|
## License
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roboteby/parry",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "Application-layer security middleware for Express
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Application-layer security middleware for Express that combines abuse detection, request guards, rate limiting, brute-force protection and security observability.",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
7
7
|
"scripts": {
|