securenow 5.12.1 → 5.12.2
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/nextjs.js +21 -22
- package/package.json +1 -1
package/nextjs.js
CHANGED
|
@@ -541,28 +541,6 @@ function registerSecureNow(options = {}) {
|
|
|
541
541
|
}
|
|
542
542
|
} catch (_) {}
|
|
543
543
|
|
|
544
|
-
// Firewall — auto-activates when SECURENOW_API_KEY is set
|
|
545
|
-
const firewallApiKey = env('SECURENOW_API_KEY');
|
|
546
|
-
if (firewallApiKey && env('SECURENOW_FIREWALL_ENABLED') !== '0') {
|
|
547
|
-
try {
|
|
548
|
-
require('./firewall').init({
|
|
549
|
-
apiKey: firewallApiKey,
|
|
550
|
-
apiUrl: env('SECURENOW_API_URL') || 'https://api.securenow.ai',
|
|
551
|
-
versionCheckInterval: parseInt(env('SECURENOW_FIREWALL_VERSION_INTERVAL'), 10) || 10,
|
|
552
|
-
syncInterval: parseInt(env('SECURENOW_FIREWALL_SYNC_INTERVAL'), 10) || 300,
|
|
553
|
-
failMode: env('SECURENOW_FIREWALL_FAIL_MODE') || 'open',
|
|
554
|
-
statusCode: parseInt(env('SECURENOW_FIREWALL_STATUS_CODE'), 10) || 403,
|
|
555
|
-
log: env('SECURENOW_FIREWALL_LOG') !== '0',
|
|
556
|
-
tcp: env('SECURENOW_FIREWALL_TCP') === '1',
|
|
557
|
-
iptables: env('SECURENOW_FIREWALL_IPTABLES') === '1',
|
|
558
|
-
cloud: env('SECURENOW_FIREWALL_CLOUD') || null,
|
|
559
|
-
});
|
|
560
|
-
} catch (e) {
|
|
561
|
-
console.warn('[securenow] Firewall init failed:', e.message);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
|
|
566
544
|
console.log('[securenow] ✅ OpenTelemetry started for Next.js → %s', tracesUrl);
|
|
567
545
|
console.log('[securenow] 📊 Auto-capturing comprehensive request metadata:');
|
|
568
546
|
console.log('[securenow] • IP addresses (x-forwarded-for, x-real-ip, socket)');
|
|
@@ -594,6 +572,27 @@ function registerSecureNow(options = {}) {
|
|
|
594
572
|
console.error('[securenow] Make sure OpenTelemetry dependencies are installed');
|
|
595
573
|
}
|
|
596
574
|
}
|
|
575
|
+
|
|
576
|
+
// Firewall — runs independently from OTel so it works even if tracing fails
|
|
577
|
+
const firewallApiKey = env('SECURENOW_API_KEY');
|
|
578
|
+
if (firewallApiKey && env('SECURENOW_FIREWALL_ENABLED') !== '0') {
|
|
579
|
+
try {
|
|
580
|
+
require('./firewall').init({
|
|
581
|
+
apiKey: firewallApiKey,
|
|
582
|
+
apiUrl: env('SECURENOW_API_URL') || 'https://api.securenow.ai',
|
|
583
|
+
versionCheckInterval: parseInt(env('SECURENOW_FIREWALL_VERSION_INTERVAL'), 10) || 10,
|
|
584
|
+
syncInterval: parseInt(env('SECURENOW_FIREWALL_SYNC_INTERVAL'), 10) || 300,
|
|
585
|
+
failMode: env('SECURENOW_FIREWALL_FAIL_MODE') || 'open',
|
|
586
|
+
statusCode: parseInt(env('SECURENOW_FIREWALL_STATUS_CODE'), 10) || 403,
|
|
587
|
+
log: env('SECURENOW_FIREWALL_LOG') !== '0',
|
|
588
|
+
tcp: env('SECURENOW_FIREWALL_TCP') === '1',
|
|
589
|
+
iptables: env('SECURENOW_FIREWALL_IPTABLES') === '1',
|
|
590
|
+
cloud: env('SECURENOW_FIREWALL_CLOUD') || null,
|
|
591
|
+
});
|
|
592
|
+
} catch (e) {
|
|
593
|
+
console.warn('[securenow] Firewall init failed:', e.message);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
597
596
|
}
|
|
598
597
|
|
|
599
598
|
module.exports = {
|
package/package.json
CHANGED