ogensec-sdk
v1.3.1
Published
Runtime security middleware for Express.js applications.
Readme
OgenSec SDK
Runtime security middleware for Express.js applications.
Installation
npm install ogensec-sdkQuick Start
const express = require('express');
const OgenSecSDK = require('ogensec-sdk');
const app = express();
// Initialize SDK
const ogenSec = new OgenSecSDK({
baseUrl: 'https://your-ogensec-server.com',
appId: 'your-app-id',
environment: 'production' // or 'test'
});
// Apply middleware
app.use(ogenSec.middleware());
// Your routes
app.get('/', (req, res) => {
res.send('Hello World');
});
app.listen(3000);Configuration
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| baseUrl | string | Yes | OgenSec server URL |
| appId | string | Yes | Your application identifier |
| environment | string | Yes | 'production' or 'test' |
Features
- Runtime vulnerability protection
- Rate limiting (CWE-307)
- CSRF protection (CWE-352)
- Dynamic security hotfixes
- Zero-downtime security updates
Security
All security tokens are transmitted using HttpOnly cookies. The middleware operates in two phases:
- Pre-route: Validates security tokens before your route handlers execute
- Post-route: Sets new tokens after successful request completion
Requirements
- Node.js 14+
- Express.js 4+
License
Proprietary - All Rights Reserved
