Forensic logging, active defense, and security headers in a single
app.use().
Production-ready NIS2 compliance middleware for Node.js applications.
npm install @nis2shield/express-middleware
import express from 'express';
import { nis2Shield } from '@nis2shield/express-middleware';
const app = express();
// One line to NIS2 compliance
app.use(nis2Shield());
app.listen(3000);
Splunk, Datadog, QRadar connectors + Threat Intelligence + Priority Support
Explore Middleware Pro →v0.4.0 Features
Structured JSON logs with HMAC-SHA256 signing. Now with Multi-SIEM support.
Native connectors for Splunk HEC, Datadog, and QRadar (CEF via TCP/UDP).
Anti-hijacking middleware that fingerprints sessions by IP and User-Agent.
Real-time alerts via Slack, Teams, and Discord for critical security events.
Audit your app configuration with `npx check-nis2`. Generates HTML/JSON reports.
Rate limiting (Token Bucket), IP blocking, Tor exit node detection, and Geo-blocking.
HSTS, CSP, X-Frame-Options, Referrer-Policy, and Permissions-Policy out-of-the-box.
import { nis2Shield } from '@nis2shield/express-middleware';
app.use(nis2Shield({
enabled: true,
encryptionKey: process.env.NIS2_ENCRYPTION_KEY,
integrityKey: process.env.NIS2_HMAC_KEY,
logging: {
enabled: true,
anonymizeIP: true,
encryptPII: true,
piiFields: ['userId', 'email'],
},
activeDefense: {
rateLimit: {
enabled: true,
windowMs: 60000,
max: 100,
},
blockTor: true,
sessionGuard: { enabled: true },
},
webhooks: {
url: "https://hooks.slack.com/...",
},
securityHeaders: {
enabled: true,
hsts: true,
csp: "default-src 'self'",
},
}));