@sentinelweb/backend-agent
v1.0.0
Published
SentinelWeb Backend Agent for server-side security monitoring and performance tracking
Maintainers
Readme
🛡️ SentinelWeb Backend Agent
A zero-config Node.js/Express middleware for detecting SQL injection, XSS, and rate limit abuse in real-time.
🚀 Installation
npm install @sentinelweb/backend-agent⚡ Quickstart
The absolute minimum code required to integrate the agent into your Express application.
import express from 'express';
import { SentinelWebBackend } from '@sentinelweb/backend-agent';
const app = express();
const sentinelAgent = new SentinelWebBackend({
apiEndpoint: 'https://your-api.com/collect/backend',
serverInfo: {
serverId: 'prod-api-01',
serverName: 'Production API Server',
environment: 'production',
version: '1.0.0'
}
});
// Add monitoring middleware early in the chain
app.use(sentinelAgent.middleware());
app.use(express.json());
// Start the reporting interval
sentinelAgent.start();
app.listen(3000, () => console.log('🛡️ Protected by SentinelWeb'));⚙️ Configuration API
When instantiating SentinelWebBackend(config), pass an object with the following properties:
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| apiEndpoint | string | Required | The Collector API endpoint URL where telemetry should be sent. |
| serverInfo | object | Required | Identity of the server (serverId, serverName, environment, version). |
| collectInterval | number | 30000 | Milliseconds between background batch transmissions (default 30s). |
| debug | boolean | false | Enable verbose console debug logging for tracking anomalies. |
| enabledFeatures | object | all enabled | Feature toggles (authenticationMonitoring, apiRequestTracking, errorTracking, performanceMonitoring, securityEventDetection, rateLimitingMonitoring). |
| security | object | see below | Deep security tuning (enableBruteForceDetection, enableSQLInjectionDetection, enableXSSDetection, suspiciousIPTracking, maxFailedAttempts, bruteForceTimeWindow). |
| performance | object | see below | Performance threshold mapping (slowQueryThreshold: 1000, slowResponseThreshold: 2000, highMemoryThreshold: 80). |
🤝 Contributing
We welcome community contributions to SentinelWeb!
- Clone the repository:
git clone https://github.com/jayesh-bhai/SentinelWeb.git - Setup Locally:
cd SentinelWeb/agents/backend-agent npm install - Run the local testing demo:
npm run demo # Starts the local testing playground with vulnerable endpoints - Submit a Pull Request: Open a PR on our GitHub Repository. If you find a security flaw or bug, please open an Issue first!
📄 License
This project is licensed under the MIT License.
