Security Guide
XyPriss includes comprehensive security features to protect your application from common vulnerabilities. This guide covers basic configuration, security levels, and best practices.
Basic Security Configuration
Enable core security features globally in your server options:
import { createServer } from "xypriss";
const server = createServer({
security: {
enabled: true,
csrf: true,
rateLimit: {
max: 100,
windowMs: 15 * 60 * 1000, // 100 requests per 15 minutes
},
},
});Security Levels
XyPriss offers three pre-defined security levels to quickly configure your application's defensive posture.
Basic
- Essential security headers
- Basic CORS protection
- Request logging
Enhanced
- All basic features
- CSRF protection
- Rate limiting
- Input sanitization
- XSS protection
Maximum
- All enhanced features
- Strict CSP policies
- Advanced rate limiting
- IP whitelisting/blacklisting
- Request signature validation
const server = createServer({
security: {
enabled: true,
level: "enhanced", // "basic" | "enhanced" | "maximum"
},
});Security Headers
XyPriss automatically sets secure HTTP headers using Helmet. You can customize these directives in your configuration:
const server = createServer({
security: {
helmet: {
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
styleSrc: ["'self'", "'unsafe-inline'"],
scriptSrc: ["'self'"],
imgSrc: ["'self'", "data:", "https:"],
},
},
hsts: {
maxAge: 31536000,
includeSubDomains: true,
preload: true,
},
},
},
});Security Best Practices
Monitoring & Logging
Enable security event logging to monitor for suspicious activity:
const server = createServer({
logging: {
enabled: true,
level: "info",
components: {
security: true,
},
},
security: {
enabled: true,
logSecurityEvents: true,
},
});xfpm install xypriss-securityData Privacy & Disclosure
At Nehonix, we prioritize the privacy and security of your data. We are committed to total transparency regarding data handling:
XyPriss is designed as a self-contained framework. Nehonix does not collect, store, or transmit any application data, user information, or server metrics to external servers. All logic executed by the framework stays within your local infrastructure, ensuring absolute data sovereignty.
The only external requests made by official components (such as XyNginC or XFPM) are strictly for fetching necessary updates, security templates, or package metadata from official GitHub repositories.
Secure your server by preventing unauthorized access to sensitive system files and directories.
