securenow 5.14.0 → 5.15.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 +20 -14
- package/NPM_README.md +368 -124
- package/README.md +23 -17
- package/SKILL-API.md +597 -0
- package/SKILL-CLI.md +395 -0
- package/cli.js +1 -1
- package/docs/FIREWALL-GUIDE.md +35 -12
- package/package.json +4 -2
package/CONSUMING-APPS-GUIDE.md
CHANGED
|
@@ -175,37 +175,37 @@ SECURENOW_LOGGING_ENABLED=1 SECURENOW_APPID=express-app node app.js
|
|
|
175
175
|
|
|
176
176
|
### Next.js (App Router)
|
|
177
177
|
|
|
178
|
-
**1.
|
|
178
|
+
**1. Run `npx securenow init`** or create `instrumentation.ts` in your project root:
|
|
179
179
|
|
|
180
180
|
```typescript
|
|
181
181
|
// instrumentation.ts
|
|
182
182
|
export async function register() {
|
|
183
183
|
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
const { registerSecureNow } = require('securenow/nextjs');
|
|
185
|
+
registerSecureNow();
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
**2.
|
|
190
|
+
**2. Update `next.config.js` with `withSecureNow()`:**
|
|
191
191
|
|
|
192
192
|
```javascript
|
|
193
|
-
|
|
194
|
-
const nextConfig = {
|
|
195
|
-
experimental: {
|
|
196
|
-
instrumentationHook: true,
|
|
197
|
-
},
|
|
198
|
-
};
|
|
193
|
+
const { withSecureNow } = require('securenow/nextjs-webpack-config');
|
|
199
194
|
|
|
200
|
-
module.exports =
|
|
195
|
+
module.exports = withSecureNow({
|
|
196
|
+
// your existing config
|
|
197
|
+
});
|
|
201
198
|
```
|
|
202
199
|
|
|
200
|
+
This auto-detects Next.js 14 vs 15 and sets the correct `serverExternalPackages` / `experimental.serverComponentsExternalPackages` config.
|
|
201
|
+
|
|
203
202
|
**3. Add to `.env.local`:**
|
|
204
203
|
|
|
205
204
|
```bash
|
|
206
205
|
SECURENOW_LOGGING_ENABLED=1
|
|
207
206
|
SECURENOW_APPID=my-nextjs-app
|
|
208
207
|
SECURENOW_INSTANCE=http://localhost:4318
|
|
208
|
+
SECURENOW_API_KEY=snk_live_abc123...
|
|
209
209
|
```
|
|
210
210
|
|
|
211
211
|
**4. Use in API routes:**
|
|
@@ -414,15 +414,21 @@ Add your API key to `.env`:
|
|
|
414
414
|
SECURENOW_API_KEY=snk_live_abc123...
|
|
415
415
|
```
|
|
416
416
|
|
|
417
|
-
The firewall activates automatically on startup and syncs the blocklist
|
|
417
|
+
The firewall activates automatically on startup and syncs the blocklist using a version-based protocol:
|
|
418
418
|
|
|
419
419
|
```
|
|
420
420
|
[securenow] Firewall: ENABLED
|
|
421
421
|
[securenow] Firewall: Layer 1 (HTTP 403) active
|
|
422
|
-
[securenow] Firewall: synced 142 blocked IPs
|
|
422
|
+
[securenow] Firewall: synced 142 blocked IPs (138 exact + 4 CIDR ranges)
|
|
423
423
|
```
|
|
424
424
|
|
|
425
|
-
Blocked IPs get a 403 Forbidden
|
|
425
|
+
Blocked IPs get a 403 Forbidden with a full security alert page. Changes propagate in 10-15 seconds. No code changes needed -- works with Express, Next.js, Nuxt, Fastify, and all Node.js frameworks.
|
|
426
|
+
|
|
427
|
+
**Firewall-only mode** (no tracing overhead):
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
node -r securenow/firewall-only app.js
|
|
431
|
+
```
|
|
426
432
|
|
|
427
433
|
See the [Firewall Guide](./docs/FIREWALL-GUIDE.md) for advanced layers (TCP blocking, iptables, Cloud WAF).
|
|
428
434
|
|