How achmad-firdaus/node-shield works
Node Shield is a Node.js runtime attack-protection library with standalone demo servers and a dashboard. The main workflow is an incoming request passing through middleware, parameter checks, blocking or continuation, and attack logging; operators then inspect attack history and analytics in the dashboard or CLI. The README also documents eight detection categories, IP tracking, brute-force detection, and severity analytics. Sampled excerpts show the middleware, storage, and dashboard responsibilities; some internal wiring and unsampled detection details are therefore left unspecified.
Main entry points: index.js Express Middleware · shield.js Attack Logging · app-standalone.js Dashboard API · app.js Express Demo
Components 17
Application Integration
- Express Demo
app.js - Standalone Server
app-standalone.js - Package API
index.js
Request Protection
- Express Middleware
index.js - Attack Detection
shield.js - IP Tracking
shield.js - Block Response
index.js
Attack Data
- Attack Logging
shield.js - In-memory Attacks
shield.js - PostgreSQL
- Statistics & Severity
shield.js
Operator Views
- Dashboard HTML
shield.js - Dashboard UI
dashboard-as400pro.html - Dashboard API
app-standalone.js - Express Dashboard API
app.js - Shield CLI
cli.js
Other components
- Request Client
Connections 25
- Request Client → Express Demo: sends request
- Express Demo → Express Middleware: installs
- Express Middleware → Attack Detection: checks parameters
- Express Middleware → IP Tracking: tracks client IP
- Express Middleware → Attack Logging: records detection
- Express Middleware → Block Response: returns blocked response
- Express Middleware → Express Demo: continues request
- Request Client → Standalone Server: sends request
- Standalone Server → Attack Detection: checks query values
- Standalone Server → Attack Logging: records detection
- Attack Logging → In-memory Attacks: stores attacks
- Attack Logging → PostgreSQL: stores attacks
- Statistics & Severity → In-memory Attacks: reads attacks
- Statistics & Severity → PostgreSQL: queries attacks
- Express Demo → Express Dashboard API: serves dashboard routes
- Express Dashboard API → Dashboard HTML: gets dashboard HTML
- Express Dashboard API → Statistics & Severity: gets statistics
- Standalone Server → Dashboard API: serves dashboard routes
- Dashboard API → Dashboard UI: loads dashboard file
- Dashboard API → Statistics & Severity: gets statistics
- Dashboard API → Attack Logging: gets attack history
- Request Client → Dashboard API: views dashboard
- Package API → Express Middleware: exports middleware
- Shield CLI → Statistics & Severity: gets statistics
- Shield CLI → Attack Logging: gets or resets logs