securenow 7.6.7 → 7.6.8

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.
Files changed (67) hide show
  1. package/NPM_README.md +13 -13
  2. package/README.md +21 -37
  3. package/app-config.js +5 -3
  4. package/cli/config.js +4 -3
  5. package/cli/diagnostics.js +54 -15
  6. package/cli/run.js +40 -11
  7. package/firewall-only.js +1 -1
  8. package/mcp/catalog.js +1 -1
  9. package/nextjs-webpack-config.js +3 -15
  10. package/nextjs.js +21 -23
  11. package/nuxt-server-plugin.mjs +20 -10
  12. package/package.json +33 -34
  13. package/register.js +1 -1
  14. package/tracing.js +17 -7
  15. package/web-vite.mjs +23 -13
  16. package/CONSUMING-APPS-GUIDE.md +0 -463
  17. package/docs/ALL-FRAMEWORKS-QUICKSTART.md +0 -1388
  18. package/docs/API-KEYS-GUIDE.md +0 -278
  19. package/docs/ARCHITECTURE.md +0 -408
  20. package/docs/AUTO-BODY-CAPTURE.md +0 -412
  21. package/docs/AUTO-SETUP-SUMMARY.md +0 -331
  22. package/docs/AUTO-SETUP.md +0 -419
  23. package/docs/AUTOMATIC-IP-CAPTURE.md +0 -359
  24. package/docs/BODY-CAPTURE-FIX.md +0 -261
  25. package/docs/BODY-CAPTURE-QUICKSTART.md +0 -147
  26. package/docs/CHANGELOG-NEXTJS.md +0 -235
  27. package/docs/COMPLETION-REPORT.md +0 -408
  28. package/docs/CUSTOMER-GUIDE.md +0 -364
  29. package/docs/EASIEST-SETUP.md +0 -342
  30. package/docs/ENVIRONMENT-VARIABLES.md +0 -166
  31. package/docs/ENVIRONMENTS.md +0 -60
  32. package/docs/EXPRESS-BODY-CAPTURE.md +0 -1028
  33. package/docs/EXPRESS-SETUP-GUIDE.md +0 -722
  34. package/docs/FINAL-SOLUTION.md +0 -335
  35. package/docs/FIREWALL-GUIDE.md +0 -440
  36. package/docs/IMPLEMENTATION-SUMMARY.md +0 -410
  37. package/docs/INDEX.md +0 -222
  38. package/docs/LOGGING-GUIDE.md +0 -704
  39. package/docs/LOGGING-QUICKSTART.md +0 -221
  40. package/docs/MCP-GUIDE.md +0 -58
  41. package/docs/NEXTJS-BODY-CAPTURE-COMPARISON.md +0 -323
  42. package/docs/NEXTJS-BODY-CAPTURE.md +0 -368
  43. package/docs/NEXTJS-GUIDE.md +0 -392
  44. package/docs/NEXTJS-QUICKSTART.md +0 -83
  45. package/docs/NEXTJS-SETUP-COMPLETE.md +0 -795
  46. package/docs/NEXTJS-WEBPACK-WARNINGS.md +0 -267
  47. package/docs/NEXTJS-WRAPPER-APPROACH.md +0 -414
  48. package/docs/NUXT-GUIDE.md +0 -173
  49. package/docs/QUICKSTART-BODY-CAPTURE.md +0 -293
  50. package/docs/REDACTION-EXAMPLES.md +0 -484
  51. package/docs/REQUEST-BODY-CAPTURE.md +0 -587
  52. package/docs/SOLUTION-SUMMARY.md +0 -312
  53. package/docs/VERCEL-OTEL-MIGRATION.md +0 -255
  54. package/examples/README.md +0 -265
  55. package/examples/express-with-logging.js +0 -137
  56. package/examples/instrumentation-with-auto-capture.ts +0 -41
  57. package/examples/next.config.js +0 -37
  58. package/examples/nextjs-api-route-with-body-capture.ts +0 -54
  59. package/examples/nextjs-env-example.txt +0 -32
  60. package/examples/nextjs-instrumentation.js +0 -36
  61. package/examples/nextjs-instrumentation.ts +0 -36
  62. package/examples/nextjs-middleware.js +0 -37
  63. package/examples/nextjs-middleware.ts +0 -37
  64. package/examples/nextjs-with-logging-example.md +0 -301
  65. package/examples/nextjs-with-options.ts +0 -36
  66. package/examples/test-nextjs-setup.js +0 -70
  67. package/postinstall.js +0 -296
