Authentication and Authorization
Master Key
Generate a secure master key:config.yaml
Virtual Keys
Create scoped API keys with rate limits and budgets:Team-Based Access Control
Create teams with budgets:SSO Integration
- Google OAuth
- Microsoft Azure AD
- Okta
config.yaml
Secrets Management
Environment Variables
Reference in config.yaml:Kubernetes Secrets
Create secrets:AWS Secrets Manager
Store secrets in AWS:HashiCorp Vault
config.yaml
Network Security
TLS/SSL Configuration
Enable HTTPS in production:- NGINX Reverse Proxy
- Traefik
- Kubernetes Ingress
Firewall Rules
Allow only necessary traffic:Network Policies (Kubernetes)
networkpolicy.yaml
Rate Limiting and DDoS Protection
Built-in Rate Limiting
Global rate limits:config.yaml
NGINX Rate Limiting
Cloudflare Protection
Benefits:- DDoS mitigation
- WAF (Web Application Firewall)
- Rate limiting at edge
- Bot detection
- Geographic restrictions
Data Protection
Database Encryption
Enable PostgreSQL SSL:config.yaml
Redacting Sensitive Data
Mask PII in logs:config.yaml
Request/Response Encryption
End-to-end encryption:Compliance
GDPR Compliance
1
Data Minimization
Only store necessary data:
2
Right to Deletion
Implement user data deletion:This removes:
- User account
- API keys
- Spend logs (or anonymizes)
- Personal metadata
3
Data Export
Allow users to export their data:
4
Consent Management
Track user consent:
SOC 2 / ISO 27001
Audit logging:HIPAA Compliance
Requirements:- Enable encryption at rest and in transit
- Implement access controls (RBAC)
- Audit all access to PHI
- Use HIPAA-compliant infrastructure (AWS, GCP, Azure)
- Sign BAAs with:
- OpenAI (via Azure OpenAI)
- Anthropic (Enterprise plan)
- Google (Vertex AI)
- AWS (Bedrock)
Container Security
Base Image Security
LiteLLM uses Chainguard Wolfi base images for minimal attack surface:Security Scanning
Scan images for vulnerabilities:Pod Security Standards (Kubernetes)
Monitoring and Incident Response
Security Monitoring
Monitor for suspicious activity:Incident Response Plan
1
Detection
- Monitor alerts
- Review audit logs
- Check error rates
2
Containment
3
Investigation
4
Recovery
- Rotate master key
- Regenerate affected virtual keys
- Update provider API keys
- Patch vulnerabilities
5
Post-Mortem
- Document incident
- Update security policies
- Improve monitoring
- Train team
Security Checklist
1
Authentication
- Strong master key generated
- Virtual keys with rate limits
- SSO enabled for admin UI
- MFA for admin accounts
2
Network
- HTTPS/TLS enabled
- Firewall rules configured
- Network policies in place
- DDoS protection active
3
Data
- Database encryption enabled
- Secrets in environment/vault
- PII redaction configured
- Backup encryption enabled
4
Compliance
- Audit logging enabled
- Data retention policy set
- BAAs signed with providers
- Privacy policy updated
5
Monitoring
- Security alerts configured
- Audit log monitoring
- Incident response plan
- Regular security audits
Next Steps
Monitoring
Set up security monitoring and alerts
High Availability
Deploy securely at scale
Performance
Optimize without compromising security
Troubleshooting
Debug security-related issues