Infrastructure Security
Network Security
TLS/SSL Configuration
Minimum TLS Version:- Use certificates from trusted Certificate Authorities
- Implement certificate pinning for mobile apps
- Monitor certificate expiration (renew 30 days before expiry)
- Use 2048-bit or 4096-bit RSA keys (or 256-bit ECDSA)
Firewall Rules
Required Ports:Database Security
Authentication
Strong SA Password:Encrypt=True- Enforce encrypted connectionsTrustServerCertificate=False- Validate server certificate- Use SQL Server authentication with strong passwords
Database Encryption
Enable Transparent Data Encryption (TDE):Access Control
Principle of Least Privilege:Application Security
Data Protection
Certificate Management
Bitwarden uses Data Protection certificates for securing sensitive data: Configuration:src/Core/Settings/GlobalSettings.cs:548
- Use strong RSA keys (2048-bit minimum, 4096-bit recommended)
- Store certificates securely with restricted permissions
- Rotate certificates annually
- Backup certificates for disaster recovery
Authentication Security
Password Policies
Enforce strong master password requirements:Two-Factor Authentication
Enforce 2FA for Administrators:- Authenticator apps (TOTP) - Most secure
- WebAuthn/FIDO2 - Hardware key support
- Email 2FA - Fallback option only
Rate Limiting
Critical Endpoints:src/Api/appsettings.json:78
Session Management
Token Security
Identity Server Settings:src/Core/Settings/GlobalSettings.cs:493
- Keep access token lifetime short (≤60 minutes)
- Implement refresh token rotation
- Revoke tokens on password change
- Clear tokens on logout
Session Timeout
Access Control
Administrative Access
Admin Portal Protection
Privileged Operations
Require approval for:- User role changes
- Organization ownership transfers
- Bulk user operations
- System configuration changes
Organization Security
Collection Management
Principle of Least Privilege:- Conduct quarterly access reviews
- Remove inactive users promptly
- Audit privileged access monthly
Data Security
Encryption at Rest
Vault Data Encryption
Bitwarden implements client-side encryption: Encryption Types:src/Core/Utilities/EncryptedStringAttribute.cs:14
AesCbc256_B64- Legacy encryptionAesCbc128_HmacSha256_B64- Standard encryptionAesCbc256_HmacSha256_B64- Enhanced encryption
- All cipher data encrypted with user’s key
- Master password never transmitted to server
- Zero-knowledge encryption architecture
File Encryption
Attachment Storage:- Enable storage account encryption
- Use private endpoints
- Implement SAS token rotation
- Enable blob soft delete
Backup Security
Encrypt Backups:- Store backups encrypted
- Separate backup storage from production
- Implement backup retention policies
- Test restore procedures quarterly
Monitoring and Auditing
Event Logging
Enable Comprehensive Logging:src/Core/Settings/GlobalSettings.cs:60
- Failed login attempts
- Privilege escalations
- Configuration changes
- Bulk operations
- User/organization modifications
- Vault access patterns
src/Core/Dirt/Services/Implementations/EventService.cs
Security Monitoring
Critical Alerts
Authentication Anomalies
Alert on:
- Multiple failed login attempts
- Login from new location/device
- Impossible travel scenarios
- Privilege elevation
Data Access Patterns
Alert on:
- Bulk data exports
- Unusual access volumes
- Access to sensitive collections
- After-hours access
System Changes
Alert on:
- Configuration modifications
- User role changes
- New admin accounts
- Service restarts
Security Events
Alert on:
- Certificate expiration
- Failed health checks
- Database connection errors
- Rate limit violations
Log Retention
Vulnerability Management
Update Management
Patch Schedule:- Critical security updates: Within 48 hours
- High severity: Within 1 week
- Medium severity: Within 30 days
- Regular updates: Monthly
Dependency Scanning
Penetration Testing
Recommended Schedule:- Annual external penetration test
- Quarterly vulnerability scans
- Continuous automated scanning
Compliance Considerations
Regulatory Requirements
Depending on your industry, consider:- GDPR: Data protection, right to erasure, data portability
- HIPAA: PHI protection, audit logging, access controls
- SOC 2: Security controls, monitoring, incident response
- PCI DSS: If storing payment card data in vault
Audit Logging
Required Audit Data:Incident Response
Security Incident Plan
Detection and Assessment
- Identify incident type and scope
- Determine affected systems and data
- Assess severity level
Breach Response
If credential data is potentially compromised:-
Immediate Actions:
- Force password reset for all users
- Invalidate all active sessions
- Enable additional authentication requirements
-
Investigation:
- Review access logs
- Identify compromised accounts
- Determine data exposure scope
-
Notification:
- Notify affected users
- Comply with breach notification laws
- Document incident for regulators
Security Checklist
Use this checklist for new deployments:- TLS 1.2+ enforced with strong ciphers
- Valid TLS certificate from trusted CA
- Database encrypted at rest (TDE enabled)
- Database connections encrypted
- Strong passwords for all service accounts
- Data protection certificates configured
- Rate limiting enabled
- Two-factor authentication enforced for admins
- Regular backup schedule configured
- Backups encrypted and tested
- Event logging enabled and monitored
- Security monitoring and alerting configured
- Update schedule established
- Incident response plan documented
- Access controls reviewed and documented
- Audit logging retention policy set
- Firewall rules configured
- Internal services not exposed externally
- Log files protected with appropriate permissions
- Admin portal access restricted