@@ -1,166 +0,0 @@
1
- # SecureNow Credentials Reference
2
-
3
- SecureNow uses `.securenow/credentials.json` in local development and production. No `.env` file is required.
4
-
5
- ```bash
6
- npx securenow login
7
- npx securenow init
8
- ```
9
-
10
- `login` writes the selected app, collector instance, CLI token, and firewall key to `./.securenow/credentials.json`. `init` ensures that file also contains secure defaults and an `_securenow.explanations` block for end users. Keep `.securenow/` in `.gitignore`.
11
-
12
- ## Production Runtime File
13
-
14
- Production should use the same file structure, but without the CLI OAuth fields. From a logged-in project:
15
-
16
- ```bash
17
- npx securenow credentials runtime --env production
18
- ```
19
-
20
- This writes:
21
-
22
- ```text
23
- .securenow/credentials.production.json
24
- ```
25
-
26
- Deploy that JSON as a secret file and mount or copy it to:
27
-
28
- ```text
29
- <app-root>/.securenow/credentials.json
30
- ```
31
-
32
- The runtime file contains `apiKey`, `app`, `config`, and `_securenow.explanations`; it intentionally omits `token`, `email`, and `expiresAt`.
33
-
34
- ## Resolution Order
35
-
36
- 1. Project `./.securenow/credentials.json`
37
- 2. Global `~/.securenow/credentials.json`
38
- 3. `package.json#name` where a human-readable fallback label is useful
39
- 4. Built-in secure default
40
-
41
- Legacy environment variables are fallback-only for existing deployments. New local, CI, Docker, and production setups should use the credentials file.
42
-
43
- ## Credentials File Shape
44
-
45
- ```json
46
- {
47
- "apiKey": "snk_live_...",
48
- "app": {
49
- "key": "<secure-now-app-uuid>",
50
- "name": "my-app",
51
- "instance": "https://freetrial.securenow.ai:4318"
52
- },
53
- "config": {
54
- "logging": { "enabled": true },
55
- "capture": {
56
- "body": true,
57
- "multipart": true,
58
- "maxBodySize": 10240,
59
- "sensitiveFields": []
60
- },
61
- "otel": {
62
- "endpoint": null,
63
- "tracesEndpoint": null,
64
- "logsEndpoint": null,
65
- "headers": {},
66
- "logLevel": "none",
67
- "disableInstrumentations": []
68
- },
69
- "runtime": {
70
- "deploymentEnvironment": "production",
71
- "noUuid": null,
72
- "strict": false,
73
- "testSpan": false,
74
- "hideBanner": false
75
- },
76
- "firewall": {
77
- "enabled": true,
78
- "apiUrl": "https://api.securenow.ai",
79
- "versionCheckInterval": 10,
80
- "syncInterval": 300,
81
- "failMode": "open",
82
- "statusCode": 403,
83
- "log": true,
84
- "tcp": false,
85
- "iptables": false,
86
- "cloud": null,
87
- "cloudDryRun": false,
88
- "cloudflare": {
89
- "apiToken": null,
90
- "accountId": null
91
- },
92
- "aws": {
93
- "wafIpSetId": null,
94
- "wafIpSetName": "securenow-blocklist",
95
- "wafScope": "REGIONAL"
96
- },
97
- "gcp": {
98
- "projectId": null,
99
- "securityPolicy": null
100
- }
101
- },
102
- "networking": {
103
- "trustedProxies": []
104
- }
105
- }
106
- }
107
- ```
108
-
109
- ## Credentials Keys
110
-
111
- | Credentials path | Default | Notes |
112
- |---|---|---|
113
- | `app.key` | package name fallback | SecureNow app routing UUID / OTel service name. |
114
- | `app.name` | package name fallback | Human-readable app name. |
115
- | `app.instance` | `https://freetrial.securenow.ai:4318` | OTLP base endpoint. |
116
- | `apiKey` | `null` | `snk_live_...` firewall sync key. |
117
- | `config.otel.endpoint` | app instance | Optional OTLP base endpoint override. |
118
- | `config.otel.tracesEndpoint` | `{instance}/v1/traces` | Full traces endpoint. |
119
- | `config.otel.logsEndpoint` | `{instance}/v1/logs` | Full logs endpoint. |
120
- | `config.otel.headers` | auto `x-api-key=<app.key>` | Extra OTLP headers as an object. |
121
- | `config.otel.logLevel` | `none` | `none`, `error`, `warn`, `info`, or `debug`. |
122
- | `config.otel.disableInstrumentations` | `[]` | OTel instrumentation package names to skip. |
123
- | `config.logging.enabled` | `true` | Console log forwarding. |
124
- | `config.capture.body` | `true` | JSON, GraphQL, and form body capture. |
125
- | `config.capture.multipart` | `true` | Multipart text fields and file metadata; never file content. |
126
- | `config.capture.maxBodySize` | `10240` | Bytes captured per request body. |
127
- | `config.capture.sensitiveFields` | `[]` | Extra redaction field fragments. |
128
- | `config.runtime.deploymentEnvironment` | `production` | Sent as `deployment.environment`. |
129
- | `config.runtime.noUuid` | auto | Auto is true when an app key is present. |
130
- | `config.runtime.strict` | `false` | Exit clustered workers when no app identity resolves. |
131
- | `config.runtime.testSpan` | `false` | Prefer `npx securenow test-span` for manual checks. |
132
- | `config.runtime.hideBanner` | `false` | Hide free-trial response banner. |
133
- | `config.firewall.enabled` | `true` | Local SDK firewall switch. Leave absent/true for protection; set false only when intentionally disabling in this credentials file. Dashboard app toggle also applies. |
134
- | `config.firewall.apiUrl` | `https://api.securenow.ai` | SecureNow API base URL. |
135
- | `config.firewall.versionCheckInterval` | `10` | Seconds between lightweight version checks. |
136
- | `config.firewall.syncInterval` | `300` | Seconds between full blocklist syncs. |
137
- | `config.firewall.failMode` | `open` | `open` or `closed`. |
138
- | `config.firewall.statusCode` | `403` | HTTP status for blocked requests. |
139
- | `config.firewall.log` | `true` | Log firewall decisions locally. |
140
- | `config.firewall.tcp` | `false` | Opt-in Layer 2 TCP drop. |
141
- | `config.firewall.iptables` | `false` | Opt-in Linux iptables/nftables drop. |
142
- | `config.firewall.cloud` | `null` | `cloudflare`, `aws`, or `gcp`. |
143
- | `config.firewall.cloudDryRun` | `false` | Preview cloud WAF pushes. |
144
- | `config.firewall.cloudflare.apiToken` | `null` | Cloudflare Layer 4 WAF credential. |
145
- | `config.firewall.cloudflare.accountId` | `null` | Cloudflare account id. |
146
- | `config.firewall.aws.wafIpSetId` | `null` | AWS WAF IP set id. |
147
- | `config.firewall.aws.wafIpSetName` | `securenow-blocklist` | AWS WAF IP set name. |
148
- | `config.firewall.aws.wafScope` | `REGIONAL` | AWS WAF scope. |
149
- | `config.firewall.gcp.projectId` | `null` | GCP project id. |
150
- | `config.firewall.gcp.securityPolicy` | `null` | GCP Cloud Armor policy. |
151
- | `config.networking.trustedProxies` | `[]` | Additional proxy IPs trusted for `X-Forwarded-For`. |
152
-
153
- ## Common Edits
154
-
155
- ```json
156
- {
157
- "config": {
158
- "capture": {
159
- "maxBodySize": 20480,
160
- "sensitiveFields": ["session_id", "internal_token"]
161
- },
162
- "logging": { "enabled": false },
163
- "firewall": { "failMode": "closed" }
164
- }
165
- }
166
- ```
@@ -1,60 +0,0 @@
1
- # SecureNow Environments
2
-
3
- SecureNow uses one app id for one application, then separates data by deployment environment.
4
-
5
- ## Recommended Model
6
-
7
- - Use the same `app.key` for local, preview, staging, and production.
8
- - Set `config.runtime.deploymentEnvironment` in `.securenow/credentials.json`.
9
- - Default local setup writes `local`.
10
- - Production runtime credentials should write `production`.
11
- - The SDK sends this value as the OpenTelemetry `deployment.environment` resource attribute.
12
- - The firewall sync sends the same environment to SecureNow so app firewall settings can differ per environment.
13
-
14
- Example local file:
15
-
16
- ```json
17
- {
18
- "app": {
19
- "key": "00000000-0000-0000-0000-000000000000",
20
- "name": "my-app",
21
- "instance": "https://freetrial.securenow.ai:4318"
22
- },
23
- "config": {
24
- "runtime": {
25
- "deploymentEnvironment": "local"
26
- }
27
- }
28
- }
29
- ```
30
-
31
- Example production flow:
32
-
33
- ```bash
34
- npx securenow credentials runtime --env production
35
- ```
36
-
37
- This writes `.securenow/credentials.production.json`. Deploy the generated JSON as a secret file and mount or copy it to:
38
-
39
- ```text
40
- <app-root>/.securenow/credentials.json
41
- ```
42
-
43
- ## Investigation Defaults
44
-
45
- Forensics, firewall status, and security investigation tools default to `production`. Use `--env local`, `--env staging`, or `--env all` when you explicitly want another scope.
46
-
47
- ```bash
48
- npx securenow traces --app <app-key> --env production
49
- npx securenow logs --app <app-key> --env local
50
- npx securenow forensics "show suspicious IPs in the last hour" --app <app-key> --env production
51
- npx securenow firewall disable --app <app-key> --env local
52
- ```
53
-
54
- ## Firewall Defaults
55
-
56
- - Production defaults to firewall on.
57
- - Local, preview, staging, and test default to firewall off until explicitly enabled.
58
- - Blocklists and allowlists are still app-scoped, but the app firewall toggle and threshold are environment-scoped.
59
-
60
- This keeps local development friction low while preserving production as the primary security boundary.