Skip to content

Security Overview

Fluxbase is built with security as a top priority. This page provides an overview of the security features and best practices implemented throughout the platform.

Fluxbase implements multiple layers of security to protect your data and applications:

┌─────────────────────────────────────────────────────────────┐
│ Application Layer │
│ • Authentication (JWT, OAuth, 2FA) │
│ • Authorization (RLS, RBAC) │
│ • Input Validation │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Network Layer │
│ • HTTPS/TLS Encryption │
│ • CSRF Protection │
│ • Security Headers │
│ • Rate Limiting │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Database Layer │
│ • Row Level Security (RLS) │
│ • Encrypted Connections │
│ • Parameterized Queries │
│ • Audit Logging │
└─────────────────────────────────────────────────────────────┘

  • Secure token-based authentication
  • Short-lived access tokens (15 minutes default)
  • Long-lived refresh tokens with rotation
  • Token blacklisting on logout
  • TOTP (Time-based One-Time Password) support
  • QR code generation for authenticator apps
  • Backup codes for account recovery
  • Configurable 2FA enforcement
  • Support for major providers (Google, GitHub, Facebook, etc.)
  • Secure token exchange
  • State parameter for CSRF protection
  • Automatic account linking
  • Database-level access control
  • Automatic row filtering based on user context
  • Policy-based permissions
  • Multi-tenant data isolation

Learn more about RLS →


  • TLS 1.2+ required in production
  • Automatic HTTPS redirect
  • HSTS (HTTP Strict Transport Security) headers
  • Secure cookie attributes
  • Token-based CSRF protection
  • Double-submit cookie pattern
  • Automatic token generation
  • SameSite cookie attributes

Learn more about CSRF Protection →

  • Content Security Policy (CSP)
  • X-Frame-Options (Clickjacking protection)
  • X-Content-Type-Options (MIME sniffing protection)
  • X-XSS-Protection
  • Referrer-Policy
  • Permissions-Policy

Learn more about Security Headers →

  • IP-based rate limiting
  • User-based rate limiting
  • API key-based rate limiting
  • Distributed rate limiting with Redis
  • Configurable limits per endpoint

Learn more about Rate Limiting →


  • Database encryption (PostgreSQL native encryption)
  • File storage encryption
  • Secrets management with environment variables
  • Password hashing with bcrypt (cost factor 10)
  • TLS for all API communications
  • Secure WebSocket connections (WSS)
  • Encrypted database connections
  • HTTPS-only cookies
  • Row Level Security for multi-tenancy
  • Schema-based isolation options
  • Organization/team-based access control
  • User-level data separation

  • Parameterized queries throughout
  • No string concatenation in SQL
  • Input validation at API level
  • PostgreSQL prepared statements
  • Content Security Policy headers
  • Output encoding
  • Safe HTML rendering
  • React/Vue automatic escaping
  • No shell command execution with user input
  • Validation of file paths
  • Allowlist-based validation
  • Secure file upload handling

# ✅ GOOD: Use environment variables
database:
url: ${DATABASE_URL}
auth:
jwt_secret: ${JWT_SECRET}
# ❌ BAD: Don't hardcode secrets
database:
url: "postgres://user:password@host/db"
auth:
jwt_secret: "my-secret-key-123"
fluxbase.yaml
server:
port: 443
tls:
enabled: true
cert_file: /path/to/cert.pem
key_file: /path/to/key.pem
auth:
password_min_length: 12
password_require_uppercase: true
password_require_lowercase: true
password_require_number: true
password_require_special: true
-- Always enable RLS on tables with user data
ALTER TABLE public.my_table ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.my_table FORCE ROW LEVEL SECURITY;
CREATE POLICY user_isolation ON public.my_table
FOR ALL
USING (user_id = auth.uid());
rate_limiting:
enabled: true
per_minute: 60 # Global limit
per_hour: 1000
# Per-endpoint limits
endpoints:
- path: "/api/v1/auth/login"
per_minute: 5 # Stricter limit for sensitive endpoints
// ✅ GOOD: Store client keys in environment variables
const apiKey = process.env.FLUXBASE_CLIENT_KEY;
// ❌ BAD: Don't commit client keys to source control
const apiKey = "fb_live_abc123def456";
// ✅ GOOD: Validate and sanitize
const email = validator.normalizeEmail(req.body.email);
const age = parseInt(req.body.age, 10);
if (!validator.isEmail(email)) {
throw new Error("Invalid email");
}
if (isNaN(age) || age < 0 || age > 150) {
throw new Error("Invalid age");
}
// ✅ GOOD: Generic error messages
try {
await client.auth.signIn({ email, password });
} catch (error) {
// Don't reveal whether user exists
throw new Error("Invalid email or password");
}
// ❌ BAD: Reveals too much information
try {
await client.auth.signIn({ email, password });
} catch (error) {
if (error.message === "User not found") {
throw new Error("No account with that email");
}
throw new Error("Incorrect password");
}

