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
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SecureNow
|
|
2
2
|
|
|
3
|
-
OpenTelemetry instrumentation for Node.js
|
|
3
|
+
OpenTelemetry instrumentation for Node.js, Next.js, and Nuxt applications - send **traces and logs** to any OTLP-compatible backend (including SecureNow).
|
|
4
4
|
|
|
5
5
|
**Official npm package:** [securenow](http://securenow.ai/)
|
|
6
6
|
|
|
@@ -8,73 +8,152 @@ OpenTelemetry instrumentation for Node.js and Next.js applications - send **trac
|
|
|
8
8
|
|
|
9
9
|
## 🚀 Quick Start
|
|
10
10
|
|
|
11
|
-
### For
|
|
12
|
-
|
|
13
|
-
**The easiest way to add observability to Next.js!**
|
|
11
|
+
### For Any Node.js App (Express, Fastify, NestJS, Koa, Hapi, etc.)
|
|
14
12
|
|
|
15
13
|
```bash
|
|
16
|
-
#
|
|
14
|
+
# 1. Install
|
|
17
15
|
npm install securenow
|
|
16
|
+
|
|
17
|
+
# 2. Set env vars
|
|
18
|
+
export SECURENOW_APPID=my-app
|
|
19
|
+
export SECURENOW_INSTANCE=https://freetrial.securenow.ai:4318
|
|
20
|
+
|
|
21
|
+
# 3. Add -r securenow/register to your start command
|
|
22
|
+
node -r securenow/register src/app.js
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
That's it. One `-r` flag is all you need — ESM and CJS apps are handled automatically (Node >=20.6 auto-registers the ESM loader hook).
|
|
26
|
+
|
|
27
|
+
> **package.json** example:
|
|
28
|
+
> ```json
|
|
29
|
+
> "scripts": {
|
|
30
|
+
> "start": "node -r securenow/register src/index.js",
|
|
31
|
+
> "dev": "node -r securenow/register --watch src/index.js"
|
|
32
|
+
> }
|
|
33
|
+
> ```
|
|
34
|
+
|
|
35
|
+
You can also use `NODE_OPTIONS` so your existing scripts stay unchanged:
|
|
36
|
+
```bash
|
|
37
|
+
NODE_OPTIONS="-r securenow/register" npm start
|
|
18
38
|
```
|
|
19
39
|
|
|
20
|
-
|
|
21
|
-
- Detect your Next.js project
|
|
22
|
-
- Create `instrumentation.ts` (or `.js`)
|
|
23
|
-
- Create `.env.local` template
|
|
40
|
+
See the [All Frameworks Quick Start](./docs/ALL-FRAMEWORKS-QUICKSTART.md) for tested setup guides.
|
|
24
41
|
|
|
25
|
-
|
|
42
|
+
---
|
|
26
43
|
|
|
27
|
-
|
|
44
|
+
### For Next.js Applications
|
|
28
45
|
|
|
29
46
|
```bash
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
# 1. Install
|
|
48
|
+
npm install securenow
|
|
49
|
+
|
|
50
|
+
# 2. Auto-scaffold instrumentation files
|
|
51
|
+
npx securenow init --key snk_live_abc123...
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This creates `instrumentation.ts` and tells you to wrap your `next.config.js`:
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
// next.config.js
|
|
58
|
+
const { withSecureNow } = require('securenow/nextjs-webpack-config');
|
|
59
|
+
|
|
60
|
+
module.exports = withSecureNow({
|
|
61
|
+
// your existing config
|
|
62
|
+
});
|
|
32
63
|
```
|
|
33
64
|
|
|
34
|
-
|
|
65
|
+
`withSecureNow()` auto-detects Next.js 14 vs 15 and sets the correct externalization config. No manual `serverExternalPackages` list needed.
|
|
66
|
+
|
|
67
|
+
Configure `.env.local`:
|
|
68
|
+
|
|
35
69
|
```bash
|
|
36
|
-
|
|
70
|
+
SECURENOW_APPID=my-nextjs-app
|
|
71
|
+
SECURENOW_INSTANCE=http://your-otlp-collector:4318
|
|
72
|
+
SECURENOW_API_KEY=snk_live_abc123...
|
|
37
73
|
```
|
|
38
74
|
|
|
39
|
-
**Done!**
|
|
75
|
+
**Done!** See [Next.js Complete Guide](./docs/NEXTJS-GUIDE.md) for details.
|
|
40
76
|
|
|
41
77
|
---
|
|
42
78
|
|
|
43
|
-
### For
|
|
44
|
-
|
|
45
|
-
#### Tracing Only
|
|
79
|
+
### For Nuxt 3 Applications
|
|
46
80
|
|
|
47
81
|
```bash
|
|
48
82
|
# 1. Install
|
|
49
83
|
npm install securenow
|
|
84
|
+
```
|
|
50
85
|
|
|
51
|
-
|
|
52
|
-
export SECURENOW_APPID=my-app
|
|
53
|
-
export SECURENOW_INSTANCE=http://your-signoz-server:4318
|
|
86
|
+
Add the module to your `nuxt.config.ts`:
|
|
54
87
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
88
|
+
```ts
|
|
89
|
+
export default defineNuxtConfig({
|
|
90
|
+
modules: ['securenow/nuxt'],
|
|
91
|
+
});
|
|
59
92
|
```
|
|
60
93
|
|
|
61
|
-
|
|
94
|
+
Set environment variables in `.env`:
|
|
62
95
|
|
|
63
96
|
```bash
|
|
64
|
-
|
|
65
|
-
|
|
97
|
+
SECURENOW_APPID=my-nuxt-app
|
|
98
|
+
SECURENOW_INSTANCE=https://freetrial.securenow.ai:4318
|
|
99
|
+
```
|
|
66
100
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
101
|
+
**Done!** All server-side requests are now traced automatically. The firewall also activates automatically when `SECURENOW_API_KEY` is set. See the [Nuxt 3 Complete Guide](./docs/NUXT-GUIDE.md) for details.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### CLI -- Manage Everything from the Terminal
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Set up your project (auto-detects framework, creates instrumentation files)
|
|
109
|
+
npx securenow init --key snk_live_abc123...
|
|
110
|
+
|
|
111
|
+
# Authenticate
|
|
112
|
+
npx securenow login
|
|
113
|
+
|
|
114
|
+
# Create an app and get the key
|
|
115
|
+
npx securenow apps create my-app
|
|
116
|
+
|
|
117
|
+
# Set it as default so you don't need --app every time
|
|
118
|
+
npx securenow config set defaultApp <key>
|
|
71
119
|
|
|
72
|
-
#
|
|
73
|
-
|
|
120
|
+
# View traces, logs
|
|
121
|
+
npx securenow traces
|
|
122
|
+
npx securenow logs
|
|
74
123
|
|
|
75
|
-
#
|
|
124
|
+
# IP intelligence, forensic queries, blocklist
|
|
125
|
+
npx securenow ip 1.2.3.4
|
|
126
|
+
npx securenow forensics "show top attacking IPs in the last hour"
|
|
127
|
+
npx securenow blocklist add 1.2.3.4 --reason "scanner"
|
|
128
|
+
|
|
129
|
+
# Firewall — automatic IP blocking
|
|
130
|
+
npx securenow firewall status
|
|
131
|
+
npx securenow firewall test-ip 1.2.3.4
|
|
132
|
+
|
|
133
|
+
# False-positive triage from the terminal (full parity with the dashboard)
|
|
134
|
+
npx securenow fp ai-fill --description "Stripe webhook POST to /api/stripe/webhook"
|
|
135
|
+
npx securenow fp mark <notification-id> <ip> --reason "Known partner IP"
|
|
136
|
+
|
|
137
|
+
# Telemetry from scripts/CI — no SDK boot required
|
|
138
|
+
npx securenow log send "Deploy succeeded" --level info --attrs version=1.2.3
|
|
139
|
+
npx securenow test-span # verify collector connectivity
|
|
140
|
+
|
|
141
|
+
# Diagnostics & utilities
|
|
142
|
+
npx securenow doctor # probe OTLP + API endpoints
|
|
143
|
+
npx securenow env # show resolved config
|
|
144
|
+
npx securenow redact '{"user":"a","password":"s"}' # preview redaction
|
|
145
|
+
npx securenow cidr match 10.0.0.5 10.0.0.0/8 # exit 0 = hit, 2 = miss
|
|
146
|
+
|
|
147
|
+
# Full dashboard overview
|
|
148
|
+
npx securenow status
|
|
76
149
|
```
|
|
77
150
|
|
|
151
|
+
Run `npx securenow help` for all commands. See the [CLI Reference](#cli-reference) below.
|
|
152
|
+
|
|
153
|
+
> **Full CLI/SDK parity (v6.1.0+).** Every SDK export has a CLI counterpart: `redactSensitiveData` → `securenow redact`, `createMatcher` → `securenow cidr match`, `getLogger().emit()` → `securenow log send`, `SECURENOW_TEST_SPAN` → `securenow test-span`, `node -r securenow/firewall-only` → `securenow run --firewall-only`.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
78
157
|
---
|
|
79
158
|
|
|
80
159
|
## 📦 Installation
|
|
@@ -97,9 +176,9 @@ pnpm add securenow
|
|
|
97
176
|
# Required: Your application identifier
|
|
98
177
|
SECURENOW_APPID=my-app-name
|
|
99
178
|
|
|
100
|
-
# Optional: Your
|
|
179
|
+
# Optional: Your OTLP collector endpoint
|
|
101
180
|
# Default: https://freetrial.securenow.ai:4318
|
|
102
|
-
SECURENOW_INSTANCE=http://your-
|
|
181
|
+
SECURENOW_INSTANCE=http://your-otlp-collector:4318
|
|
103
182
|
|
|
104
183
|
# Optional: Enable Logging
|
|
105
184
|
SECURENOW_LOGGING_ENABLED=1 # Enable automatic log collection
|
|
@@ -114,6 +193,9 @@ OTEL_EXPORTER_OTLP_HEADERS="x-api-key=..." # Authentication headers
|
|
|
114
193
|
SECURENOW_CAPTURE_BODY=1 # Capture request bodies in traces
|
|
115
194
|
SECURENOW_MAX_BODY_SIZE=10240 # Max body size in bytes
|
|
116
195
|
SECURENOW_SENSITIVE_FIELDS="field1,field2" # Additional fields to redact
|
|
196
|
+
|
|
197
|
+
# Optional: Multipart body capture (file upload metadata)
|
|
198
|
+
SECURENOW_CAPTURE_MULTIPART=1 # Capture multipart field names, values & file metadata
|
|
117
199
|
```
|
|
118
200
|
|
|
119
201
|
### Legacy Environment Variables (still supported)
|
|
@@ -131,6 +213,7 @@ SecureNow automatically instruments:
|
|
|
131
213
|
|
|
132
214
|
### Web Frameworks
|
|
133
215
|
- ✅ Next.js (App Router & Pages Router)
|
|
216
|
+
- ✅ Nuxt 3 (Nitro server)
|
|
134
217
|
- ✅ Express.js
|
|
135
218
|
- ✅ Fastify
|
|
136
219
|
- ✅ NestJS
|
|
@@ -161,10 +244,14 @@ SecureNow automatically instruments:
|
|
|
161
244
|
|
|
162
245
|
### Quick Starts
|
|
163
246
|
- **[Next.js Quick Start](./docs/NEXTJS-QUICKSTART.md)** - Get started in 30 seconds
|
|
247
|
+
- **[Nuxt 3 Guide](./docs/NUXT-GUIDE.md)** - One-line Nuxt module setup
|
|
164
248
|
- **[Logging Quick Start](./docs/LOGGING-QUICKSTART.md)** - Add logging in 2 minutes
|
|
165
249
|
|
|
166
250
|
### Complete Guides
|
|
251
|
+
- **[Firewall Guide](./docs/FIREWALL-GUIDE.md)** - Automatic multi-layer IP blocking
|
|
252
|
+
- **[API Keys Guide](./docs/API-KEYS-GUIDE.md)** - API key management and scopes
|
|
167
253
|
- **[Next.js Complete Guide](./docs/NEXTJS-GUIDE.md)** - Full Next.js integration guide
|
|
254
|
+
- **[Nuxt 3 Complete Guide](./docs/NUXT-GUIDE.md)** - Full Nuxt 3 integration guide
|
|
168
255
|
- **[Logging Complete Guide](./docs/LOGGING-GUIDE.md)** - Full logging setup for all frameworks
|
|
169
256
|
- **[📚 Complete Documentation](./docs/INDEX.md)** - All guides and references
|
|
170
257
|
|
|
@@ -173,7 +260,177 @@ SecureNow automatically instruments:
|
|
|
173
260
|
|
|
174
261
|
---
|
|
175
262
|
|
|
176
|
-
##
|
|
263
|
+
## CLI Reference
|
|
264
|
+
|
|
265
|
+
After installing the package, the `securenow` CLI is available via `npx securenow` or globally after `npm install -g securenow`.
|
|
266
|
+
|
|
267
|
+
### Run (convenience wrapper)
|
|
268
|
+
|
|
269
|
+
| Command | Description |
|
|
270
|
+
|---------|-------------|
|
|
271
|
+
| `securenow run <script>` | Run a Node.js app with `-r securenow/register` injected |
|
|
272
|
+
| `securenow run --watch <script>` | Same, with Node.js watch mode |
|
|
273
|
+
|
|
274
|
+
Most users won't need this — just add `-r securenow/register` to your existing start script.
|
|
275
|
+
|
|
276
|
+
### Authentication
|
|
277
|
+
|
|
278
|
+
| Command | Description |
|
|
279
|
+
|---------|-------------|
|
|
280
|
+
| `securenow login` | Log in via browser (opens OAuth flow) |
|
|
281
|
+
| `securenow login --token <TOKEN>` | Log in with a token (for CI/headless) |
|
|
282
|
+
| `securenow login --local` | Log in and save credentials to the current project only |
|
|
283
|
+
| `securenow logout` | Clear stored credentials |
|
|
284
|
+
| `securenow logout --local` | Clear project-local credentials only |
|
|
285
|
+
| `securenow whoami` | Show current session info (including auth source) |
|
|
286
|
+
|
|
287
|
+
### Applications
|
|
288
|
+
|
|
289
|
+
| Command | Description |
|
|
290
|
+
|---------|-------------|
|
|
291
|
+
| `securenow apps` | List all applications |
|
|
292
|
+
| `securenow apps create <name>` | Create app and get the app key |
|
|
293
|
+
| `securenow apps info <id>` | Show application details |
|
|
294
|
+
| `securenow apps delete <id>` | Delete an application |
|
|
295
|
+
| `securenow apps default <key>` | Set default app for all commands |
|
|
296
|
+
|
|
297
|
+
### Observability
|
|
298
|
+
|
|
299
|
+
| Command | Description |
|
|
300
|
+
|---------|-------------|
|
|
301
|
+
| `securenow traces --app <key>` | List recent traces |
|
|
302
|
+
| `securenow traces show <traceId>` | Show trace spans |
|
|
303
|
+
| `securenow traces analyze <traceId>` | AI security analysis of a trace |
|
|
304
|
+
| `securenow logs --app <key>` | View logs (with `--minutes`, `--level`) |
|
|
305
|
+
| `securenow logs trace <traceId>` | View logs for a specific trace |
|
|
306
|
+
| `securenow analytics` | Response code analytics overview |
|
|
307
|
+
| `securenow status` | Full dashboard summary |
|
|
308
|
+
|
|
309
|
+
### Detect & Respond
|
|
310
|
+
|
|
311
|
+
| Command | Description |
|
|
312
|
+
|---------|-------------|
|
|
313
|
+
| `securenow notifications` | List notifications |
|
|
314
|
+
| `securenow notifications unread` | Show unread count |
|
|
315
|
+
| `securenow notifications read <id>` | Mark notification as read |
|
|
316
|
+
| `securenow notifications read-all` | Mark all as read |
|
|
317
|
+
| `securenow alerts rules` | List alert rules (status, applications, schedule) |
|
|
318
|
+
| `securenow alerts rules show <id>` | Show one rule (includes all-apps vs explicit apps) |
|
|
319
|
+
| `securenow alerts rules update <id> --applications-all` | Set rule to all current & future apps |
|
|
320
|
+
| `securenow alerts rules update <id> --apps k1,k2` | Scope rule to specific app keys |
|
|
321
|
+
| `securenow alerts channels` | List alert channels |
|
|
322
|
+
| `securenow alerts history` | View alert history |
|
|
323
|
+
|
|
324
|
+
### Investigate
|
|
325
|
+
|
|
326
|
+
| Command | Description |
|
|
327
|
+
|---------|-------------|
|
|
328
|
+
| `securenow ip <address>` | IP intelligence lookup (geo, abuse score, verdict) |
|
|
329
|
+
| `securenow ip traces <address>` | Show traces originating from an IP |
|
|
330
|
+
| `securenow forensics "<query>"` | Natural language forensic query (NL to SQL) |
|
|
331
|
+
| `securenow forensics library` | View saved query library |
|
|
332
|
+
| `securenow api-map` | View discovered API endpoints |
|
|
333
|
+
| `securenow api-map stats` | API map statistics |
|
|
334
|
+
|
|
335
|
+
### Firewall
|
|
336
|
+
|
|
337
|
+
| Command | Description |
|
|
338
|
+
|---------|-------------|
|
|
339
|
+
| `securenow firewall status` | Show firewall status, active layers, and API key info |
|
|
340
|
+
| `securenow firewall test-ip <ip>` | Check if an IP would be blocked by the current blocklist |
|
|
341
|
+
| `securenow run --firewall-only <script>` | Run a Node.js app with the firewall preloaded but **no** OTel tracing overhead |
|
|
342
|
+
|
|
343
|
+
### Remediation
|
|
344
|
+
|
|
345
|
+
| Command | Description |
|
|
346
|
+
|---------|-------------|
|
|
347
|
+
| `securenow blocklist` | List blocked IPs |
|
|
348
|
+
| `securenow blocklist add <ip>` | Block an IP (`--reason <reason>`) |
|
|
349
|
+
| `securenow blocklist remove <id>` | Remove from blocklist |
|
|
350
|
+
| `securenow blocklist stats` | Blocklist statistics |
|
|
351
|
+
| `securenow allowlist` | List allowed IPs (restrict-mode) |
|
|
352
|
+
| `securenow allowlist add <ip>` | Allow an IP (`--label`, `--reason`) |
|
|
353
|
+
| `securenow allowlist remove <id>` | Remove from allowlist |
|
|
354
|
+
| `securenow trusted` | List trusted IPs |
|
|
355
|
+
| `securenow trusted add <ip>` | Add trusted IP (`--label <label>`) |
|
|
356
|
+
| `securenow trusted remove <id>` | Remove trusted IP |
|
|
357
|
+
|
|
358
|
+
### False-Positive Management
|
|
359
|
+
|
|
360
|
+
Full false-positive triage without leaving the terminal — mirrors the web dashboard one-for-one.
|
|
361
|
+
|
|
362
|
+
| Command | Description |
|
|
363
|
+
|---------|-------------|
|
|
364
|
+
| `securenow fp` / `securenow fp list` | List all exclusion rules |
|
|
365
|
+
| `securenow fp show <id>` | Show rule details (conditions, scope, match mode) |
|
|
366
|
+
| `securenow fp create --conditions '[...]'` | Create a raw exclusion rule |
|
|
367
|
+
| `securenow fp create --path /api/events --method POST --path-safe standard --ua-safe standard --reason "..."` | Create with safe-value presets |
|
|
368
|
+
| `securenow fp edit <id> [--active true\|false] [--conditions '[...]']` | Edit an existing rule |
|
|
369
|
+
| `securenow fp delete <id> [--yes]` | Delete a rule |
|
|
370
|
+
| `securenow fp test-body '<json>' --conditions '[...]'` | Test conditions against a request body |
|
|
371
|
+
| `securenow fp dry-run --conditions '[...]'` | Dry-run against the last 3 days of live traces |
|
|
372
|
+
| `securenow fp ai-fill --description "Stripe webhook POST to /api/stripe/webhook"` | AI-generate exclusion conditions |
|
|
373
|
+
| `securenow fp mark <notification-id> <ip>` | Mark an IP as false positive on a specific notification |
|
|
374
|
+
|
|
375
|
+
### Telemetry
|
|
376
|
+
|
|
377
|
+
Emit OTLP logs and spans from the shell — for cron jobs, CI pipelines, and scripts. No SDK boot required.
|
|
378
|
+
|
|
379
|
+
| Command | Description |
|
|
380
|
+
|---------|-------------|
|
|
381
|
+
| `securenow log send "<message>" [--level info\|warn\|error] [--attrs k=v,k=v]` | Send a single log record via OTLP/HTTP |
|
|
382
|
+
| `securenow test-span [<name>]` | Emit a test span to verify collector connectivity |
|
|
383
|
+
|
|
384
|
+
### Utilities
|
|
385
|
+
|
|
386
|
+
SDK helpers surfaced as CLI commands — debug redaction, test CIDR matching, inspect config without writing Node.
|
|
387
|
+
|
|
388
|
+
| Command | Description |
|
|
389
|
+
|---------|-------------|
|
|
390
|
+
| `securenow redact '<json>' [--fields f1,f2]` | Redact sensitive fields (also accepts `@file.json`) |
|
|
391
|
+
| `securenow cidr match <ip> <cidr1,cidr2>` | Check if an IP matches a CIDR list (exit `0` hit / `2` miss) |
|
|
392
|
+
| `securenow cidr parse <cidr>` | Parse a CIDR — print network, broadcast, mask, size |
|
|
393
|
+
| `securenow env [--json]` | Show resolved config (service name, endpoints, env vars) |
|
|
394
|
+
| `securenow doctor [--json]` | End-to-end diagnostic: probe OTLP + API, check config |
|
|
395
|
+
|
|
396
|
+
### Settings
|
|
397
|
+
|
|
398
|
+
| Command | Description |
|
|
399
|
+
|---------|-------------|
|
|
400
|
+
| `securenow instances` | List ClickHouse instances |
|
|
401
|
+
| `securenow instances test <id>` | Test instance connection |
|
|
402
|
+
| `securenow config get` | Show all config values |
|
|
403
|
+
| `securenow config set <key> <value>` | Set a config value |
|
|
404
|
+
| `securenow config path` | Show config file locations |
|
|
405
|
+
| `securenow init [--key <KEY>]` | Auto-scaffold instrumentation for your framework |
|
|
406
|
+
| `securenow version` | Show CLI version |
|
|
407
|
+
|
|
408
|
+
### Global Flags
|
|
409
|
+
|
|
410
|
+
| Flag | Description |
|
|
411
|
+
|------|-------------|
|
|
412
|
+
| `--json` | Output as JSON (works on every command) |
|
|
413
|
+
| `--help` | Show help for any command |
|
|
414
|
+
| `--app <key>` | Specify app key (or set default with `config set defaultApp`) |
|
|
415
|
+
| `--local` | Save/clear credentials per-project (login/logout only) |
|
|
416
|
+
|
|
417
|
+
### Configuration
|
|
418
|
+
|
|
419
|
+
Credentials and settings are stored in `~/.securenow/` (global) or `.securenow/` (per-project):
|
|
420
|
+
|
|
421
|
+
| File | Purpose |
|
|
422
|
+
|------|---------|
|
|
423
|
+
| `~/.securenow/config.json` | API URL, default app, preferences |
|
|
424
|
+
| `~/.securenow/credentials.json` | Auth token — global (restricted permissions) |
|
|
425
|
+
| `.securenow/credentials.json` | Auth token — project-local (use `login --local`) |
|
|
426
|
+
|
|
427
|
+
**Credential resolution order:** `SECURENOW_TOKEN` env var → project `.securenow/credentials.json` → global `~/.securenow/credentials.json`.
|
|
428
|
+
|
|
429
|
+
Override the API URL with `securenow config set apiUrl <url>` or the `SECURENOW_API_URL` environment variable.
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## Support
|
|
177
434
|
|
|
178
435
|
- **Website:** [securenow.ai](http://securenow.ai/)
|
|
179
436
|
- **Issues:** Report bugs and request features
|
|
@@ -181,6 +438,6 @@ SecureNow automatically instruments:
|
|
|
181
438
|
|
|
182
439
|
---
|
|
183
440
|
|
|
184
|
-
##
|
|
441
|
+
## License
|
|
185
442
|
|
|
186
443
|
ISC
|