securenow 7.8.1 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NPM_README.md +14 -19
- package/README.md +11 -11
- package/SKILL-API.md +15 -15
- package/SKILL-CLI.md +13 -12
- package/app-config.js +12 -145
- package/cli/apiKey.js +22 -6
- package/cli/auth.js +4 -4
- package/cli/config.js +3 -10
- package/cli/credentials.js +2 -2
- package/cli/diagnostics.js +2 -2
- package/cli/human.js +13 -8
- package/cli/run.js +1 -5
- package/cli/utils.js +2 -3
- package/cli.js +13 -15
- package/console-instrumentation.js +1 -1
- package/firewall-only.js +4 -7
- package/mcp/catalog.js +540 -16
- package/mcp/server.js +1 -1
- package/nextjs-auto-capture.js +3 -6
- package/nextjs-middleware.js +2 -4
- package/nextjs-wrapper.js +3 -6
- package/nextjs.js +0 -10
- package/package.json +2 -3
- package/rate-limits.js +0 -2
- package/register-vite.js +5 -12
- package/register.js +5 -13
- package/resolve-ip.js +1 -1
- package/tracing.d.ts +1 -1
- package/tracing.js +2 -2
- package/web-vite.mjs +58 -62
package/NPM_README.md
CHANGED
|
@@ -17,7 +17,7 @@ OpenTelemetry instrumentation library for Node.js, Next.js, and Nuxt application
|
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
> **
|
|
20
|
+
> **v8.0 credential model:** admin/control-plane CLI and MCP auth lives in `.securenow/admin.json`; SDK runtime app config and the runtime API key live in `.securenow/runtime.json`. `npx securenow login` can run both lanes for onboarding, `npx securenow admin login` refreshes only admin auth, and `npx securenow app connect` refreshes only runtime app config. Legacy combined `.securenow/credentials.json` files are still read, and production runtime exports can still be mounted as `.securenow/credentials.json`.
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
@@ -92,7 +92,7 @@ This detects your framework and:
|
|
|
92
92
|
|
|
93
93
|
#### Configure Locally
|
|
94
94
|
|
|
95
|
-
Run `npx securenow app connect` to write `.securenow/runtime.json`. The SDK reads app identity,
|
|
95
|
+
Run `npx securenow app connect` to write `.securenow/runtime.json`. The SDK reads app identity, runtime API key, logging/body-capture defaults, and firewall defaults from that file at boot. Telemetry uses the default SecureNow ingestion gateway, routes by `app.key`, and authenticates with the runtime API key, so customer credentials do not expose per-instance collector URLs. Production uses the same file shape via `npx securenow credentials runtime --env production`.
|
|
96
96
|
|
|
97
97
|
#### Run Your Application
|
|
98
98
|
|
|
@@ -165,8 +165,8 @@ npx securenow login --global
|
|
|
165
165
|
# Check who you're logged in as (shows auth source)
|
|
166
166
|
npx securenow whoami
|
|
167
167
|
|
|
168
|
-
# Need or already have a
|
|
169
|
-
npx securenow api-key create --name "CLI
|
|
168
|
+
# Need or already have a runtime API key? Create or store it without re-running login:
|
|
169
|
+
npx securenow api-key create --name "CLI runtime"
|
|
170
170
|
npx securenow api-key set snk_live_abc123... # --global for ~/.securenow/
|
|
171
171
|
npx securenow api-key show # masked key + source
|
|
172
172
|
npx securenow api-key clear # remove just the key
|
|
@@ -427,9 +427,9 @@ Config files are stored in `~/.securenow/` (global) or `.securenow/` in the proj
|
|
|
427
427
|
|------|-------------|
|
|
428
428
|
| `~/.securenow/config.json` | API URL, default app, output format |
|
|
429
429
|
| `~/.securenow/admin.json` | Global admin/control-plane CLI and MCP auth |
|
|
430
|
-
| `~/.securenow/runtime.json` | Global SDK runtime app config and
|
|
430
|
+
| `~/.securenow/runtime.json` | Global SDK runtime app config and runtime API key |
|
|
431
431
|
| `.securenow/admin.json` | Project-local admin/control-plane CLI and MCP auth |
|
|
432
|
-
| `.securenow/runtime.json` | Project-local SDK runtime app config and
|
|
432
|
+
| `.securenow/runtime.json` | Project-local SDK runtime app config and runtime API key |
|
|
433
433
|
| `.securenow/credentials.json` | Legacy combined credentials; still read for backward compatibility |
|
|
434
434
|
| `.securenow/credentials.<environment>.json` | Tokenless runtime credentials generated by `credentials runtime --env <environment>`; read in a fixed order, not selected from env vars |
|
|
435
435
|
|
|
@@ -445,17 +445,13 @@ Every command supports these flags:
|
|
|
445
445
|
| `--help` | | Show help for the command |
|
|
446
446
|
| `--app <key>` | | Override the default application key |
|
|
447
447
|
|
|
448
|
-
###
|
|
448
|
+
### CLI Configuration
|
|
449
449
|
|
|
450
450
|
Normal SDK runtime setup uses `.securenow/runtime.json`; admin CLI/MCP auth uses `.securenow/admin.json`.
|
|
451
|
-
|
|
452
|
-
they are not part of the SDK runtime configuration path.
|
|
451
|
+
SecureNow-specific environment overrides are no longer supported by the SDK or CLI.
|
|
453
452
|
|
|
454
453
|
| Override | Description |
|
|
455
454
|
|----------|-------------|
|
|
456
|
-
| `SECURENOW_TOKEN` | Legacy CLI auth override for a single terminal session |
|
|
457
|
-
| `SECURENOW_API_URL` | Legacy CLI API base override for testing |
|
|
458
|
-
| `SECURENOW_DEBUG` | CLI stack traces while debugging |
|
|
459
455
|
| `NO_COLOR` | Disable colored CLI output |
|
|
460
456
|
|
|
461
457
|
### Multi-Project Sessions
|
|
@@ -509,8 +505,8 @@ npx securenow logs --json --level error | jq '.logs'
|
|
|
509
505
|
| | `apps info <id>` | Application details |
|
|
510
506
|
| | `apps delete <id>` | Delete application |
|
|
511
507
|
| | `apps default <key>` | Set default app |
|
|
512
|
-
| **API Key** | `api-key create [--name "CLI
|
|
513
|
-
| | `api-key set <snk_live_...> [--global]` | Save
|
|
508
|
+
| **API Key** | `api-key create [--name "CLI runtime"] [--global]` | Mint and save a runtime API key with your logged-in session |
|
|
509
|
+
| | `api-key set <snk_live_...> [--global]` | Save runtime API key to `.securenow/runtime.json` |
|
|
514
510
|
| | `api-key show` | Show masked key + source |
|
|
515
511
|
| | `api-key clear [--global]` | Remove stored key (leaves session/app) |
|
|
516
512
|
| **Observe** | `traces` | List traces |
|
|
@@ -1112,7 +1108,7 @@ npx securenow api-key set snk_live_abc123...
|
|
|
1112
1108
|
npx securenow credentials runtime --env production
|
|
1113
1109
|
```
|
|
1114
1110
|
|
|
1115
|
-
The SDK resolves the
|
|
1111
|
+
The SDK resolves the runtime API key from project `./.securenow/credentials.json`, then project named runtime credentials in the fixed staging/production/preview/local/test/development/dev/prod order, then global `~/.securenow/credentials.json`, then global named runtime credentials in the same fixed order.
|
|
1116
1112
|
|
|
1117
1113
|
On startup, you'll see:
|
|
1118
1114
|
|
|
@@ -1211,7 +1207,7 @@ Use `.securenow/credentials.json` as the source of truth. Run `npx securenow env
|
|
|
1211
1207
|
|----------|-------------|---------|
|
|
1212
1208
|
| `app.key` | App routing UUID. The SecureNow ingestion gateway routes telemetry by this key. | selected during login |
|
|
1213
1209
|
| `app.name` | Human-readable app label. | selected during login |
|
|
1214
|
-
| `apiKey` | Scoped
|
|
1210
|
+
| `apiKey` | Scoped runtime API key (`snk_live_...`) for telemetry ingestion and firewall sync. | minted during login |
|
|
1215
1211
|
| `config.runtime.deploymentEnvironment` | `deployment.environment` trace/log scope. | `local` from init, `production` from runtime credentials |
|
|
1216
1212
|
| `config.logging.enabled` | Automatic console log export. | `true` |
|
|
1217
1213
|
| `config.capture.body` | Request body capture with redaction. | `true` |
|
|
@@ -1222,8 +1218,7 @@ Use `.securenow/credentials.json` as the source of truth. Run `npx securenow env
|
|
|
1222
1218
|
The credentials file is versioned with `_securenow.schemaVersion`. The SDK reads
|
|
1223
1219
|
all runtime settings from this JSON plus built-in defaults. Production should
|
|
1224
1220
|
mount a tokenless runtime credentials file at `.securenow/credentials.json`.
|
|
1225
|
-
|
|
1226
|
-
that explicitly opt in with `SECURENOW_ENABLE_LEGACY_ENV=1`.
|
|
1221
|
+
Environment-variable fallback is not supported.
|
|
1227
1222
|
|
|
1228
1223
|
**Default sensitive fields (auto-redacted):** `password`, `passwd`, `pwd`, `secret`, `token`, `api_key`, `apikey`, `access_token`, `auth`, `credentials`, `mysql_pwd`, `stripeToken`, `card`, `cardnumber`, `ccv`, `cvc`, `cvv`, `ssn`, `pin`
|
|
1229
1224
|
|
|
@@ -1418,7 +1413,7 @@ All request bodies are automatically scanned and sensitive fields are redacted:
|
|
|
1418
1413
|
"config": {
|
|
1419
1414
|
"runtime": { "noUuid": true, "strict": true, "deploymentEnvironment": "production" },
|
|
1420
1415
|
"otel": {
|
|
1421
|
-
"headers": { "x-
|
|
1416
|
+
"headers": { "x-securenow-app-key": "my-production-app" },
|
|
1422
1417
|
"logLevel": "info",
|
|
1423
1418
|
"disableInstrumentations": ["fs", "dns"]
|
|
1424
1419
|
},
|
package/README.md
CHANGED
|
@@ -189,7 +189,7 @@ Resolution order:
|
|
|
189
189
|
6. Global named runtime credentials in the same fixed order
|
|
190
190
|
7. `package.json#name` (label only)
|
|
191
191
|
|
|
192
|
-
SDK runtime config is credentials-json based.
|
|
192
|
+
SDK runtime config is credentials-json based. Environment-variable fallbacks are no longer supported.
|
|
193
193
|
|
|
194
194
|
---
|
|
195
195
|
|
|
@@ -203,8 +203,8 @@ npx securenow app connect # app/runtime SDK connection only
|
|
|
203
203
|
npx securenow admin login --token <TOKEN> # headless admin auth (CI)
|
|
204
204
|
npx securenow init --env local # scaffold framework files + local env scope
|
|
205
205
|
npx securenow credentials runtime --env production # write tokenless production credentials file
|
|
206
|
-
npx securenow api-key create --name "CLI
|
|
207
|
-
npx securenow api-key set snk_live_... # store
|
|
206
|
+
npx securenow api-key create --name "CLI runtime" # mint + store runtime API key
|
|
207
|
+
npx securenow api-key set snk_live_... # store runtime API key in .securenow/runtime.json
|
|
208
208
|
|
|
209
209
|
# Apps
|
|
210
210
|
npx securenow apps # list all apps
|
|
@@ -240,7 +240,7 @@ SecureNow ships a local stdio MCP server for agent clients:
|
|
|
240
240
|
```bash
|
|
241
241
|
npx securenow login
|
|
242
242
|
npx securenow admin login # admin/control-plane only
|
|
243
|
-
npx securenow app connect # runtime app/
|
|
243
|
+
npx securenow app connect # runtime app/API key only
|
|
244
244
|
codex mcp add securenow -- npx securenow mcp
|
|
245
245
|
# or run directly:
|
|
246
246
|
npx -p securenow securenow-mcp
|
|
@@ -258,7 +258,7 @@ Use `.securenow/runtime.json` fields for new local SDK/runtime setups. Productio
|
|
|
258
258
|
|---|---|---|
|
|
259
259
|
| `app.key` | selected during login | App routing UUID; the gateway routes telemetry by this key |
|
|
260
260
|
| `app.name` | selected during login | Human-readable label for CLI and dashboard output |
|
|
261
|
-
| `apiKey` | minted during login | Scoped
|
|
261
|
+
| `apiKey` | minted during login | Scoped runtime API key (`snk_live_...`) for telemetry ingestion and firewall sync |
|
|
262
262
|
| `config.runtime.deploymentEnvironment` | `local` from `init`, `production` from runtime credentials | Sent as OTel `deployment.environment` |
|
|
263
263
|
| `config.logging.enabled` | `true` | Forward `console.*` as OTLP logs |
|
|
264
264
|
| `config.capture.body` | `true` | Capture JSON / form request bodies with redaction |
|
|
@@ -280,8 +280,8 @@ Mount or copy that JSON as `.securenow/credentials.json` in the deployed app.
|
|
|
280
280
|
New runtime credentials do not include a per-instance collector URL; the SDK
|
|
281
281
|
uses `https://ingest.securenow.ai` by default and the gateway routes by
|
|
282
282
|
`app.key`.
|
|
283
|
-
|
|
284
|
-
|
|
283
|
+
Environment-variable fallback is not supported; use runtime credentials files
|
|
284
|
+
for local, staging, preview, and production.
|
|
285
285
|
|
|
286
286
|
---
|
|
287
287
|
|
|
@@ -330,8 +330,8 @@ After install, the `securenow` CLI is available via `npx securenow` or globally
|
|
|
330
330
|
| `securenow logout` | Clear admin auth only; runtime app config stays intact |
|
|
331
331
|
| `securenow logout --global` | Clear ~/.securenow/ instead |
|
|
332
332
|
| `securenow whoami` | Show admin auth and runtime app status separately |
|
|
333
|
-
| `securenow api-key create [--name "CLI
|
|
334
|
-
| `securenow api-key set <snk_live_...>` | Store
|
|
333
|
+
| `securenow api-key create [--name "CLI runtime"]` | Mint and store a runtime API key using your session token |
|
|
334
|
+
| `securenow api-key set <snk_live_...>` | Store runtime API key in `.securenow/runtime.json` (`--global` for `~/.securenow/`) |
|
|
335
335
|
| `securenow api-key show` | Print masked key + source file |
|
|
336
336
|
| `securenow api-key clear` | Remove stored key (`--global` for `~/.securenow/`) |
|
|
337
337
|
|
|
@@ -435,7 +435,7 @@ After install, the `securenow` CLI is available via `npx securenow` or globally
|
|
|
435
435
|
| File | Purpose |
|
|
436
436
|
|---|---|
|
|
437
437
|
| `./.securenow/admin.json` | Project-local admin/control-plane CLI and MCP auth |
|
|
438
|
-
| `./.securenow/runtime.json` | Project-local SDK runtime app config and
|
|
438
|
+
| `./.securenow/runtime.json` | Project-local SDK runtime app config and runtime API key |
|
|
439
439
|
| `./.securenow/credentials.json` | Legacy combined credentials; still read for backward compatibility |
|
|
440
440
|
| `./.securenow/credentials.<environment>.json` | Tokenless runtime file generated by `securenow credentials runtime --env <environment>`; read in a fixed order, not selected from env vars |
|
|
441
441
|
| `~/.securenow/admin.json` | Global admin/control-plane auth |
|
|
@@ -444,7 +444,7 @@ After install, the `securenow` CLI is available via `npx securenow` or globally
|
|
|
444
444
|
| `~/.securenow/credentials.<environment>.json` | Global environment-specific runtime credentials |
|
|
445
445
|
| `~/.securenow/config.json` | API URL, default app, preferences |
|
|
446
446
|
|
|
447
|
-
Runtime resolution order: project `.securenow/runtime.json` -> legacy project `.securenow/credentials.json` -> project named runtime credentials in fixed staging/production/preview/local/test/development/dev/prod order -> global `~/.securenow/runtime.json` -> legacy global credentials -> global named runtime credentials -> package name fallback. Admin auth resolves from `admin.json` first, then legacy `credentials.json`.
|
|
447
|
+
Runtime resolution order: project `.securenow/runtime.json` -> legacy project `.securenow/credentials.json` -> project named runtime credentials in fixed staging/production/preview/local/test/development/dev/prod order -> global `~/.securenow/runtime.json` -> legacy global credentials -> global named runtime credentials -> package name fallback. Admin auth resolves from `admin.json` first, then legacy `credentials.json`. Runtime config is never read from environment variables.
|
|
448
448
|
|
|
449
449
|
Override the dashboard API with `securenow config set apiUrl <url>`.
|
|
450
450
|
|
package/SKILL-API.md
CHANGED
|
@@ -4,7 +4,7 @@ Instrument any Node.js application with OpenTelemetry tracing, structured loggin
|
|
|
4
4
|
|
|
5
5
|
**CLI parity:** every capability exposed below (redaction, CIDR matching, log/span emission, firewall preload, config inspection) has an equivalent `securenow` CLI command. See [SKILL-CLI.md](./SKILL-CLI.md) for the terminal surface.
|
|
6
6
|
|
|
7
|
-
**MCP parity (
|
|
7
|
+
**MCP parity (v8.0+):** `npx securenow mcp` starts a local stdio MCP server for Codex, Claude, and other MCP clients. It reads admin/control-plane auth from `.securenow/admin.json` and SDK runtime app credentials from `.securenow/runtime.json`, with legacy `.securenow/credentials.json` still supported. Alert-rule operators can inspect notifications, read exact `metadata.matchedSubdetectors`, dry-run candidate SQL with `securenow_alert_rule_candidate_test`, and apply global system-rule query fixes with `securenow_alert_rule_query_update` only when the admin user/plan permits it.
|
|
8
8
|
|
|
9
9
|
**Noisy alert-rule reviews:** prefer fixing a generic system-rule detector over creating customer-specific false positives. Dry-run candidate SQL first, preserve tenant scoping with `__USER_APP_KEYS__`, keep exploit-specific indicators, then save the shared query mapping only with an audit reason and explicit confirmation.
|
|
10
10
|
|
|
@@ -28,7 +28,7 @@ node -p "require('./node_modules/securenow/package.json').version"
|
|
|
28
28
|
npx securenow version
|
|
29
29
|
npx securenow login
|
|
30
30
|
npx securenow admin login # admin/control-plane CLI + MCP auth only
|
|
31
|
-
npx securenow app connect # SDK runtime app +
|
|
31
|
+
npx securenow app connect # SDK runtime app + runtime API key only
|
|
32
32
|
npx securenow init
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -60,12 +60,12 @@ Metrics export is off by default. SecureNow sets `OTEL_METRICS_EXPORTER=none` on
|
|
|
60
60
|
|
|
61
61
|
### 3. Firewall Is Enabled by Default
|
|
62
62
|
|
|
63
|
-
Since
|
|
64
|
-
the user picks or creates an app. The
|
|
63
|
+
Since v8.0, the app runtime flow connects the firewall automatically after
|
|
64
|
+
the user picks or creates an app. The runtime API key lives in `.securenow/runtime.json`
|
|
65
65
|
so admin CLI/MCP login cannot overwrite it:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
npx securenow app connect # pick/create app;
|
|
68
|
+
npx securenow app connect # pick/create app; runtime API key is minted automatically
|
|
69
69
|
# or, if you already have one:
|
|
70
70
|
npx securenow api-key set snk_live_abc123...
|
|
71
71
|
```
|
|
@@ -107,7 +107,7 @@ operator needs to ensure those defaults immediately.
|
|
|
107
107
|
| `securenow/nuxt` | Nuxt 3 module (add to `modules` array) | ESM |
|
|
108
108
|
| `securenow/firewall` | Standalone firewall; exports `init()`, `shutdown()`, `getStats()`, `getMatcher()`, `getAllowlistMatcher()` | CJS |
|
|
109
109
|
| `securenow/rate-limits` | Rate-limit remediation API helper; exports `parseRateLimitText()`, `createRateLimitFromText()`, `createRateLimit()`, `listRateLimits()` | CJS |
|
|
110
|
-
| `securenow/firewall-only` | Preload:
|
|
110
|
+
| `securenow/firewall-only` | Preload: credentials-file firewall only, no tracing | Preload (`-r`) |
|
|
111
111
|
| `securenow/cidr` | CIDR utilities; exports `createMatcher()`, `ipToInt()`, `parseCidr()`, `matchesCidr()` | CJS |
|
|
112
112
|
| `securenow/resolve-ip` | IP resolution; exports `resolveClientIp()`, `resolveSocketIp()`, `isFromTrustedProxy()` | CJS |
|
|
113
113
|
| `securenow/console-instrumentation` | Console→OTLP bridge; exports `originalConsole`, `restoreConsole()` | CJS |
|
|
@@ -262,7 +262,7 @@ npx securenow app connect
|
|
|
262
262
|
npx securenow init
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
-
Auto-detects Next.js, creates `instrumentation.ts`, adds `serverExternalPackages: ['securenow']` plus `outputFileTracingIncludes` when safe, and reuses the app, instance,
|
|
265
|
+
Auto-detects Next.js, creates `instrumentation.ts`, adds `serverExternalPackages: ['securenow']` plus `outputFileTracingIncludes` when safe, and reuses the app, instance, runtime API key, and secure defaults in `.securenow/runtime.json`. If files already exist, it prints an agent-ready prompt with the exact edits to propose.
|
|
266
266
|
|
|
267
267
|
---
|
|
268
268
|
|
|
@@ -279,7 +279,7 @@ export default defineNuxtConfig({
|
|
|
279
279
|
});
|
|
280
280
|
```
|
|
281
281
|
|
|
282
|
-
The Nuxt module auto-configures Nitro externals, runtime config, and a server plugin that sets up OTel tracing + logging + firewall. Local app identity,
|
|
282
|
+
The Nuxt module auto-configures Nitro externals, runtime config, and a server plugin that sets up OTel tracing + logging + firewall. Local app identity, runtime API key, and secure defaults come from `.securenow/runtime.json`; production can use tokenless `.securenow/credentials.<env>.json`.
|
|
283
283
|
|
|
284
284
|
---
|
|
285
285
|
|
|
@@ -300,7 +300,7 @@ Instruments document load, fetch, XMLHttpRequest, and user interactions with bro
|
|
|
300
300
|
|
|
301
301
|
## Firewall — Multi-Layer IP Blocking
|
|
302
302
|
|
|
303
|
-
The firewall auto-activates once
|
|
303
|
+
The firewall auto-activates once a runtime API key is resolvable and the app firewall toggle is on. Since **v8.0**, `npx securenow app connect` enables the selected app firewall by default and writes the scoped runtime key to `.securenow/runtime.json`; `securenow api-key set` can still write/rotate the key later. Production should use the tokenless file generated by `securenow credentials runtime --env production`. Runtime resolution order is project `./.securenow/runtime.json` -> legacy project credentials -> project named runtime credentials -> global runtime/legacy/named runtime credentials. Admin auth lives separately in `admin.json`.
|
|
304
304
|
|
|
305
305
|
```
|
|
306
306
|
Layer 4: Cloud/Edge WAF → blocked at CDN (Cloudflare, AWS WAF, GCP Cloud Armor)
|
|
@@ -350,7 +350,7 @@ node -r securenow/firewall-only app.js
|
|
|
350
350
|
securenow run --firewall-only app.js
|
|
351
351
|
```
|
|
352
352
|
|
|
353
|
-
Loads only
|
|
353
|
+
Loads only the firewall using SecureNow runtime credentials. No OpenTelemetry, no tracing, no external packages needed.
|
|
354
354
|
|
|
355
355
|
### Programmatic Firewall API
|
|
356
356
|
|
|
@@ -537,13 +537,13 @@ securenow redact @request.json --fields internal_id,sessionHash
|
|
|
537
537
|
|
|
538
538
|
## Credentials Configuration
|
|
539
539
|
|
|
540
|
-
Local development uses `.securenow/runtime.json`; legacy `.securenow/credentials.json` is still read. Every setting below lives under `app` or `config`; `npx securenow credentials runtime --env production` creates a tokenless production file with the same structure. Since v7.7.2, the SDK also accepts named runtime files such as `.securenow/credentials.production.json` when the canonical `credentials.json` file is absent. Filename lookup is deterministic and does not read environment variables.
|
|
540
|
+
Local development uses `.securenow/runtime.json`; legacy `.securenow/credentials.json` is still read. Every setting below lives under `app` or `config`; `npx securenow credentials runtime --env production` creates a tokenless production file with the same structure. Since v7.7.2, the SDK also accepts named runtime files such as `.securenow/credentials.production.json` when the canonical `credentials.json` file is absent. Filename lookup is deterministic and does not read environment variables. Environment-variable fallbacks are not supported.
|
|
541
541
|
|
|
542
542
|
| Credentials path | Purpose |
|
|
543
543
|
|---|---|
|
|
544
544
|
| `app.key` | App routing UUID. The SecureNow ingestion gateway routes telemetry by this key |
|
|
545
545
|
| `app.name` | Human-readable app label |
|
|
546
|
-
| `apiKey` | Scoped
|
|
546
|
+
| `apiKey` | Scoped runtime API key (`snk_live_...`) |
|
|
547
547
|
| `config.otel.endpoint` | Optional OTLP base endpoint override |
|
|
548
548
|
| `config.otel.tracesEndpoint` | Optional full traces endpoint |
|
|
549
549
|
| `config.otel.logsEndpoint` | Optional full logs endpoint |
|
|
@@ -589,7 +589,7 @@ npm install securenow@latest
|
|
|
589
589
|
npx securenow login
|
|
590
590
|
```
|
|
591
591
|
|
|
592
|
-
No `.env` is needed. `npx securenow app connect` writes app identity,
|
|
592
|
+
No `.env` is needed. `npx securenow app connect` writes app identity, runtime API key, and secure defaults to `.securenow/runtime.json`; the SDK uses the default SecureNow ingestion gateway and the gateway routes by `app.key` while authenticating with the runtime API key. `npx securenow init` makes sure the file has explanations and is gitignored without ignoring the whole `.securenow/` directory.
|
|
593
593
|
|
|
594
594
|
Update `package.json`:
|
|
595
595
|
```json
|
|
@@ -602,10 +602,10 @@ No code changes to the application needed.
|
|
|
602
602
|
|
|
603
603
|
```bash
|
|
604
604
|
npm install securenow@latest
|
|
605
|
-
npx securenow app connect # pick/create app;
|
|
605
|
+
npx securenow app connect # pick/create app; runtime API key is minted automatically
|
|
606
606
|
```
|
|
607
607
|
|
|
608
|
-
`securenow app connect` enables the selected app's firewall toggle and writes app/runtime config plus the
|
|
608
|
+
`securenow app connect` enables the selected app's firewall toggle and writes app/runtime config plus the runtime API key to `.securenow/runtime.json` (gitignored via credential-file patterns, not a whole-directory `.securenow/` ignore). Traces, logs, request body capture, multipart metadata capture, and firewall enforcement are enabled by default. Then run `npx securenow init`; it creates `instrumentation.ts`, patches `next.config.*` when safe, or prints exact Codex/Claude merge instructions for existing files.
|
|
609
609
|
|
|
610
610
|
### Enable Firewall With Zero Tracing Overhead
|
|
611
611
|
|
package/SKILL-CLI.md
CHANGED
|
@@ -24,7 +24,7 @@ codex mcp add securenow -- npx securenow mcp
|
|
|
24
24
|
npx -p securenow securenow-mcp
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
The MCP server reads admin/control-plane auth from `.securenow/admin.json` and SDK runtime app credentials from `.securenow/runtime.json`, with legacy `.securenow/credentials.json` still supported. Admin/global tools use admin auth; runtime-scoped read tools can use the runtime
|
|
27
|
+
The MCP server reads admin/control-plane auth from `.securenow/admin.json` and SDK runtime app credentials from `.securenow/runtime.json`, with legacy `.securenow/credentials.json` still supported. Admin/global tools use admin auth; runtime-scoped read tools can use the runtime API key where its scopes allow it. Write tools require `confirm:true` plus a reason.
|
|
28
28
|
|
|
29
29
|
### Authenticate
|
|
30
30
|
|
|
@@ -36,13 +36,13 @@ securenow admin login --token <JWT> # headless / CI admin auth
|
|
|
36
36
|
securenow whoami # verify both admin auth and runtime app status
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
**Two-lane credentials (
|
|
39
|
+
**Two-lane credentials (v8.0+):** admin/control-plane auth lives in `.securenow/admin.json`; SDK runtime app config and the runtime API key live in `.securenow/runtime.json`. `securenow login` can run both lanes for onboarding, but `securenow admin login` never replaces runtime app config and `securenow app connect` never replaces admin auth. Legacy combined `.securenow/credentials.json` files are still read.
|
|
40
40
|
|
|
41
41
|
**Zero-config runtime flow:** the browser step lets the user pick (or create) an app. The CLI stores the app's **key (UUID)** and **name** in `.securenow/runtime.json`. The SDK sends traces/logs to the default SecureNow ingestion gateway, which routes by app key, so no env vars or per-instance collector URLs are required for local dev or production.
|
|
42
42
|
|
|
43
43
|
**Default-on security (v7.5.1+):** after picking or creating the app, `securenow app connect` turns on that app's firewall toggle, mints an API key with `firewall:read + blocklist:read + allowlist:read` scopes, and writes it into `.securenow/runtime.json`. Traces, logs, POST body capture, multipart metadata capture, and the firewall are enabled by default. No `SECURENOW_API_KEY` env var is needed. To add or rotate a key later without re-running app connect, use `securenow api-key set snk_live_...` (see [API Key Management](#api-key-management) below).
|
|
44
44
|
|
|
45
|
-
Runtime credentials resolve in order: project `.securenow/runtime.json` -> legacy project `.securenow/credentials.json` -> project named runtime credentials -> global `.securenow/runtime.json` -> legacy global credentials -> global named runtime credentials. Admin auth resolves from `admin.json` first, then legacy `credentials.json`. Runtime config is credentials-json based;
|
|
45
|
+
Runtime credentials resolve in order: project `.securenow/runtime.json` -> legacy project `.securenow/credentials.json` -> project named runtime credentials -> global `.securenow/runtime.json` -> legacy global credentials -> global named runtime credentials. Admin auth resolves from `admin.json` first, then legacy `credentials.json`. Runtime config is credentials-json based; environment-variable fallbacks are not supported.
|
|
46
46
|
|
|
47
47
|
The **firewall API key** should live in runtime credentials as `apiKey`.
|
|
48
48
|
|
|
@@ -69,7 +69,7 @@ securenow login
|
|
|
69
69
|
securenow init
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
This auto-detects your framework, creates the necessary `instrumentation.ts` and `next.config.js` changes, and reuses the app, instance, and
|
|
72
|
+
This auto-detects your framework, creates the necessary `instrumentation.ts` and `next.config.js` changes, and reuses the app, instance, and runtime API key written by login or `app connect` to `.securenow/runtime.json`.
|
|
73
73
|
|
|
74
74
|
### Install This Skill in Cursor
|
|
75
75
|
|
|
@@ -89,9 +89,9 @@ Config lives in `~/.securenow/` (global) and optionally `.securenow/` (per-proje
|
|
|
89
89
|
| `.securenow/credentials.json` | Legacy combined credentials; still read for backward compatibility |
|
|
90
90
|
| `.securenow/credentials.<environment>.json` | Tokenless runtime credentials generated by `securenow credentials runtime --env <environment>`; read in a fixed order, not selected from env vars |
|
|
91
91
|
|
|
92
|
-
**Credential resolution order:** runtime config resolves from project `.securenow/runtime.json` -> legacy project `.securenow/credentials.json` -> project named runtime credentials in the fixed staging/production/preview/local/test/development/dev/prod order -> global `.securenow/runtime.json` -> legacy global credentials -> global named runtime credentials. Admin auth resolves from `admin.json` first, then legacy `credentials.json`.
|
|
92
|
+
**Credential resolution order:** runtime config resolves from project `.securenow/runtime.json` -> legacy project `.securenow/credentials.json` -> project named runtime credentials in the fixed staging/production/preview/local/test/development/dev/prod order -> global `.securenow/runtime.json` -> legacy global credentials -> global named runtime credentials. Admin auth resolves from `admin.json` first, then legacy `credentials.json`. Environment-variable fallbacks are not supported.
|
|
93
93
|
|
|
94
|
-
**
|
|
94
|
+
**Runtime API key resolution (v8.0+):** project `.securenow/runtime.json` -> legacy project credentials -> project named runtime credentials in the fixed staging/production/preview/local/test/development/dev/prod order -> global runtime credentials -> legacy global credentials -> global named runtime credentials. Use `securenow app connect` for runtime setup or `securenow api-key set` to rotate a key without touching admin auth or env vars.
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
97
|
securenow config set apiUrl https://api.securenow.ai
|
|
@@ -113,7 +113,7 @@ Legacy CLI overrides still exist for operator automation, but runtime SDK config
|
|
|
113
113
|
| `--force` | `-f` | Skip confirmations |
|
|
114
114
|
| `--yes` | `-y` | Auto-confirm prompts |
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
SecureNow-specific environment overrides are not supported; use `.securenow/runtime.json`, `.securenow/admin.json`, or `securenow config set`.
|
|
117
117
|
|
|
118
118
|
---
|
|
119
119
|
|
|
@@ -129,7 +129,7 @@ securenow run --firewall-only app.js # preload firewall only (no tracing
|
|
|
129
129
|
securenow src/index.js # shorthand — auto-detected as "run"
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
Spawns `node --require securenow/register [--import otel/hook.mjs] <script>`. ESM detection uses nearest `package.json` `"type"` field or `.mjs`/`.cjs` extension. With `--firewall-only`, uses `securenow/firewall-only` instead (
|
|
132
|
+
Spawns `node --require securenow/register [--import otel/hook.mjs] <script>`. ESM detection uses nearest `package.json` `"type"` field or `.mjs`/`.cjs` extension. With `--firewall-only`, uses `securenow/firewall-only` instead (credentials-file firewall, no OpenTelemetry).
|
|
133
133
|
|
|
134
134
|
### Authentication
|
|
135
135
|
|
|
@@ -158,10 +158,10 @@ securenow apps scan [--yes] # scan all app domains for new subd
|
|
|
158
158
|
|
|
159
159
|
### API Key Management
|
|
160
160
|
|
|
161
|
-
Manage the
|
|
161
|
+
Manage the runtime API key stored in runtime credentials. Since v8.0 the app runtime flow writes app-scoped `snk_live_...` keys to `.securenow/runtime.json` by default, so no env var is required for local dev.
|
|
162
162
|
|
|
163
163
|
```bash
|
|
164
|
-
securenow api-key create --name "CLI
|
|
164
|
+
securenow api-key create --name "CLI runtime" # mint + save a runtime API key with your logged-in session
|
|
165
165
|
securenow api-key set snk_live_xxxxxxxxxx # save to project ./.securenow/ (default)
|
|
166
166
|
securenow api-key set snk_live_xxx --global # save to ~/.securenow/ instead
|
|
167
167
|
securenow api-key show # print the masked current key + its source
|
|
@@ -271,9 +271,10 @@ MCP parity for noisy alert-rule reviews:
|
|
|
271
271
|
- `securenow_alert_rule_candidate_test` dry-runs a full candidate SQL query without saving it.
|
|
272
272
|
- `securenow_alert_rule_test_result` polls the dry-run.
|
|
273
273
|
- `securenow_alert_rule_query_update` updates the shared public query mapping behind a system rule for all customer copies. It is admin-only, requires `confirm:true`, `applyGlobally:true`, `reason`, and SQL that keeps `__USER_APP_KEYS__` tenant scoping.
|
|
274
|
+
- `securenow_alert_rule_instant_update` patches Instant rule conditions/config with stale-write guards. Fetch the rule first, pass `expectedRuleVersion` plus `expectedCurrentInstantHash`, use operations such as `remove_condition` / `add_condition` / `update_condition`, and set `applyGlobally:true` for system rules. The API runs seeded before/after checks and returns benign samples removed plus attack samples still matching. If global tuning is denied, it returns a structured admin handoff with the exact patch and missing permission.
|
|
274
275
|
- `securenow_alert_rule_exclusion_add` remains the last-resort customer-specific path; it supports restrictive conditions plus `matchMode` and should not be used to hide a generic system-rule bug.
|
|
275
276
|
|
|
276
|
-
For system-rule tuning, dry-run the candidate SQL first,
|
|
277
|
+
For system-rule tuning, dry-run the candidate SQL first for scheduled rules, or use `dryRun:true` on `securenow_alert_rule_instant_update` for Instant rules. Save only when the guard preserves attack detection. Good guards add exact exploit tokens, dangerous schemes, matched subdetectors, sensitive path/status evidence, malicious user agents, or repeat thresholds; bad guards simply suppress a noisy path.
|
|
277
278
|
|
|
278
279
|
---
|
|
279
280
|
|
|
@@ -608,4 +609,4 @@ All commands support `--json` for structured output. When piping to other tools
|
|
|
608
609
|
| `Cannot connect` | API unreachable | Check `securenow config get apiUrl` or network |
|
|
609
610
|
| `Unknown command` | Typo or unrecognized command | `securenow help` |
|
|
610
611
|
|
|
611
|
-
|
|
612
|
+
SecureNow-specific environment overrides are intentionally unsupported for troubleshooting; use explicit CLI config files and normal terminal logs.
|