@roboteby/parry 1.1.0-rc.1 → 2.0.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/CHANGELOG.md +54 -9
- package/README.md +89 -225
- package/config/defaults.js +4 -1
- package/config/validate.js +255 -0
- package/constants/patterns.js +3 -4
- package/package.json +55 -24
- package/src/admin/auth/admin-auth.js +81 -17
- package/src/admin/auth/strategies/none.js +6 -2
- package/src/core/engine.js +75 -15
- package/src/core/index.js +2 -2
- package/src/core/scoring.js +5 -1
- package/src/detectors/nosql.js +33 -13
- package/src/detectors/path-traversal.js +3 -1
- package/src/express/ip-resolver.js +16 -2
- package/src/express/middleware.js +13 -4
- package/src/express/request-targets.js +26 -16
- package/src/index.js +1 -1
- package/src/utils/decode.js +3 -1
- package/src/utils/normalize.js +3 -1
- package/types/admin.d.ts +26 -0
- package/types/brute-force.d.ts +44 -0
- package/types/core.d.ts +1 -0
- package/types/detectors.d.ts +9 -0
- package/types/events.d.ts +16 -0
- package/types/index.d.ts +68 -17
- package/types/observability.d.ts +12 -0
- package/types/policies.d.ts +21 -0
- package/types/stores.d.ts +10 -0
- package/src/core/logger.js +0 -3
- package/src/core/rateLimiter.js +0 -3
- package/src/middleware/index.js +0 -7
- package/src/middleware/parry_ddos.js +0 -3
- package/src/stores/README.md +0 -51
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,64 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
All notable changes to this project
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
runtime behavior. The format is based on [Keep a Changelog](https://keepachangelog.com/),
|
|
7
|
-
without adding a changelog generation dependency.
|
|
3
|
+
All notable changes to this project are documented here. The format is based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/) and the project follows Semantic
|
|
5
|
+
Versioning for public APIs and documented runtime behavior.
|
|
8
6
|
|
|
9
7
|
## [Unreleased]
|
|
10
8
|
|
|
9
|
+
## [2.0.0] - 2026-09-01
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added exact-path NoSQL operator allowlists through
|
|
14
|
+
`nosql.allowedOperators`, configurable scalar header scanning, internal option
|
|
15
|
+
validation, typed advanced subpaths, TypeScript declaration tests, and 75
|
|
16
|
+
benign false-positive controls.
|
|
17
|
+
- Added security, contribution, issue, pull-request, testing, deployment,
|
|
18
|
+
architecture, and release guidance.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Made `createParry` and `ParryOptions` the recommended API names while retaining
|
|
23
|
+
every existing public export and the deprecated `Parry_DDoS`/
|
|
24
|
+
`Parry_DDoSOptions` aliases.
|
|
25
|
+
- Reordered scanning so Request Shape runs first, structured guards inspect each
|
|
26
|
+
surface once, scalar leaves are serialized once, duplicate findings are
|
|
27
|
+
removed, and aggregate severity uses the most severe finding.
|
|
28
|
+
- Resolved trusted proxy chains from right to left and changed generated request
|
|
29
|
+
IDs to `req_${crypto.randomUUID()}`.
|
|
30
|
+
- Migrated tests to `node:test`/`node:assert`, ESLint 9 flat configuration, full
|
|
31
|
+
Prettier checks, Node 18/20/22/24 CI, OIDC-only npm publishing, and an optional
|
|
32
|
+
Terraform example under `infra/examples/aws`.
|
|
33
|
+
- Updated repository metadata and links to `RobotEby/parry`.
|
|
34
|
+
|
|
35
|
+
### Security
|
|
36
|
+
|
|
37
|
+
- **Intentional breaking behavior:** `createParryAdminRouter` no longer permits
|
|
38
|
+
anonymous access by default. It fails during construction unless real auth is
|
|
39
|
+
configured or insecure access is explicitly selected outside production.
|
|
40
|
+
- In production, `allowInsecureAdminApi`, `auth.mode: "none"`, and legacy
|
|
41
|
+
`requireAuth: false` are always rejected. Empty tokens and invalid IP/CIDR
|
|
42
|
+
boundaries are rejected, and `verifyJwt: true` continues to fail explicitly.
|
|
43
|
+
- Removed stale monitor-only fixtures for Command Injection and SSRF because
|
|
44
|
+
Parry 1.x does not implement those detectors.
|
|
45
|
+
|
|
46
|
+
## [1.1.1] - 2026-07-02
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- Published `@roboteby/parry@1.1.1` to the stable `latest` npm dist-tag.
|
|
51
|
+
|
|
52
|
+
## [1.1.0-rc.1] - 2026-07-02
|
|
53
|
+
|
|
11
54
|
### Added
|
|
12
55
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
56
|
+
- Published the first release candidate under the `rc` npm dist-tag.
|
|
57
|
+
- Added route policies, distributed rate limiting, brute-force protection,
|
|
58
|
+
Threat Events, metrics, the read-only Admin API, Docker demonstration, and AWS
|
|
59
|
+
reference infrastructure.
|
|
16
60
|
|
|
17
61
|
### Security
|
|
18
62
|
|
|
19
|
-
-
|
|
63
|
+
- Clarified that Parry is application-layer Express middleware and does not
|
|
64
|
+
replace CDN/WAF, load-balancer, or volumetric DDoS controls.
|
package/README.md
CHANGED
|
@@ -1,284 +1,148 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Parry
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@roboteby/parry)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/@roboteby/parry)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Application-layer security middleware for Express 5.
|
|
6
8
|
|
|
7
|
-
Parry
|
|
9
|
+
Parry combines request-shape limits, heuristic SQL injection/XSS/NoSQL checks,
|
|
10
|
+
HTTP parameter pollution and prototype/path traversal guards with rate limiting,
|
|
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.
|
|
8
13
|
|
|
9
|
-
|
|
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
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Why Parry
|
|
14
|
-
|
|
15
|
-
Parry centralizes application-layer security policy in one Express middleware. That gives backend teams a consistent place to tune detector behavior, route-based limits, brute-force protection, event logging, and distributed rate limiting.
|
|
16
|
-
|
|
17
|
-
It is designed for development and production-like deployments:
|
|
18
|
-
|
|
19
|
-
- use `MemoryStore` for local development and single-process services;
|
|
20
|
-
- use `RedisStore` for multiple instances, containers, ECS, Kubernetes, PM2 cluster, or load-balanced services;
|
|
21
|
-
- expose the Admin API only behind authentication, private networking, VPN, or a trusted reverse proxy.
|
|
22
|
-
|
|
23
|
-
## Features
|
|
24
|
-
|
|
25
|
-
- SQL injection detection
|
|
26
|
-
- XSS detection
|
|
27
|
-
- NoSQL injection detection
|
|
28
|
-
- HTTP parameter pollution checks
|
|
29
|
-
- Prototype pollution checks
|
|
30
|
-
- Path traversal checks
|
|
31
|
-
- Request shape guard
|
|
32
|
-
- Global and route-based rate limiting
|
|
33
|
-
- BruteForceGuard for authentication routes
|
|
34
|
-
- `MemoryStore` and optional `RedisStore`
|
|
35
|
-
- Structured Threat Events
|
|
36
|
-
- Metrics and observability helpers
|
|
37
|
-
- Optional read-only Admin API
|
|
38
|
-
- Route-based policies and presets
|
|
39
|
-
- Docker demo API
|
|
40
|
-
- AWS reference infrastructure
|
|
41
|
-
|
|
42
|
-
## Installation
|
|
17
|
+
## Install
|
|
43
18
|
|
|
44
19
|
```bash
|
|
45
20
|
npm install @roboteby/parry
|
|
46
21
|
```
|
|
47
22
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## Quick Start
|
|
23
|
+
Express `^5.2.1` is a peer dependency.
|
|
51
24
|
|
|
52
25
|
```js
|
|
53
26
|
const express = require('express');
|
|
54
27
|
const { createParry } = require('@roboteby/parry');
|
|
55
28
|
|
|
56
29
|
const app = express();
|
|
30
|
+
app.use(express.json({ limit: '64kb' }));
|
|
57
31
|
|
|
58
|
-
const parry = createParry({
|
|
59
|
-
preset: 'recommended',
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
app.use(express.json());
|
|
32
|
+
const parry = createParry({ preset: 'recommended' });
|
|
63
33
|
app.use(parry.middleware());
|
|
64
34
|
|
|
65
|
-
app.get('/health', (_req, res) => {
|
|
66
|
-
res.json({ ok: true });
|
|
67
|
-
});
|
|
68
|
-
|
|
35
|
+
app.get('/health', (_req, res) => res.json({ ok: true }));
|
|
69
36
|
app.listen(3000);
|
|
70
37
|
```
|
|
71
38
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
The legacy `Parry_DDoS(options)` export remains available for existing CommonJS integrations:
|
|
75
|
-
|
|
76
|
-
```js
|
|
77
|
-
const { Parry_DDoS } = require('@roboteby/parry');
|
|
78
|
-
|
|
79
|
-
app.use(express.json());
|
|
80
|
-
app.use(Parry_DDoS({ preset: 'recommended' }));
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Presets
|
|
84
|
-
|
|
85
|
-
Parry supports conservative presets for common application-layer protection:
|
|
86
|
-
|
|
87
|
-
- `off`: no route-policy preset is added.
|
|
88
|
-
- `recommended`: enables practical defaults for common auth routes and low-noise application-layer checks.
|
|
89
|
-
- `strict`: uses more restrictive brute-force and route rate-limit defaults for sensitive environments.
|
|
90
|
-
|
|
91
|
-
Every option can still be configured explicitly. Prefer starting with `recommended`, reviewing logs and events, then tightening route policies where needed.
|
|
92
|
-
|
|
93
|
-
## Stores
|
|
94
|
-
|
|
95
|
-
`MemoryStore` is the default store. It is suitable for tests, demos, local development, and single-process deployments.
|
|
96
|
-
|
|
97
|
-
For distributed deployments, use `RedisStore` with a Redis client created by your application:
|
|
98
|
-
|
|
99
|
-
```js
|
|
100
|
-
const { createClient } = require('redis');
|
|
101
|
-
const { createParry, RedisStore } = require('@roboteby/parry');
|
|
102
|
-
|
|
103
|
-
const redis = createClient({ url: process.env.REDIS_URL });
|
|
104
|
-
await redis.connect();
|
|
39
|
+
Body parsers must run before Parry if request bodies should be inspected. Mount
|
|
40
|
+
Parry before the routes it protects.
|
|
105
41
|
|
|
106
|
-
|
|
107
|
-
store: new RedisStore({ client: redis, prefix: 'parry' }),
|
|
108
|
-
rateLimit: {
|
|
109
|
-
enabled: true,
|
|
110
|
-
max: 100,
|
|
111
|
-
windowMs: 60_000,
|
|
112
|
-
headers: true,
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
```
|
|
42
|
+
## Security boundaries
|
|
116
43
|
|
|
117
|
-
|
|
44
|
+
Parry is one application-layer control. It does not replace validation and
|
|
45
|
+
parameterized queries in the application, output encoding and CSP in the browser,
|
|
46
|
+
authentication/authorization, a reverse proxy, CDN/WAF, load balancer, or
|
|
47
|
+
volumetric L3/L4 DDoS protection.
|
|
118
48
|
|
|
119
|
-
|
|
49
|
+
SQLi and XSS detection is heuristic. The patterns are intentionally bounded and
|
|
50
|
+
the Request Shape guard runs before heavier scans, but applications still need
|
|
51
|
+
tests for their own traffic and false-positive profile. A clean Parry decision is
|
|
52
|
+
not proof that input is safe for every downstream interpreter.
|
|
120
53
|
|
|
121
|
-
|
|
54
|
+
When `MemoryStore` is used, counters and bans exist only inside one Node.js
|
|
55
|
+
process. `RedisStore` shares rate-limit and brute-force state across instances.
|
|
56
|
+
Threat Events, the in-memory event buffer, and metrics remain local to each
|
|
57
|
+
process unless the application exports them through `onEvent` or another
|
|
58
|
+
observability integration.
|
|
122
59
|
|
|
123
|
-
|
|
124
|
-
const parry = createParry({
|
|
125
|
-
policies: [
|
|
126
|
-
{
|
|
127
|
-
name: 'auth-login',
|
|
128
|
-
match: { method: 'POST', path: '/login' },
|
|
129
|
-
rateLimit: {
|
|
130
|
-
enabled: true,
|
|
131
|
-
max: 20,
|
|
132
|
-
windowMs: 60_000,
|
|
133
|
-
key: 'ip',
|
|
134
|
-
},
|
|
135
|
-
bruteForce: {
|
|
136
|
-
enabled: true,
|
|
137
|
-
maxAttempts: 5,
|
|
138
|
-
windowMs: 15 * 60_000,
|
|
139
|
-
blockDurationMs: 10 * 60_000,
|
|
140
|
-
keys: ['ip', 'body.email', 'ip+body.email'],
|
|
141
|
-
failureStatusCodes: [400, 401, 403],
|
|
142
|
-
resetOnSuccess: true,
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
],
|
|
146
|
-
});
|
|
147
|
-
```
|
|
60
|
+
See [the security model](./docs/security-model.md) and [configuration](./docs/configuration.md).
|
|
148
61
|
|
|
149
|
-
|
|
62
|
+
## Public API
|
|
150
63
|
|
|
151
|
-
|
|
152
|
-
app.post('/login', async (req, res) => {
|
|
153
|
-
const user = await authService.validate(req.body.email, req.body.password);
|
|
64
|
+
The four recommended stable exports are:
|
|
154
65
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
66
|
+
- `createParry(options)` — create a middleware instance and observability context;
|
|
67
|
+
- `createParryAdminRouter(parry, options)` — create the optional read-only Admin router;
|
|
68
|
+
- `MemoryStore` — single-process state store;
|
|
69
|
+
- `RedisStore` — adapter for an application-owned Redis client.
|
|
159
70
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
```
|
|
71
|
+
All existing exports remain available. `Parry_DDoS(options)` is deprecated but
|
|
72
|
+
kept as a compatibility wrapper around `createParry(options).middleware()`.
|
|
73
|
+
`Parry_DDoSOptions` remains a deprecated TypeScript alias for `ParryOptions`.
|
|
164
74
|
|
|
165
|
-
|
|
75
|
+
Advanced APIs have typed subpaths: `/core`, `/detectors`, `/stores`, `/policies`,
|
|
76
|
+
`/brute-force`, `/events`, `/observability`, and `/admin`.
|
|
166
77
|
|
|
167
|
-
|
|
78
|
+
## Admin API is fail-closed
|
|
168
79
|
|
|
169
|
-
The
|
|
80
|
+
The Admin router now throws during construction when no authentication strategy
|
|
81
|
+
is configured:
|
|
170
82
|
|
|
171
83
|
```js
|
|
172
|
-
const {
|
|
84
|
+
const { createParryAdminRouter } = require('@roboteby/parry');
|
|
173
85
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
86
|
+
app.use(
|
|
87
|
+
'/_parry',
|
|
88
|
+
createParryAdminRouter(parry, {
|
|
177
89
|
auth: {
|
|
178
90
|
mode: 'token',
|
|
179
91
|
token: process.env.PARRY_ADMIN_TOKEN,
|
|
180
92
|
},
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
app.use(parry.middleware());
|
|
185
|
-
app.use('/_parry', createParryAdminRouter(parry));
|
|
93
|
+
})
|
|
94
|
+
);
|
|
186
95
|
```
|
|
187
96
|
|
|
188
|
-
|
|
97
|
+
`allowInsecureAdminApi: true`, `auth.mode: 'none'`, and the legacy
|
|
98
|
+
`requireAuth: false` alias are explicit local-development opt-ins. They warn and
|
|
99
|
+
are rejected whenever `NODE_ENV=production`, even if an override is present.
|
|
100
|
+
An empty token is invalid. External Cloudflare/ALB modes validate a trusted
|
|
101
|
+
boundary but do not pretend that decoding a JWT is cryptographic verification;
|
|
102
|
+
`verifyJwt: true` fails explicitly in this 1.x implementation.
|
|
189
103
|
|
|
190
|
-
|
|
191
|
-
- `GET /_parry/metrics`
|
|
192
|
-
- `GET /_parry/events`
|
|
193
|
-
- `GET /_parry/events/:id`
|
|
194
|
-
- `GET /_parry/bans`
|
|
195
|
-
- `GET /_parry/policies`
|
|
104
|
+
Full configuration and deployment patterns are in [Admin API](./docs/admin-api.md).
|
|
196
105
|
|
|
197
|
-
|
|
106
|
+
## Redis
|
|
198
107
|
|
|
199
|
-
|
|
108
|
+
Create and connect the Redis client in the application; Parry never installs or
|
|
109
|
+
owns a Redis package implicitly.
|
|
200
110
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
## Docker Demo
|
|
206
|
-
|
|
207
|
-
The repository includes a demo Express API with Redis:
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
docker compose up --build
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
Useful local checks:
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
curl http://localhost:3000/health
|
|
111
|
+
```js
|
|
112
|
+
const { createClient } = require('redis');
|
|
113
|
+
const { createParry, RedisStore } = require('@roboteby/parry');
|
|
217
114
|
|
|
218
|
-
|
|
219
|
-
|
|
115
|
+
const client = createClient({ url: process.env.REDIS_URL });
|
|
116
|
+
await client.connect();
|
|
220
117
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
118
|
+
const parry = createParry({
|
|
119
|
+
store: new RedisStore({ client, prefix: 'parry' }),
|
|
120
|
+
storeFailureMode: 'fail-closed',
|
|
121
|
+
});
|
|
224
122
|
```
|
|
225
123
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
## Security Model
|
|
229
|
-
|
|
230
|
-
Parry operates inside the Express application. It helps identify and block suspicious application-layer requests, but it does not replace edge and infrastructure controls.
|
|
231
|
-
|
|
232
|
-
Production deployments should account for:
|
|
233
|
-
|
|
234
|
-
- CloudFront, AWS WAF, Shield, CDN, ALB, or equivalent edge protection for volumetric DDoS and network-layer abuse.
|
|
235
|
-
- RedisStore or another shared store for distributed rate limits and brute-force counters.
|
|
236
|
-
- Admin API authentication and network restrictions.
|
|
237
|
-
- Trusted proxy configuration before accepting `x-forwarded-for`, Cloudflare Access, ALB/Cognito, or reverse-proxy identity headers.
|
|
238
|
-
- Generic authentication responses that do not reveal whether a username or email exists.
|
|
124
|
+
## Runtime support
|
|
239
125
|
|
|
240
|
-
|
|
126
|
+
The 1.x package keeps `engines.node >=18` and CI covers Node 18, 20, 22, and 24.
|
|
127
|
+
Node 18 and 20 are legacy/EOL compatibility targets. Use Node 22 or 24 for new
|
|
128
|
+
production deployments. Raising the minimum to Node 22 is reserved for v2. See
|
|
129
|
+
the [official Node.js release schedule](https://nodejs.org/en/about/previous-releases).
|
|
241
130
|
|
|
242
131
|
## Documentation
|
|
243
132
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
- [Admin API](
|
|
247
|
-
- [
|
|
248
|
-
- [
|
|
249
|
-
- [
|
|
250
|
-
- [
|
|
251
|
-
- [
|
|
252
|
-
- [
|
|
253
|
-
- [Payload regression testing](https://github.com/RobotEby/parry-express-security-middleware/blob/main/docs/testing-payloads.md)
|
|
254
|
-
- [Architecture](https://github.com/RobotEby/parry-express-security-middleware/blob/main/docs/architecture.md)
|
|
255
|
-
|
|
256
|
-
The npm package keeps `docs/`, infrastructure, Docker demo files, and tests out of the published runtime package.
|
|
257
|
-
|
|
258
|
-
## Development
|
|
259
|
-
|
|
260
|
-
```bash
|
|
261
|
-
npm ci
|
|
262
|
-
npm test
|
|
263
|
-
npm run test:fixtures
|
|
264
|
-
npm run test:payload-regression
|
|
265
|
-
npm run package:check
|
|
266
|
-
npm pack --dry-run
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
`npm test` uses local mocks and fake stores. It does not require Redis, AWS, Cloudflare, or external services.
|
|
270
|
-
|
|
271
|
-
## Roadmap
|
|
272
|
-
|
|
273
|
-
Planned areas for future work:
|
|
133
|
+
- [Configuration](./docs/configuration.md)
|
|
134
|
+
- [Security model](./docs/security-model.md)
|
|
135
|
+
- [Admin API](./docs/admin-api.md)
|
|
136
|
+
- [Testing](./docs/testing.md)
|
|
137
|
+
- [Deployment](./docs/deployment.md)
|
|
138
|
+
- [Architecture](./docs/architecture.md)
|
|
139
|
+
- [Releasing](./docs/releasing.md)
|
|
140
|
+
- [OpenAPI contract](./docs/openapi/parry-admin-api.yaml)
|
|
141
|
+
- [Generated payload regression report](./docs/payload-regression-report.md)
|
|
274
142
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
- Express 4 compatibility matrix
|
|
278
|
-
- Optional hashing/redaction for store keys
|
|
279
|
-
- Additional detector tuning with benign counterexamples
|
|
280
|
-
- Admin API hardening and deployment guides
|
|
143
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development workflow and
|
|
144
|
+
[SECURITY.md](./SECURITY.md) for vulnerability reporting.
|
|
281
145
|
|
|
282
146
|
## License
|
|
283
147
|
|
|
284
|
-
MIT
|
|
148
|
+
[MIT](./LICENSE)
|
package/config/defaults.js
CHANGED
|
@@ -50,6 +50,9 @@ const DEFAULTS = {
|
|
|
50
50
|
},
|
|
51
51
|
trustProxyHeaders: false,
|
|
52
52
|
trustedProxies: [],
|
|
53
|
+
headers: {
|
|
54
|
+
scan: ['user-agent', 'referer', 'x-forwarded-for', 'cookie'],
|
|
55
|
+
},
|
|
53
56
|
debug: false,
|
|
54
57
|
|
|
55
58
|
suspiciousThreshold: 5,
|
|
@@ -59,7 +62,7 @@ const DEFAULTS = {
|
|
|
59
62
|
|
|
60
63
|
onThreat: null,
|
|
61
64
|
|
|
62
|
-
maxObjectDepth:
|
|
65
|
+
maxObjectDepth: 8,
|
|
63
66
|
};
|
|
64
67
|
|
|
65
68
|
module.exports = { DEFAULTS };
|