This guide covers security best practices for production Cerbos deployments, including TLS configuration, authentication, and secure operational practices.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cerbos/cerbos/llms.txt
Use this file to discover all available pages before exploring further.
Transport Layer Security (TLS)
Enabling TLS
Cerbos supports TLS for both HTTP and gRPC endpoints. Configure TLS by specifying certificate and key paths:- Valid X.509 certificate
- Matching private key
- PEM-encoded format
Automatic Certificate Reloading
Cerbos automatically watches and reloads TLS certificates when they change on disk, enabling zero-downtime certificate rotation:Client Certificate Authentication (mTLS)
Enable mutual TLS to verify client certificates:caCert configured:
- Client certificates are verified against the CA
ClientAuthmode:VerifyClientCertIfGiven- Clients without valid certs are rejected
TLS Configuration Best Practices
Cerbos uses secure TLS defaults:- Minimum TLS version: 1.2
- Strong cipher suites enabled
- Secure curve preferences (P-256, P-384, P-521, X25519)
Use a Reverse Proxy for Advanced TLS
Use a Reverse Proxy for Advanced TLS
For production deployments requiring advanced TLS features, run a reverse proxy:
- Envoy: Advanced mTLS, certificate rotation, SPIFFE/SPIRE integration
- Traefik: Automatic Let’s Encrypt, certificate management
- Ghostunnel: Mutual TLS proxy with PKCS11 support
- nginx: High-performance TLS termination
- Workload identity management
- Advanced certificate rotation strategies
- ACME protocol support (Let’s Encrypt)
- OCSP stapling
- Certificate pinning
Certificate Management in Kubernetes
Certificate Management in Kubernetes
Use cert-manager for automated certificate lifecycle:
Certificate Rotation Strategy
Certificate Rotation Strategy
Automated Rotation:
- External tool updates certificate files
- Cerbos detects change via filesystem watcher
- New certificate loaded automatically
- No service interruption
Admin API Security
The Admin API provides write access to policies and must be secured appropriately.Enabling Admin API
Generating Secure Passwords
Create a bcrypt-hashed, base64-encoded password:- Minimum bcrypt cost: 10 (higher is more secure but slower)
- Unique, randomly generated passwords
- Stored in base64-encoded format
- Never commit passwords to version control
Admin API Authentication
All Admin API requests require HTTP Basic Authentication:Admin API Best Practices
Network Security:Request Metadata Security
Filtering Sensitive Headers
Prevent sensitive data from appearing in audit logs:authorizationheader is excluded by default- Empty lists = no metadata logged
excludeMetadataKeystakes precedence overincludeMetadataKeys
Header Metadata Forwarding
Cerbos automatically handles header translation between HTTP and gRPC: Blocked Headers (removed in translation):ConnectionKeep-AliveProxy-ConnectionTransfer-EncodingUpgradeContent-Length(recalculated)Host(translated toX-Forwarded-Host)
User-Agent→Grpcgateway-User-Agent
Storage Security
Git Repository Authentication
Secure git storage with SSH keys or HTTPS tokens:Database Storage Security
Connect to databases securely:sslmode=verify-full: Verify certificate and hostnamesslmode=verify-ca: Verify certificate onlysslmode=require: Require TLS but don’t verifysslrootcert: Custom CA certificatesslcert,sslkey: Client certificate for mTLS
Blob Storage Authentication
Secure cloud storage access:- Use IAM roles/service accounts instead of static credentials
- Enable server-side encryption
- Use bucket policies for access control
- Enable versioning for policy rollback
Audit Log Security
Kafka TLS Configuration
Hub Backend Security
Cerbos Hub uses end-to-end encryption:Network Security
Listen Address Configuration
Unix Domain Sockets
For local-only access with file system permissions:CORS Configuration
Restrict cross-origin requests:Secrets Management
Environment Variable Substitution
Use environment variables for sensitive configuration:External Secrets Integration
Kubernetes Secrets
Kubernetes Secrets
HashiCorp Vault
HashiCorp Vault
AWS Secrets Manager
AWS Secrets Manager
Resource Limits
Protect against resource exhaustion:Security Checklist
Pre-Production Security Review
Pre-Production Security Review
- TLS enabled for all endpoints
- Admin API using strong, unique credentials
- Admin API password never committed to version control
- Sensitive headers excluded from audit logs
- Storage backend uses authentication
- Network policies restrict Admin API access
- Secrets managed via external secret store
- CORS configured with specific origins
- Request limits configured appropriately
- Audit logging enabled and secured
Ongoing Security Practices
Ongoing Security Practices
- Regular password rotation (90 days)
- Certificate expiration monitoring
- Audit log review for suspicious activity
- Security updates applied promptly
- Access review for Admin API users
- Backup and disaster recovery tested
- Incident response plan documented
Compliance Considerations
Compliance Considerations
- Audit logs retained per compliance requirements
- Data encryption at rest and in transit
- Access control documentation
- Change management process
- Data residency requirements met
- Privacy impact assessment completed
Security Reporting
Report security vulnerabilities responsibly:- Email: [email protected]
- Public Issues: GitHub repository (for non-sensitive issues)
- Security Advisories: Check Cerbos GitHub security tab