Skip to main content
Securing your Bitwarden Server deployment is critical as it stores sensitive credential data. This guide covers security hardening, access controls, and operational security best practices.

Infrastructure Security

Network Security

TLS/SSL Configuration

Never run Bitwarden Server without TLS encryption in production. All traffic must be encrypted to protect credentials in transit.
Minimum TLS Version:
Certificate Requirements:
  • 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:
Internal Service Isolation:

Database Security

Authentication

Strong SA Password:
Connection String Security:
Key Parameters:
  • Encrypt=True - Enforce encrypted connections
  • TrustServerCertificate=False - Validate server certificate
  • Use SQL Server authentication with strong passwords

Database Encryption

Enable Transparent Data Encryption (TDE):
Backup Certificate:
Store TDE certificate backups securely and separately from database backups. Without the certificate, encrypted database backups cannot be restored.

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
Certificate Requirements:
  • Use strong RSA keys (2048-bit minimum, 4096-bit recommended)
  • Store certificates securely with restricted permissions
  • Rotate certificates annually
  • Backup certificates for disaster recovery
File Permissions:

Authentication Security

Password Policies

Enforce strong master password requirements:

Two-Factor Authentication

Enforce 2FA for Administrators:
Recommended 2FA Methods:
  1. Authenticator apps (TOTP) - Most secure
  2. WebAuthn/FIDO2 - Hardware key support
  3. Email 2FA - Fallback option only
SMS 2FA is not supported by Bitwarden due to security concerns with SMS interception attacks.

Rate Limiting

Critical Endpoints: src/Api/appsettings.json:78
Distributed Rate Limiting:

Session Management

Token Security

Identity Server Settings: src/Core/Settings/GlobalSettings.cs:493
Security Recommendations:
  • 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:
Access Reviews:
  • 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 encryption
  • AesCbc128_HmacSha256_B64 - Standard encryption
  • AesCbc256_HmacSha256_B64 - Enhanced encryption
Server stores only encrypted data:
  • All cipher data encrypted with user’s key
  • Master password never transmitted to server
  • Zero-knowledge encryption architecture

File Encryption

Attachment Storage:
For Azure Blob Storage:
  • Enable storage account encryption
  • Use private endpoints
  • Implement SAS token rotation
  • Enable blob soft delete

Backup Security

Encrypt Backups:
Backup Storage:
  • Store backups encrypted
  • Separate backup storage from production
  • Implement backup retention policies
  • Test restore procedures quarterly
See Backup and Restore for detailed procedures.

Monitoring and Auditing

Event Logging

Enable Comprehensive Logging: src/Core/Settings/GlobalSettings.cs:60
Events to Monitor:
  • Failed login attempts
  • Privilege escalations
  • Configuration changes
  • Bulk operations
  • User/organization modifications
  • Vault access patterns
Implementation: 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
See Update Procedures for details.

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:
See Compliance and Audit Logging for details.

Incident Response

Security Incident Plan

1

Detection and Assessment

  • Identify incident type and scope
  • Determine affected systems and data
  • Assess severity level
2

Containment

  • Isolate affected systems
  • Revoke compromised credentials
  • Block malicious IPs/traffic
3

Eradication

  • Remove malicious access
  • Patch vulnerabilities
  • Reset compromised accounts
4

Recovery

  • Restore from clean backups
  • Verify system integrity
  • Gradually restore services
5

Post-Incident

  • Document incident timeline
  • Conduct root cause analysis
  • Update security controls
  • Notify affected parties if required

Breach Response

If credential data is potentially compromised:
  1. Immediate Actions:
    • Force password reset for all users
    • Invalidate all active sessions
    • Enable additional authentication requirements
  2. Investigation:
    • Review access logs
    • Identify compromised accounts
    • Determine data exposure scope
  3. 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