nginx-defender is an enterprise-grade Web Application Firewall (WAF) and network security solution designed with security-first principles. This document outlines our security policies, vulnerability reporting procedures, and security best practices for deployment and usage.
We provide security updates for the following versions:
Version | Supported | Notes |
---|---|---|
1.5.0 | ✅ | Current stable release |
1.4.2 | ✅ | LTS support until 2025 |
1.4.1 | Security fixes only | |
< 1.4 | ❌ | End of life |
-
Multi-Backend Firewall Support
- iptables (Linux)
- nftables (Linux)
- pfctl (BSD/macOS)
- fail2ban integration
- Custom rule management
-
Machine Learning Threat Detection
- Behavioral analysis engine
- Anomaly detection algorithms
- Real-time threat scoring
- Adaptive learning capabilities
-
Advanced Rate Limiting
- Token bucket algorithms
- Sliding window counters
- IP-based and endpoint-based limits
- Geographic rate limiting
-
Real-time Monitoring
- WebSocket-based dashboards
- Prometheus metrics integration
- Custom alerting rules
- Log aggregation and analysis
- Role-based access control (RBAC)
- API key authentication
- JWT token validation
- IP-based access restrictions
- Encrypted configuration storage
- Secure inter-service communication
- Log data anonymization
- PII detection and redaction
- TLS 1.3 enforcement
- Certificate pinning
- DDoS protection mechanisms
- Geographic blocking capabilities
Do NOT create public GitHub issues for security vulnerabilities.
Instead, please report security vulnerabilities through one of the following channels:
-
GitHub Security Advisories (Preferred)
- Navigate to the "Security" tab in our repository
- Click "Report a vulnerability"
- Provide detailed information about the vulnerability
-
Email (Alternative)
- Send an encrypted email to: [email protected]
- Use our PGP key: [Key ID: 0x1234567890ABCDEF]
- Include reproduction steps and impact assessment
-
Security Bug Bounty
- Report through our HackerOne program: https://hackerone.com/nginx-defender
- Eligible for monetary rewards based on severity
When reporting a security vulnerability, please include:
- Description: Clear description of the vulnerability
- Steps to Reproduce: Detailed reproduction steps
- Impact Assessment: Potential security impact and affected components
- Proof of Concept: Working exploit code (if applicable)
- Affected Versions: Specific versions affected
- Suggested Fix: Proposed remediation (if available)
- Initial Response: Within 24 hours of report
- Vulnerability Assessment: Within 72 hours
- Fix Development: 7-14 days (depending on severity)
- Security Advisory: Published with patch release
- Public Disclosure: 90 days after patch availability
# Secure configuration example
server:
tls:
enabled: true
cert_file: "/etc/ssl/certs/nginx-defender.crt"
key_file: "/etc/ssl/private/nginx-defender.key"
min_version: "1.3"
firewall:
backend: "nftables"
default_action: "drop"
whitelist:
- "10.0.0.0/8"
- "172.16.0.0/12"
- "192.168.0.0/16"
rate_limiting:
global_limit: 1000
per_ip_limit: 100
burst_allowance: 50
ml:
threat_threshold: 0.8
learning_mode: false
model_validation: true
# Security-hardened container deployment
FROM scratch
COPY --from=builder /app/nginx-defender /nginx-defender
USER 65534:65534
EXPOSE 8080/tcp
ENTRYPOINT ["/nginx-defender"]
apiVersion: v1
kind: SecurityContext
metadata:
name: nginx-defender-security
spec:
runAsNonRoot: true
runAsUser: 65534
runAsGroup: 65534
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add:
- NET_ADMIN # Required for firewall operations
# Use environment variables for secrets
export NGINX_DEFENDER_API_KEY="$(cat /etc/secrets/api-key)"
export NGINX_DEFENDER_DB_PASSWORD="$(cat /etc/secrets/db-password)"
# Or use volume mounts for configuration
docker run -v /secure/config:/config nginx-defender
# Network policy for Kubernetes
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: nginx-defender-netpol
spec:
podSelector:
matchLabels:
app: nginx-defender
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: monitoring
ports:
- protocol: TCP
port: 9090
- Enable audit logging for all security events
- Use structured logging (JSON format)
- Implement log rotation and retention policies
- Set up centralized log aggregation
- Monitor for security-related log patterns
# Prometheus alerting rules
groups:
- name: nginx-defender.security
rules:
- alert: HighThreatDetection
expr: nginx_defender_threats_detected_total > 100
for: 5m
labels:
severity: warning
annotations:
summary: "High number of threats detected"
- alert: FirewallRuleExhaustion
expr: nginx_defender_firewall_rules_total > 10000
for: 1m
labels:
severity: critical
annotations:
summary: "Firewall rule limit approaching"
- Regular configuration backups
- Firewall rule state snapshots
- ML model checkpoints
- Disaster recovery procedures
- Testing backup restoration
The project includes comprehensive security testing:
// Security-focused test examples
func TestSecurityIsolation(t *testing.T) {
// Use secure test environment
ts := NewTestSuite(t)
defer ts.Cleanup()
// Generate cryptographically secure test IPs
testIP := generateSecureTestIP(t)
validateTestIP(t, testIP)
// Test with security metadata
metadata := map[string]string{
"test_type": "security_validation",
"safe_mode": "true",
}
// Verify security controls
assert.True(t, isPrivateIP(testIP), "Only private IPs in tests")
}
-
Penetration Testing
- Regular third-party security assessments
- OWASP Top 10 vulnerability testing
- Network penetration testing
- Social engineering assessments
-
Code Security Reviews
- Static application security testing (SAST)
- Dynamic application security testing (DAST)
- Dependency vulnerability scanning
- Secret detection in code
-
Infrastructure Security
- Container security scanning
- Kubernetes security posture
- Network security validation
- Configuration security review
-
Detection and Analysis
- Monitor security alerts and logs
- Analyze potential security events
- Determine incident classification
- Document all findings
-
Containment and Eradication
- Isolate affected systems
- Apply emergency patches
- Remove malicious components
- Update security controls
-
Recovery and Lessons Learned
- Restore normal operations
- Monitor for recurring issues
- Update security procedures
- Share lessons learned
- Security Team: [email protected]
- Incident Response: [email protected]
- Emergency Hotline: +1-555-SECURITY
- ISO 27001: Information Security Management
- SOC 2 Type II: Security and Availability
- NIST Cybersecurity Framework: Implementation
- OWASP ASVS: Application Security Verification
- GDPR: General Data Protection Regulation
- HIPAA: Health Insurance Portability and Accountability Act
- PCI DSS: Payment Card Industry Data Security Standard
- FedRAMP: Federal Risk and Authorization Management Program
- Security Architecture Guide
- Threat Modeling Report
- Security Configuration Guide
- Incident Response Playbook
- Security Scanner Integration
- SIEM Integration Guide
- Vulnerability Management
- Security Metrics Dashboard
- Security Training Materials
- Security Best Practices
- Secure Development Guidelines
- Security Awareness Program
Last Updated: December 2024
Version: 2.0
Contact: [email protected]
For the latest security updates and advisories, please visit our Security Advisory page.