securenow 6.0.2 → 6.1.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/CONSUMING-APPS-GUIDE.md +455 -0
- package/NPM_README.md +2029 -0
- package/README.md +297 -40
- package/SKILL-API.md +634 -0
- package/SKILL-CLI.md +454 -0
- package/cidr.js +83 -0
- package/cli/apps.js +585 -0
- package/cli/auth.js +280 -0
- package/cli/client.js +115 -0
- package/cli/config.js +173 -0
- package/cli/diagnostics.js +387 -0
- package/cli/firewall.js +100 -0
- package/cli/fp.js +638 -0
- package/cli/init.js +201 -0
- package/cli/monitor.js +440 -0
- package/cli/run.js +148 -0
- package/cli/security.js +980 -0
- package/cli/ui.js +386 -0
- package/cli/utils.js +127 -0
- package/cli.js +466 -455
- package/console-instrumentation.js +147 -136
- package/docs/ALL-FRAMEWORKS-QUICKSTART.md +1377 -455
- package/docs/API-KEYS-GUIDE.md +233 -0
- package/docs/ARCHITECTURE.md +3 -3
- package/docs/AUTO-BODY-CAPTURE.md +1 -1
- package/docs/AUTO-SETUP-SUMMARY.md +331 -0
- package/docs/AUTO-SETUP.md +4 -4
- package/docs/AUTOMATIC-IP-CAPTURE.md +5 -5
- package/docs/BODY-CAPTURE-FIX.md +261 -0
- package/docs/BODY-CAPTURE-QUICKSTART.md +2 -2
- package/docs/CHANGELOG-NEXTJS.md +1 -35
- package/docs/COMPLETION-REPORT.md +408 -0
- package/docs/CUSTOMER-GUIDE.md +16 -16
- package/docs/EASIEST-SETUP.md +5 -5
- package/docs/ENVIRONMENT-VARIABLES.md +880 -652
- package/docs/EXPRESS-BODY-CAPTURE.md +13 -12
- package/docs/EXPRESS-SETUP-GUIDE.md +719 -720
- package/docs/FINAL-SOLUTION.md +335 -0
- package/docs/FIREWALL-GUIDE.md +426 -0
- package/docs/IMPLEMENTATION-SUMMARY.md +410 -0
- package/docs/INDEX.md +22 -4
- package/docs/LOGGING-GUIDE.md +701 -708
- package/docs/LOGGING-QUICKSTART.md +234 -255
- package/docs/NEXTJS-BODY-CAPTURE-COMPARISON.md +323 -0
- package/docs/NEXTJS-BODY-CAPTURE.md +2 -2
- package/docs/NEXTJS-GUIDE.md +14 -14
- package/docs/NEXTJS-QUICKSTART.md +1 -1
- package/docs/NEXTJS-SETUP-COMPLETE.md +795 -0
- package/docs/NEXTJS-WRAPPER-APPROACH.md +1 -1
- package/docs/NUXT-GUIDE.md +166 -0
- package/docs/QUICKSTART-BODY-CAPTURE.md +2 -2
- package/docs/REDACTION-EXAMPLES.md +1 -1
- package/docs/REQUEST-BODY-CAPTURE.md +19 -10
- package/docs/SOLUTION-SUMMARY.md +312 -0
- package/docs/VERCEL-OTEL-MIGRATION.md +3 -3
- package/examples/README.md +6 -6
- package/examples/instrumentation-with-auto-capture.ts +1 -1
- package/examples/nextjs-env-example.txt +2 -2
- package/examples/nextjs-instrumentation.js +1 -1
- package/examples/nextjs-instrumentation.ts +1 -1
- package/examples/nextjs-with-logging-example.md +6 -6
- package/examples/nextjs-with-options.ts +1 -1
- package/examples/test-nextjs-setup.js +1 -1
- package/firewall-cloud.js +212 -0
- package/firewall-iptables.js +139 -0
- package/firewall-only.js +38 -0
- package/firewall-tcp.js +74 -0
- package/firewall.js +720 -0
- package/free-trial-banner.js +174 -0
- package/nextjs-auto-capture.js +199 -207
- package/nextjs-middleware.js +186 -181
- package/nextjs-webpack-config.js +88 -53
- package/nextjs-wrapper.js +158 -158
- package/nextjs.d.ts +1 -1
- package/nextjs.js +639 -647
- package/nuxt-server-plugin.mjs +423 -0
- package/nuxt.d.ts +60 -0
- package/nuxt.mjs +75 -0
- package/package.json +186 -164
- package/postinstall.js +6 -6
- package/register.d.ts +1 -1
- package/register.js +39 -4
- package/resolve-ip.js +77 -0
- package/tracing.d.ts +2 -1
- package/tracing.js +295 -34
- package/web-vite.mjs +239 -156
- package/LICENSE +0 -15
|
@@ -1,652 +1,880 @@
|
|
|
1
|
-
# SecureNow Environment Variables Reference
|
|
2
|
-
|
|
3
|
-
Complete reference for all environment variables supported by SecureNow.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Quick Reference Table
|
|
8
|
-
|
|
9
|
-
| Variable | Type | Default | Description |
|
|
10
|
-
|----------|------|---------|-------------|
|
|
11
|
-
| **SECURENOW_APPID** | Required | - | Application identifier / service name |
|
|
12
|
-
| **SECURENOW_INSTANCE** | Required | `https://freetrial.securenow.ai:4318` | OTLP collector base URL |
|
|
13
|
-
| **SECURENOW_LOGGING_ENABLED** | Optional | `1` | Enable/disable logging |
|
|
14
|
-
| **SECURENOW_NO_UUID** | Optional | `0` | Disable UUID suffix on service name |
|
|
15
|
-
| **SECURENOW_STRICT** | Optional | `0` | Exit if APPID missing in cluster mode |
|
|
16
|
-
| **SECURENOW_CAPTURE_BODY** | Optional | `0` | Enable request body capture |
|
|
17
|
-
| **SECURENOW_MAX_BODY_SIZE** | Optional | `10240` | Max body size in bytes |
|
|
18
|
-
| **SECURENOW_SENSITIVE_FIELDS** | Optional | - | Comma-separated list of fields to redact |
|
|
19
|
-
| **
|
|
20
|
-
| **
|
|
21
|
-
| **
|
|
22
|
-
| **
|
|
23
|
-
| **
|
|
24
|
-
| **
|
|
25
|
-
| **
|
|
26
|
-
| **
|
|
27
|
-
| **
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
**
|
|
36
|
-
|
|
37
|
-
**
|
|
38
|
-
|
|
39
|
-
**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
**
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
**
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
**
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
**
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
**
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
**
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
**
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
**
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
**
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
**
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
```
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
```
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
1
|
+
# SecureNow Environment Variables Reference
|
|
2
|
+
|
|
3
|
+
Complete reference for all environment variables supported by SecureNow.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Quick Reference Table
|
|
8
|
+
|
|
9
|
+
| Variable | Type | Default | Description |
|
|
10
|
+
|----------|------|---------|-------------|
|
|
11
|
+
| **SECURENOW_APPID** | Required | - | Application identifier / service name |
|
|
12
|
+
| **SECURENOW_INSTANCE** | Required | `https://freetrial.securenow.ai:4318` | OTLP collector base URL |
|
|
13
|
+
| **SECURENOW_LOGGING_ENABLED** | Optional | `1` | Enable/disable logging |
|
|
14
|
+
| **SECURENOW_NO_UUID** | Optional | `0` | Disable UUID suffix on service name |
|
|
15
|
+
| **SECURENOW_STRICT** | Optional | `0` | Exit if APPID missing in cluster mode |
|
|
16
|
+
| **SECURENOW_CAPTURE_BODY** | Optional | `0` | Enable request body capture |
|
|
17
|
+
| **SECURENOW_MAX_BODY_SIZE** | Optional | `10240` | Max body size in bytes |
|
|
18
|
+
| **SECURENOW_SENSITIVE_FIELDS** | Optional | - | Comma-separated list of fields to redact |
|
|
19
|
+
| **SECURENOW_CAPTURE_MULTIPART** | Optional | `0` | Enable multipart/form-data streaming capture |
|
|
20
|
+
| **SECURENOW_DISABLE_INSTRUMENTATIONS** | Optional | - | Comma-separated list of packages to disable |
|
|
21
|
+
| **SECURENOW_TEST_SPAN** | Optional | `0` | Emit test span on startup |
|
|
22
|
+
| **OTEL_SERVICE_NAME** | Optional | - | Alternative to SECURENOW_APPID |
|
|
23
|
+
| **OTEL_EXPORTER_OTLP_ENDPOINT** | Optional | - | Alternative to SECURENOW_INSTANCE |
|
|
24
|
+
| **OTEL_EXPORTER_OTLP_HEADERS** | Optional | - | Headers for OTLP requests |
|
|
25
|
+
| **OTEL_EXPORTER_OTLP_TRACES_ENDPOINT** | Optional | - | Override traces endpoint |
|
|
26
|
+
| **OTEL_EXPORTER_OTLP_LOGS_ENDPOINT** | Optional | - | Override logs endpoint |
|
|
27
|
+
| **OTEL_LOG_LEVEL** | Optional | `none` | SDK log level |
|
|
28
|
+
| **NODE_ENV** | Optional | `production` | Environment name |
|
|
29
|
+
| **SECURENOW_API_KEY** | Optional | - | API key for firewall (auto-activates when set) |
|
|
30
|
+
| **SECURENOW_API_URL** | Optional | `https://api.securenow.ai` | API base URL |
|
|
31
|
+
| **SECURENOW_FIREWALL_ENABLED** | Optional | `1` | Firewall master kill-switch |
|
|
32
|
+
| **SECURENOW_FIREWALL_SYNC_INTERVAL** | Optional | `60` | Blocklist refresh interval (seconds) |
|
|
33
|
+
| **SECURENOW_FIREWALL_FAIL_MODE** | Optional | `open` | Behavior when API unreachable: open/closed |
|
|
34
|
+
| **SECURENOW_FIREWALL_STATUS_CODE** | Optional | `403` | HTTP status for blocked requests |
|
|
35
|
+
| **SECURENOW_FIREWALL_LOG** | Optional | `1` | Log blocked requests |
|
|
36
|
+
| **SECURENOW_FIREWALL_TCP** | Optional | `0` | Enable Layer 2 TCP blocking |
|
|
37
|
+
| **SECURENOW_FIREWALL_IPTABLES** | Optional | `0` | Enable Layer 3 iptables blocking |
|
|
38
|
+
| **SECURENOW_FIREWALL_CLOUD** | Optional | - | Cloud WAF provider (cloudflare/aws/gcp) |
|
|
39
|
+
| **SECURENOW_TRUSTED_PROXIES** | Optional | - | Trusted proxy IPs for X-Forwarded-For |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Required Variables
|
|
44
|
+
|
|
45
|
+
### SECURENOW_APPID
|
|
46
|
+
|
|
47
|
+
**Description:** Your application identifier. Used as the service name in traces and logs.
|
|
48
|
+
|
|
49
|
+
**Format:** String (alphanumeric, hyphens, underscores)
|
|
50
|
+
|
|
51
|
+
**Examples:**
|
|
52
|
+
```bash
|
|
53
|
+
export SECURENOW_APPID=my-express-app
|
|
54
|
+
export SECURENOW_APPID=api-gateway
|
|
55
|
+
export SECURENOW_APPID=user-service
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Notes:**
|
|
59
|
+
- If not set, SecureNow will use a fallback name with UUID
|
|
60
|
+
- In cluster mode with `SECURENOW_STRICT=1`, missing APPID will cause process exit
|
|
61
|
+
- Alternative: Use `OTEL_SERVICE_NAME` (OpenTelemetry standard)
|
|
62
|
+
|
|
63
|
+
**Behavior:**
|
|
64
|
+
- Without `SECURENOW_NO_UUID=1`: Service name becomes `{APPID}-{UUID}`
|
|
65
|
+
- With `SECURENOW_NO_UUID=1`: Service name is exactly `{APPID}`
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### SECURENOW_INSTANCE
|
|
70
|
+
|
|
71
|
+
**Description:** Base URL of your OTLP collector endpoint.
|
|
72
|
+
|
|
73
|
+
**Format:** URL (http/https)
|
|
74
|
+
|
|
75
|
+
**Examples:**
|
|
76
|
+
```bash
|
|
77
|
+
# Local collector
|
|
78
|
+
export SECURENOW_INSTANCE=http://localhost:4318
|
|
79
|
+
|
|
80
|
+
# Remote collector
|
|
81
|
+
export SECURENOW_INSTANCE=http://collector.example.com:4318
|
|
82
|
+
|
|
83
|
+
# HTTPS
|
|
84
|
+
export SECURENOW_INSTANCE=https://collector.example.com:4318
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Default:** `https://freetrial.securenow.ai:4318` (if not set)
|
|
88
|
+
|
|
89
|
+
**Notes:**
|
|
90
|
+
- Used to construct traces and logs endpoints
|
|
91
|
+
- Traces sent to: `{SECURENOW_INSTANCE}/v1/traces`
|
|
92
|
+
- Logs sent to: `{SECURENOW_INSTANCE}/v1/logs`
|
|
93
|
+
- Alternative: Use `OTEL_EXPORTER_OTLP_ENDPOINT`
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Service Naming
|
|
98
|
+
|
|
99
|
+
### OTEL_SERVICE_NAME
|
|
100
|
+
|
|
101
|
+
**Description:** Standard OpenTelemetry variable for service name. Alternative to `SECURENOW_APPID`.
|
|
102
|
+
|
|
103
|
+
**Format:** String
|
|
104
|
+
|
|
105
|
+
**Example:**
|
|
106
|
+
```bash
|
|
107
|
+
export OTEL_SERVICE_NAME=my-app
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Priority:** If both are set, `OTEL_SERVICE_NAME` takes precedence.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### SECURENOW_NO_UUID
|
|
115
|
+
|
|
116
|
+
**Description:** Disable automatic UUID suffix on service name.
|
|
117
|
+
|
|
118
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
119
|
+
|
|
120
|
+
**Default:** `0`
|
|
121
|
+
|
|
122
|
+
**Example:**
|
|
123
|
+
```bash
|
|
124
|
+
export SECURENOW_NO_UUID=1
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Use case:**
|
|
128
|
+
- PM2 cluster mode - use same service name for all workers
|
|
129
|
+
- Docker containers with replica sets
|
|
130
|
+
- Kubernetes pods in a deployment
|
|
131
|
+
|
|
132
|
+
**Behavior:**
|
|
133
|
+
- `0`: Service name = `my-app-a1b2c3d4`
|
|
134
|
+
- `1`: Service name = `my-app`
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### SECURENOW_STRICT
|
|
139
|
+
|
|
140
|
+
**Description:** Exit process if `SECURENOW_APPID` is not set in cluster mode.
|
|
141
|
+
|
|
142
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
143
|
+
|
|
144
|
+
**Default:** `0`
|
|
145
|
+
|
|
146
|
+
**Example:**
|
|
147
|
+
```bash
|
|
148
|
+
export SECURENOW_STRICT=1
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Use case:**
|
|
152
|
+
- Production environments where service name must be explicit
|
|
153
|
+
- Prevent "free" or auto-generated service names
|
|
154
|
+
- Ensure proper configuration before starting
|
|
155
|
+
|
|
156
|
+
**Detection:**
|
|
157
|
+
Cluster mode is detected when any of these exist:
|
|
158
|
+
- `NODE_APP_INSTANCE` (PM2)
|
|
159
|
+
- `pm_id` (PM2)
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Connection Settings
|
|
164
|
+
|
|
165
|
+
### OTEL_EXPORTER_OTLP_ENDPOINT
|
|
166
|
+
|
|
167
|
+
**Description:** Standard OpenTelemetry variable for OTLP endpoint. Alternative to `SECURENOW_INSTANCE`.
|
|
168
|
+
|
|
169
|
+
**Format:** URL
|
|
170
|
+
|
|
171
|
+
**Example:**
|
|
172
|
+
```bash
|
|
173
|
+
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Priority:** If both are set, `OTEL_EXPORTER_OTLP_ENDPOINT` takes precedence.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
|
|
181
|
+
|
|
182
|
+
**Description:** Override the traces endpoint specifically.
|
|
183
|
+
|
|
184
|
+
**Format:** Full URL including `/v1/traces`
|
|
185
|
+
|
|
186
|
+
**Example:**
|
|
187
|
+
```bash
|
|
188
|
+
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://traces-collector:4318/v1/traces
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Use case:**
|
|
192
|
+
- Separate collectors for traces and logs
|
|
193
|
+
- Different routing for traces
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### OTEL_EXPORTER_OTLP_LOGS_ENDPOINT
|
|
198
|
+
|
|
199
|
+
**Description:** Override the logs endpoint specifically.
|
|
200
|
+
|
|
201
|
+
**Format:** Full URL including `/v1/logs`
|
|
202
|
+
|
|
203
|
+
**Example:**
|
|
204
|
+
```bash
|
|
205
|
+
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://logs-collector:4318/v1/logs
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Use case:**
|
|
209
|
+
- Separate collectors for traces and logs
|
|
210
|
+
- Different routing for logs
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### OTEL_EXPORTER_OTLP_HEADERS
|
|
215
|
+
|
|
216
|
+
**Description:** Headers to include in OTLP export requests.
|
|
217
|
+
|
|
218
|
+
**Format:** Comma-separated `key=value` pairs
|
|
219
|
+
|
|
220
|
+
**Examples:**
|
|
221
|
+
```bash
|
|
222
|
+
# Single header
|
|
223
|
+
export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=your-api-key"
|
|
224
|
+
|
|
225
|
+
# Multiple headers
|
|
226
|
+
export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=key123,x-tenant-id=tenant456"
|
|
227
|
+
|
|
228
|
+
# Authentication
|
|
229
|
+
export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer token123"
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Use case:**
|
|
233
|
+
- API authentication
|
|
234
|
+
- Multi-tenancy headers
|
|
235
|
+
- Custom routing headers
|
|
236
|
+
|
|
237
|
+
**Notes:**
|
|
238
|
+
- Header names are case-insensitive
|
|
239
|
+
- Trailing/leading spaces are trimmed
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Logging
|
|
244
|
+
|
|
245
|
+
### SECURENOW_LOGGING_ENABLED
|
|
246
|
+
|
|
247
|
+
**Description:** Enable or disable automatic logging to OTLP backend.
|
|
248
|
+
|
|
249
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
250
|
+
|
|
251
|
+
**Default:** `1` (enabled by default)
|
|
252
|
+
|
|
253
|
+
**Examples:**
|
|
254
|
+
```bash
|
|
255
|
+
# Enable logging
|
|
256
|
+
export SECURENOW_LOGGING_ENABLED=1
|
|
257
|
+
|
|
258
|
+
# Disable logging
|
|
259
|
+
export SECURENOW_LOGGING_ENABLED=0
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**When enabled:**
|
|
263
|
+
- Logs are sent to `{SECURENOW_INSTANCE}/v1/logs`
|
|
264
|
+
- Console instrumentation can capture logs
|
|
265
|
+
- Direct logger API is available
|
|
266
|
+
|
|
267
|
+
**When disabled:**
|
|
268
|
+
- No logs sent to backend
|
|
269
|
+
- `getLogger()` returns `null`
|
|
270
|
+
- Console instrumentation shows warning
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Request Body Capture
|
|
275
|
+
|
|
276
|
+
### SECURENOW_CAPTURE_BODY
|
|
277
|
+
|
|
278
|
+
**Description:** Enable capture of HTTP request bodies in traces.
|
|
279
|
+
|
|
280
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
281
|
+
|
|
282
|
+
**Default:** `0` (disabled)
|
|
283
|
+
|
|
284
|
+
**Example:**
|
|
285
|
+
```bash
|
|
286
|
+
export SECURENOW_CAPTURE_BODY=1
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
**Supported content types:**
|
|
290
|
+
- `application/json`
|
|
291
|
+
- `application/x-www-form-urlencoded`
|
|
292
|
+
- `application/graphql`
|
|
293
|
+
|
|
294
|
+
**Not captured (unless separately enabled):**
|
|
295
|
+
- `multipart/form-data` — requires `SECURENOW_CAPTURE_MULTIPART=1` (see below)
|
|
296
|
+
- Bodies larger than `SECURENOW_MAX_BODY_SIZE`
|
|
297
|
+
|
|
298
|
+
**Security:**
|
|
299
|
+
All captured bodies are automatically scanned for sensitive fields and redacted.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
### SECURENOW_MAX_BODY_SIZE
|
|
304
|
+
|
|
305
|
+
**Description:** Maximum request body size to capture (in bytes).
|
|
306
|
+
|
|
307
|
+
**Format:** Number (bytes)
|
|
308
|
+
|
|
309
|
+
**Default:** `10240` (10 KB)
|
|
310
|
+
|
|
311
|
+
**Examples:**
|
|
312
|
+
```bash
|
|
313
|
+
# 10 KB (default)
|
|
314
|
+
export SECURENOW_MAX_BODY_SIZE=10240
|
|
315
|
+
|
|
316
|
+
# 20 KB
|
|
317
|
+
export SECURENOW_MAX_BODY_SIZE=20480
|
|
318
|
+
|
|
319
|
+
# 5 KB
|
|
320
|
+
export SECURENOW_MAX_BODY_SIZE=5120
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
**Behavior:**
|
|
324
|
+
- Bodies larger than this are not captured
|
|
325
|
+
- Span attribute shows: `[TOO LARGE: {size} bytes]`
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
### SECURENOW_SENSITIVE_FIELDS
|
|
330
|
+
|
|
331
|
+
**Description:** Additional field names to redact from request bodies (comma-separated).
|
|
332
|
+
|
|
333
|
+
**Format:** Comma-separated list of field names
|
|
334
|
+
|
|
335
|
+
**Default:** (see below for auto-redacted fields)
|
|
336
|
+
|
|
337
|
+
**Examples:**
|
|
338
|
+
```bash
|
|
339
|
+
# Additional custom fields
|
|
340
|
+
export SECURENOW_SENSITIVE_FIELDS="internal_token,session_key"
|
|
341
|
+
|
|
342
|
+
# Multiple fields
|
|
343
|
+
export SECURENOW_SENSITIVE_FIELDS="custom_secret,private_data,internal_id"
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**Auto-redacted fields (built-in):**
|
|
347
|
+
- `password`, `passwd`, `pwd`
|
|
348
|
+
- `secret`, `token`, `api_key`, `apikey`, `access_token`
|
|
349
|
+
- `auth`, `credentials`, `mysql_pwd`
|
|
350
|
+
- `stripeToken`, `card`, `cardnumber`
|
|
351
|
+
- `ccv`, `cvc`, `cvv`
|
|
352
|
+
- `ssn`, `pin`
|
|
353
|
+
|
|
354
|
+
**Matching:**
|
|
355
|
+
- Case-insensitive
|
|
356
|
+
- Substring match (e.g., `password` matches `user_password`, `PASSWORD`, `passwordField`)
|
|
357
|
+
- Works recursively in nested objects
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
### SECURENOW_CAPTURE_MULTIPART
|
|
362
|
+
|
|
363
|
+
**Description:** Enable capture of `multipart/form-data` request bodies (file upload metadata and text fields). Uses a streaming parser that processes boundary markers on the fly — file binary content is never buffered or stored.
|
|
364
|
+
|
|
365
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
366
|
+
|
|
367
|
+
**Default:** `0` (disabled)
|
|
368
|
+
|
|
369
|
+
**Example:**
|
|
370
|
+
```bash
|
|
371
|
+
export SECURENOW_CAPTURE_MULTIPART=1
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
**What gets captured:**
|
|
375
|
+
- **Text fields** — field name and value (up to 1000 characters), with sensitive fields auto-redacted
|
|
376
|
+
- **File fields** — metadata only: field name, filename, content-type, and size in bytes (no binary content)
|
|
377
|
+
|
|
378
|
+
**Example span attribute (`http.request.body`):**
|
|
379
|
+
```json
|
|
380
|
+
{
|
|
381
|
+
"fields": { "description": "My upload", "token": "[REDACTED]" },
|
|
382
|
+
"files": [
|
|
383
|
+
{ "field": "avatar", "filename": "photo.jpg", "contentType": "image/jpeg", "size": 524288 },
|
|
384
|
+
{ "field": "document", "filename": "report.pdf", "contentType": "application/pdf", "size": 1048576 }
|
|
385
|
+
]
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**Additional span attributes set:**
|
|
390
|
+
- `http.request.body.type` = `"multipart"`
|
|
391
|
+
- `http.request.body.size` — total raw request body size in bytes
|
|
392
|
+
- `http.request.body.fields_count` — number of text fields
|
|
393
|
+
- `http.request.body.files_count` — number of file fields
|
|
394
|
+
|
|
395
|
+
**Memory:** Bounded at ~few KB regardless of upload size (streaming parser discards file content as it passes through).
|
|
396
|
+
|
|
397
|
+
**Parts limit:** 100 parts maximum per request (safety guard).
|
|
398
|
+
|
|
399
|
+
**Requires:** `SECURENOW_CAPTURE_BODY=1` must also be set (multipart capture is gated behind general body capture).
|
|
400
|
+
|
|
401
|
+
**Since:** v5.8.0
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Instrumentation Control
|
|
406
|
+
|
|
407
|
+
### SECURENOW_DISABLE_INSTRUMENTATIONS
|
|
408
|
+
|
|
409
|
+
**Description:** Disable specific OpenTelemetry instrumentations.
|
|
410
|
+
|
|
411
|
+
**Format:** Comma-separated list of package names
|
|
412
|
+
|
|
413
|
+
**Example:**
|
|
414
|
+
```bash
|
|
415
|
+
# Disable file system and DNS instrumentations
|
|
416
|
+
export SECURENOW_DISABLE_INSTRUMENTATIONS=fs,dns
|
|
417
|
+
|
|
418
|
+
# Disable multiple
|
|
419
|
+
export SECURENOW_DISABLE_INSTRUMENTATIONS=fs,dns,net,http2
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
**Common packages you might disable:**
|
|
423
|
+
- `fs` - File system operations
|
|
424
|
+
- `dns` - DNS lookups
|
|
425
|
+
- `net` - Network operations
|
|
426
|
+
- `http2` - HTTP/2 client/server
|
|
427
|
+
- `grpc` - gRPC client/server
|
|
428
|
+
|
|
429
|
+
**Use case:**
|
|
430
|
+
- Reduce overhead by disabling unused instrumentations
|
|
431
|
+
- Avoid noisy traces from certain operations
|
|
432
|
+
- Debug issues with specific instrumentations
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Debugging
|
|
437
|
+
|
|
438
|
+
### OTEL_LOG_LEVEL
|
|
439
|
+
|
|
440
|
+
**Description:** OpenTelemetry SDK internal log level.
|
|
441
|
+
|
|
442
|
+
**Format:** `none`, `error`, `warn`, `info`, `debug`
|
|
443
|
+
|
|
444
|
+
**Default:** `none`
|
|
445
|
+
|
|
446
|
+
**Examples:**
|
|
447
|
+
```bash
|
|
448
|
+
# See all debug information
|
|
449
|
+
export OTEL_LOG_LEVEL=debug
|
|
450
|
+
|
|
451
|
+
# Only errors
|
|
452
|
+
export OTEL_LOG_LEVEL=error
|
|
453
|
+
|
|
454
|
+
# No SDK logs
|
|
455
|
+
export OTEL_LOG_LEVEL=none
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
**Use case:**
|
|
459
|
+
- Troubleshooting setup issues
|
|
460
|
+
- Understanding trace/log export behavior
|
|
461
|
+
- Debugging connection problems
|
|
462
|
+
|
|
463
|
+
**Output:**
|
|
464
|
+
- Goes to console (stderr)
|
|
465
|
+
- Prefixed with `[securenow]`
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
### SECURENOW_TEST_SPAN
|
|
470
|
+
|
|
471
|
+
**Description:** Emit a test span on startup to verify tracing is working.
|
|
472
|
+
|
|
473
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
474
|
+
|
|
475
|
+
**Default:** `0`
|
|
476
|
+
|
|
477
|
+
**Example:**
|
|
478
|
+
```bash
|
|
479
|
+
export SECURENOW_TEST_SPAN=1
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
**Behavior:**
|
|
483
|
+
- Creates a span named `securenow.startup.smoke`
|
|
484
|
+
- Span is immediately ended
|
|
485
|
+
- Useful for testing collector connectivity
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
489
|
+
## Environment
|
|
490
|
+
|
|
491
|
+
### NODE_ENV
|
|
492
|
+
|
|
493
|
+
**Description:** Standard Node.js environment variable. Sent as `deployment.environment` attribute.
|
|
494
|
+
|
|
495
|
+
**Format:** String (typically: `development`, `production`, `test`, `staging`)
|
|
496
|
+
|
|
497
|
+
**Default:** `production`
|
|
498
|
+
|
|
499
|
+
**Examples:**
|
|
500
|
+
```bash
|
|
501
|
+
export NODE_ENV=development
|
|
502
|
+
export NODE_ENV=production
|
|
503
|
+
export NODE_ENV=staging
|
|
504
|
+
export NODE_ENV=test
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
**Use case:**
|
|
508
|
+
- Filter traces/logs by environment
|
|
509
|
+
- Different configurations per environment
|
|
510
|
+
- Standard Node.js convention
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
## Firewall (IP Blocking)
|
|
515
|
+
|
|
516
|
+
### SECURENOW_API_KEY
|
|
517
|
+
|
|
518
|
+
**Description:** API key for the SecureNow firewall. When set, the firewall auto-activates and syncs your blocklist. Must have the `firewall:read` scope.
|
|
519
|
+
|
|
520
|
+
**Format:** String (`snk_live_` prefix + 64 hex characters)
|
|
521
|
+
|
|
522
|
+
**Example:**
|
|
523
|
+
```bash
|
|
524
|
+
export SECURENOW_API_KEY=snk_live_a1b2c3d4e5f6...
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
### SECURENOW_API_URL
|
|
530
|
+
|
|
531
|
+
**Description:** Base URL for the SecureNow API.
|
|
532
|
+
|
|
533
|
+
**Format:** URL
|
|
534
|
+
|
|
535
|
+
**Default:** `https://api.securenow.ai`
|
|
536
|
+
|
|
537
|
+
**Example:**
|
|
538
|
+
```bash
|
|
539
|
+
export SECURENOW_API_URL=https://api.securenow.ai
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
### SECURENOW_FIREWALL_ENABLED
|
|
545
|
+
|
|
546
|
+
**Description:** Master kill-switch for the firewall. Set to `0` to disable even when `SECURENOW_API_KEY` is set.
|
|
547
|
+
|
|
548
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
549
|
+
|
|
550
|
+
**Default:** `1`
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
|
|
554
|
+
### SECURENOW_FIREWALL_SYNC_INTERVAL
|
|
555
|
+
|
|
556
|
+
**Description:** How often (in seconds) to refresh the blocklist from the API.
|
|
557
|
+
|
|
558
|
+
**Format:** Number (seconds)
|
|
559
|
+
|
|
560
|
+
**Default:** `60`
|
|
561
|
+
|
|
562
|
+
**Example:**
|
|
563
|
+
```bash
|
|
564
|
+
export SECURENOW_FIREWALL_SYNC_INTERVAL=30
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
---
|
|
568
|
+
|
|
569
|
+
### SECURENOW_FIREWALL_FAIL_MODE
|
|
570
|
+
|
|
571
|
+
**Description:** Behavior when the blocklist cannot be fetched from the API.
|
|
572
|
+
|
|
573
|
+
**Format:** `open` or `closed`
|
|
574
|
+
|
|
575
|
+
**Default:** `open`
|
|
576
|
+
|
|
577
|
+
- `open` — Allow all traffic when list is unavailable (recommended for most apps)
|
|
578
|
+
- `closed` — Block all traffic when list is unavailable (high-security environments)
|
|
579
|
+
|
|
580
|
+
---
|
|
581
|
+
|
|
582
|
+
### SECURENOW_FIREWALL_STATUS_CODE
|
|
583
|
+
|
|
584
|
+
**Description:** HTTP status code returned to blocked requests (Layer 1 only).
|
|
585
|
+
|
|
586
|
+
**Format:** Number
|
|
587
|
+
|
|
588
|
+
**Default:** `403`
|
|
589
|
+
|
|
590
|
+
**Example:**
|
|
591
|
+
```bash
|
|
592
|
+
export SECURENOW_FIREWALL_STATUS_CODE=429
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
---
|
|
596
|
+
|
|
597
|
+
### SECURENOW_FIREWALL_LOG
|
|
598
|
+
|
|
599
|
+
**Description:** Log blocked requests to the console.
|
|
600
|
+
|
|
601
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
602
|
+
|
|
603
|
+
**Default:** `1`
|
|
604
|
+
|
|
605
|
+
---
|
|
606
|
+
|
|
607
|
+
### SECURENOW_FIREWALL_TCP
|
|
608
|
+
|
|
609
|
+
**Description:** Enable Layer 2 TCP-level blocking. Destroys sockets from blocked IPs before HTTP parsing starts.
|
|
610
|
+
|
|
611
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
612
|
+
|
|
613
|
+
**Default:** `0`
|
|
614
|
+
|
|
615
|
+
**Notes:**
|
|
616
|
+
- Only sees direct connection IP (no proxy headers)
|
|
617
|
+
- Connections from trusted proxies are passed to Layer 1
|
|
618
|
+
- Most effective for direct-to-server deployments
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
### SECURENOW_FIREWALL_IPTABLES
|
|
623
|
+
|
|
624
|
+
**Description:** Enable Layer 3 OS firewall blocking via iptables/nftables. Kernel-level DROP — packets never reach Node.js.
|
|
625
|
+
|
|
626
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
627
|
+
|
|
628
|
+
**Default:** `0`
|
|
629
|
+
|
|
630
|
+
**Notes:**
|
|
631
|
+
- Linux only (skips gracefully on macOS/Windows)
|
|
632
|
+
- Requires root or CAP_NET_ADMIN
|
|
633
|
+
- Auto-detects nftables vs iptables
|
|
634
|
+
- Dedicated chain: `SECURENOW_BLOCK`
|
|
635
|
+
|
|
636
|
+
---
|
|
637
|
+
|
|
638
|
+
### SECURENOW_FIREWALL_CLOUD
|
|
639
|
+
|
|
640
|
+
**Description:** Enable Layer 4 cloud/edge WAF blocking. Pushes the blocklist to your cloud provider's WAF.
|
|
641
|
+
|
|
642
|
+
**Format:** `cloudflare`, `aws`, or `gcp`
|
|
643
|
+
|
|
644
|
+
**Default:** *(none — disabled)*
|
|
645
|
+
|
|
646
|
+
**Provider-specific variables:**
|
|
647
|
+
|
|
648
|
+
| Provider | Required Variables |
|
|
649
|
+
|----------|-------------------|
|
|
650
|
+
| `cloudflare` | `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` |
|
|
651
|
+
| `aws` | `AWS_WAF_IP_SET_ID`, standard AWS credentials |
|
|
652
|
+
| `gcp` | `GCP_PROJECT_ID`, `GCP_SECURITY_POLICY` |
|
|
653
|
+
|
|
654
|
+
---
|
|
655
|
+
|
|
656
|
+
### SECURENOW_FIREWALL_CLOUD_DRY_RUN
|
|
657
|
+
|
|
658
|
+
**Description:** Log cloud WAF pushes without actually applying them. Useful for testing.
|
|
659
|
+
|
|
660
|
+
**Format:** `1` (enabled) or `0` (disabled)
|
|
661
|
+
|
|
662
|
+
**Default:** `0`
|
|
663
|
+
|
|
664
|
+
---
|
|
665
|
+
|
|
666
|
+
### SECURENOW_TRUSTED_PROXIES
|
|
667
|
+
|
|
668
|
+
**Description:** Comma-separated list of additional trusted proxy IPs. The firewall only reads `X-Forwarded-For` from trusted proxies. Private/loopback IPs are always trusted.
|
|
669
|
+
|
|
670
|
+
**Format:** Comma-separated IPs
|
|
671
|
+
|
|
672
|
+
**Example:**
|
|
673
|
+
```bash
|
|
674
|
+
export SECURENOW_TRUSTED_PROXIES=34.120.0.1,34.120.0.2
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
---
|
|
678
|
+
|
|
679
|
+
## Configuration Examples
|
|
680
|
+
|
|
681
|
+
### Development Environment
|
|
682
|
+
|
|
683
|
+
```bash
|
|
684
|
+
# .env.development
|
|
685
|
+
SECURENOW_APPID=my-app-dev
|
|
686
|
+
SECURENOW_INSTANCE=http://localhost:4318
|
|
687
|
+
SECURENOW_LOGGING_ENABLED=1
|
|
688
|
+
SECURENOW_CAPTURE_BODY=1
|
|
689
|
+
SECURENOW_MAX_BODY_SIZE=20480
|
|
690
|
+
OTEL_LOG_LEVEL=debug
|
|
691
|
+
SECURENOW_TEST_SPAN=1
|
|
692
|
+
NODE_ENV=development
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
### Production Environment
|
|
696
|
+
|
|
697
|
+
```bash
|
|
698
|
+
# .env.production
|
|
699
|
+
SECURENOW_APPID=my-app-prod
|
|
700
|
+
SECURENOW_INSTANCE=https://collector.prod.example.com:4318
|
|
701
|
+
OTEL_EXPORTER_OTLP_HEADERS=x-api-key=prod-key-12345
|
|
702
|
+
SECURENOW_LOGGING_ENABLED=1
|
|
703
|
+
SECURENOW_CAPTURE_BODY=0
|
|
704
|
+
SECURENOW_NO_UUID=1
|
|
705
|
+
SECURENOW_STRICT=1
|
|
706
|
+
SECURENOW_SENSITIVE_FIELDS=internal_id,session_token
|
|
707
|
+
OTEL_LOG_LEVEL=error
|
|
708
|
+
NODE_ENV=production
|
|
709
|
+
|
|
710
|
+
# Firewall (optional — auto-activates when API key is set)
|
|
711
|
+
SECURENOW_API_KEY=snk_live_abc123...
|
|
712
|
+
SECURENOW_FIREWALL_TCP=1
|
|
713
|
+
SECURENOW_FIREWALL_SYNC_INTERVAL=30
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
### PM2 Cluster
|
|
717
|
+
|
|
718
|
+
```bash
|
|
719
|
+
# ecosystem.config.js environment
|
|
720
|
+
SECURENOW_APPID=my-app
|
|
721
|
+
SECURENOW_INSTANCE=http://localhost:4318
|
|
722
|
+
SECURENOW_LOGGING_ENABLED=1
|
|
723
|
+
SECURENOW_NO_UUID=1
|
|
724
|
+
SECURENOW_STRICT=1
|
|
725
|
+
SECURENOW_CAPTURE_BODY=1
|
|
726
|
+
NODE_ENV=production
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
### Docker / Kubernetes
|
|
730
|
+
|
|
731
|
+
```bash
|
|
732
|
+
# Docker environment or K8s ConfigMap
|
|
733
|
+
SECURENOW_APPID=my-service
|
|
734
|
+
SECURENOW_INSTANCE=http://otel-collector:4318
|
|
735
|
+
SECURENOW_LOGGING_ENABLED=1
|
|
736
|
+
SECURENOW_NO_UUID=1
|
|
737
|
+
SECURENOW_CAPTURE_BODY=0
|
|
738
|
+
NODE_ENV=production
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
### Separate Collectors for Traces and Logs
|
|
742
|
+
|
|
743
|
+
```bash
|
|
744
|
+
# Different backends for traces and logs
|
|
745
|
+
SECURENOW_APPID=my-app
|
|
746
|
+
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://traces-collector:4318/v1/traces
|
|
747
|
+
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://logs-collector:4318/v1/logs
|
|
748
|
+
SECURENOW_LOGGING_ENABLED=1
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
---
|
|
752
|
+
|
|
753
|
+
## Priority and Overrides
|
|
754
|
+
|
|
755
|
+
When multiple variables are set, this is the priority order:
|
|
756
|
+
|
|
757
|
+
### Service Name
|
|
758
|
+
|
|
759
|
+
1. `OTEL_SERVICE_NAME` (highest priority)
|
|
760
|
+
2. `SECURENOW_APPID`
|
|
761
|
+
3. Auto-generated fallback (lowest priority)
|
|
762
|
+
|
|
763
|
+
### OTLP Endpoint
|
|
764
|
+
|
|
765
|
+
1. `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` (for traces)
|
|
766
|
+
2. `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` (for logs)
|
|
767
|
+
3. `OTEL_EXPORTER_OTLP_ENDPOINT`
|
|
768
|
+
4. `SECURENOW_INSTANCE`
|
|
769
|
+
5. Default: `https://freetrial.securenow.ai:4318` (lowest priority)
|
|
770
|
+
|
|
771
|
+
---
|
|
772
|
+
|
|
773
|
+
## Validation
|
|
774
|
+
|
|
775
|
+
SecureNow validates environment variables on startup. Check console output:
|
|
776
|
+
|
|
777
|
+
```bash
|
|
778
|
+
[securenow] pid=12345 SECURENOW_APPID="my-app" OTEL_SERVICE_NAME=null → service.name=my-app-uuid123
|
|
779
|
+
[securenow] OTel SDK started → http://localhost:4318/v1/traces
|
|
780
|
+
[securenow] 📋 Logging: ENABLED → http://localhost:4318/v1/logs
|
|
781
|
+
[securenow] 📝 Request body capture: ENABLED (max: 10240 bytes)
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
---
|
|
785
|
+
|
|
786
|
+
## Best Practices
|
|
787
|
+
|
|
788
|
+
### 1. Use .env Files
|
|
789
|
+
|
|
790
|
+
Don't hardcode in your application:
|
|
791
|
+
|
|
792
|
+
```bash
|
|
793
|
+
# .env
|
|
794
|
+
SECURENOW_APPID=my-app
|
|
795
|
+
SECURENOW_INSTANCE=http://localhost:4318
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
### 2. Different Configs per Environment
|
|
799
|
+
|
|
800
|
+
```bash
|
|
801
|
+
# .env.development
|
|
802
|
+
SECURENOW_CAPTURE_BODY=1
|
|
803
|
+
OTEL_LOG_LEVEL=debug
|
|
804
|
+
|
|
805
|
+
# .env.production
|
|
806
|
+
SECURENOW_CAPTURE_BODY=0
|
|
807
|
+
OTEL_LOG_LEVEL=error
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
### 3. Use SECURENOW_NO_UUID in Clusters
|
|
811
|
+
|
|
812
|
+
```bash
|
|
813
|
+
# PM2 cluster with 4 workers
|
|
814
|
+
SECURENOW_NO_UUID=1
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
### 4. Enable SECURENOW_STRICT in Production
|
|
818
|
+
|
|
819
|
+
```bash
|
|
820
|
+
# Fail fast if misconfigured
|
|
821
|
+
SECURENOW_STRICT=1
|
|
822
|
+
```
|
|
823
|
+
|
|
824
|
+
### 5. Disable Body Capture in Production
|
|
825
|
+
|
|
826
|
+
```bash
|
|
827
|
+
# Development
|
|
828
|
+
SECURENOW_CAPTURE_BODY=1
|
|
829
|
+
|
|
830
|
+
# Production
|
|
831
|
+
SECURENOW_CAPTURE_BODY=0
|
|
832
|
+
```
|
|
833
|
+
|
|
834
|
+
---
|
|
835
|
+
|
|
836
|
+
## Troubleshooting
|
|
837
|
+
|
|
838
|
+
### Check Current Values
|
|
839
|
+
|
|
840
|
+
```bash
|
|
841
|
+
# Print all SECURENOW variables
|
|
842
|
+
env | grep SECURENOW
|
|
843
|
+
|
|
844
|
+
# Print all OTEL variables
|
|
845
|
+
env | grep OTEL
|
|
846
|
+
|
|
847
|
+
# Check specific variable
|
|
848
|
+
echo $SECURENOW_APPID
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
### Verify in Application
|
|
852
|
+
|
|
853
|
+
SecureNow logs current configuration on startup. Look for lines like:
|
|
854
|
+
|
|
855
|
+
```
|
|
856
|
+
[securenow] pid=12345 SECURENOW_APPID="my-app" → service.name=my-app
|
|
857
|
+
[securenow] OTel SDK started → http://localhost:4318/v1/traces
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
### Enable Debug Mode
|
|
861
|
+
|
|
862
|
+
```bash
|
|
863
|
+
export OTEL_LOG_LEVEL=debug
|
|
864
|
+
node app.js
|
|
865
|
+
```
|
|
866
|
+
|
|
867
|
+
---
|
|
868
|
+
|
|
869
|
+
## Related Documentation
|
|
870
|
+
|
|
871
|
+
- [Firewall Guide](./FIREWALL-GUIDE.md)
|
|
872
|
+
- [API Keys Guide](./API-KEYS-GUIDE.md)
|
|
873
|
+
- [Express Setup Guide](./EXPRESS-SETUP-GUIDE.md)
|
|
874
|
+
- [Next.js Setup Guide](./NEXTJS-SETUP-COMPLETE.md)
|
|
875
|
+
- [Logging Guide](./LOGGING-GUIDE.md)
|
|
876
|
+
- [NPM README](../NPM_README.md)
|
|
877
|
+
|
|
878
|
+
---
|
|
879
|
+
|
|
880
|
+
**Complete reference for all SecureNow environment variables.** 🎯
|