Terminal window
# Update Fluxbase regularly
docker pull fluxbase/fluxbase:latest
# Update PostgreSQL
apt-get update && apt-get upgrade postgresql
Terminal window
# Allow HTTPS traffic
ufw allow 443/tcp
# Allow PostgreSQL from specific IPs only
ufw allow from 10.0.0.0/8 to any port 5432
# Enable firewall
ufw enable
fluxbase.yaml
logging:
level: info
audit_enabled: true
audit_log_file: /var/log/fluxbase/audit.log
Terminal window
# Daily PostgreSQL backups
0 2 * * * pg_dump -U postgres fluxbase > /backups/fluxbase-$(date +\%Y\%m\%d).sql
# Weekly full backups
0 3 * * 0 tar -czf /backups/fluxbase-full-$(date +\%Y\%m\%d).tar.gz /var/lib/fluxbase
# Configure alerts for security events
monitoring:
alerts:
- name: "Failed Login Attempts"
condition: "failed_logins > 10 in 5m"
action: "notify_admin"
- name: "Unusual API Activity"
condition: "requests_per_minute > 1000"
action: "rate_limit"
Terminal window
# Use Docker secrets
echo "my-jwt-secret" | docker secret create jwt_secret -
# Use Kubernetes secrets
kubectl create secret generic fluxbase-secrets \
--from-literal=jwt-secret=my-jwt-secret \
--from-literal=database-url=postgres://...
-- Create read-only user for reporting
CREATE USER readonly_user WITH PASSWORD 'secure_password';
GRANT CONNECT ON DATABASE fluxbase TO readonly_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly_user;
-- Revoke dangerous permissions
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA pg_catalog FROM PUBLIC;

  • Environment variables configured for all secrets
  • HTTPS/TLS certificates obtained and configured
  • Strong JWT secret generated (min 32 characters)
  • Database user has minimal required permissions
  • RLS policies reviewed and tested
  • Rate limiting configured
  • CORS settings reviewed
  • Security headers configured
  • Input validation implemented
  • Error handling doesn’t leak sensitive information
  • Security headers verified (use securityheaders.com)
  • SSL/TLS configuration tested (use ssllabs.com)
  • Penetration testing completed
  • Dependency vulnerabilities scanned (npm audit, snyk)
  • Access logs monitored
  • Backup strategy implemented
  • Incident response plan documented
  • Security updates subscribed to

Fluxbase provides features to help with GDPR compliance:

  • Right to Access: Users can download their data via API
  • Right to Erasure: Delete user data with cascading deletes
  • Data Portability: Export user data in JSON format
  • Consent Management: Track user consents in metadata
  • Audit Logging: Log all data access and modifications

HIPAA (Health Insurance Portability and Accountability Act)

Section titled “HIPAA (Health Insurance Portability and Accountability Act)”

For HIPAA compliance, additional configuration is required:

  • Enable audit logging for all PHI access
  • Implement BAA (Business Associate Agreement)
  • Use encryption at rest and in transit
  • Implement access controls and RLS
  • Regular security assessments
  • Incident response procedures

Fluxbase supports SOC 2 compliance with:

  • Access controls (RBAC, RLS)
  • Audit logging
  • Encryption standards
  • Change management
  • Incident response
  • Regular security monitoring

If you discover a security vulnerability in Fluxbase, please report it responsibly:

  1. Description of the vulnerability
  2. Steps to reproduce
  3. Affected versions
  4. Potential impact
  5. Suggested fix (if any)
  • 24 hours: Initial acknowledgment
  • 48 hours: Preliminary assessment
  • 7 days: Detailed response and timeline
  • 30 days: Fix release (for critical issues)


Subscribe to security updates:

  • GitHub: Watch the Fluxbase repository
  • Email: Subscribe to the security mailing list
  • RSS: Security advisories feed

Fluxbase implements defense-in-depth security with multiple layers of protection:

  • Authentication: JWT, OAuth, 2FA
  • Authorization: RLS, RBAC, policies
  • Network Security: HTTPS, CSRF, security headers
  • Data Security: Encryption, isolation, access control
  • Input Validation: SQL injection, XSS, command injection prevention
  • Monitoring: Audit logs, rate limiting, alerts

Follow the security best practices and keep your instance updated to maintain a strong security posture.