Zerobyte handles sensitive data including backup encryption keys, storage credentials, and user passwords. This page covers security considerations and best practices.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nicotsx/zerobyte/llms.txt
Use this file to discover all available pages before exploring further.
Encryption
APP_SECRET
TheAPP_SECRET environment variable is the foundation of Zerobyte’s security. It’s used to encrypt sensitive data in the database.
What it encrypts:
- Repository passwords and encryption keys
- Storage backend credentials (S3 keys, SMB passwords, etc.)
- Volume mount credentials
- Session tokens and cookies
- Two-factor authentication secrets
- Length: 32-256 characters
- Type: Random, high-entropy string
- Format: Hex string recommended
Secret Storage Best Practices
-
Never commit secrets to version control
-
Use environment files
-
Use Docker Secrets (production)
-
Use a secrets manager
- HashiCorp Vault
- AWS Secrets Manager
- Azure Key Vault
- 1Password / Bitwarden
Backup Encryption (Restic)
All backups are encrypted by Restic using industry-standard algorithms:- Encryption: AES-256 in counter mode
- Key derivation: scrypt with high parameters
- Authentication: Poly1305-AES
APP_SECRET.
Best practices:
- Use strong, unique passwords for each repository
- Store repository passwords in a password manager
- Download and backup repository passwords from Zerobyte UI
- Test repository password recovery before relying on backups
Network Security
BASE_URL Configuration
TheBASE_URL environment variable controls cookie security and CORS behavior.
HTTP vs HTTPS:
| Protocol | Secure Cookies | CSRF Protection | Session Hijacking Risk |
|---|---|---|---|
| HTTP | ❌ No | ⚠️ Limited | ⚠️ Higher |
| HTTPS | ✅ Yes | ✅ Full | ✅ Lower |
Secure Cookie Configuration
Zerobyte automatically configures cookies based onBASE_URL:
HTTPS (BASE_URL starts with https://):
Secure: true- Cookies only sent over HTTPSSameSite: Lax- CSRF protectionHttpOnly: true- JavaScript cannot access cookies- Cookie prefix:
zerobyte
http://):
Secure: false- Cookies sent over HTTP (local development only)SameSite: Lax- CSRF protectionHttpOnly: true- JavaScript cannot access cookies
Trusted Origins (CORS)
Control which origins can make requests to Zerobyte’s API:- The
BASE_URLorigin - Any origins in
TRUSTED_ORIGINS
Reverse Proxy Setup
When running behind a reverse proxy, ensure proper header forwarding: Nginx:Restrict Network Access
Bind to localhost only:-
SSH tunnel:
-
Cloudflare Tunnel:
-
Tailscale:
Access Control
Rate Limiting
Zerobyte includes built-in rate limiting to prevent brute-force attacks. Enabled by default in production:User Registration
By default, only the first user can register. Additional users must be:- Invited via SSO - Organization admins can invite users
- Enabled by admin - First user can enable open registration
- Automatically assigned
adminrole - Can configure SSO providers
- Can enable/disable registration
- Registration blocked unless:
- Registration is enabled in settings
- User has a valid SSO invitation
Role-Based Access Control
Zerobyte uses organization-based access control: Roles:| Role | Permissions |
|---|---|
| Owner | Full control of organization, cannot be removed |
| Admin | Manage members, SSO, resources |
| Member | View and use organization resources |
- Admin - First user, system-level access
- User - Default role for new users
Credential Management
Secret References
Avoid storing secrets directly in Zerobyte’s database by using secret references: Environment variables:env://S3_ACCESS_KEY_ID
Docker Secrets:
file://s3_secret_key
Benefits:
- Secrets not stored in database (even encrypted)
- Secrets managed by external systems
- Easier rotation and auditing
- Works with secrets managers
Volume Mount Credentials
When configuring SMB, NFS, or other network volumes: Option 1: Store in database (encrypted with APP_SECRET)- Credentials shared across multiple volumes
- Credentials that rotate frequently
- Highly sensitive environments
Container Security
Required Capabilities
Standard setup:- Mount remote filesystems (NFS, SMB, WebDAV, SFTP)
- Required for FUSE operations
SYS_ADMINis a powerful capability- Grants container elevated privileges
- Could potentially be abused if container is compromised
- Use simplified setup if possible (no
SYS_ADMIN) - Restrict network access (localhost only)
- Keep container updated (regular image pulls)
- Monitor container logs
- Use read-only volumes where possible
Volume Security
Read-only mounts:/var/lib/zerobyteon a network share (performance + security)- Entire host filesystem into container
- Docker socket (
/var/run/docker.sock) - not needed
Monitoring & Auditing
Enable Logging
- Authentication attempts
- SSO provider validation
- User registration blocks
- Invalid auth origins
- Backup operations
- Errors and warnings
Security Events
Zerobyte logs security-relevant events:- Failed login attempts
- Invalid SSO provider IDs
- Registration blocks
- Unauthorized access attempts
- Invalid trusted origins
Security Checklist
Deployment
- Generate strong
APP_SECRET(32+ characters) - Backup
APP_SECRETsecurely - Use HTTPS for
BASE_URL - Set appropriate
TRUSTED_ORIGINS - Bind to localhost (if using reverse proxy)
- Enable rate limiting (default in production)
- Set restrictive file permissions on data directory
- Use read-only volume mounts where possible
- Configure reverse proxy with HTTPS
- Enable firewall rules
Operations
- Backup repository passwords
- Test repository password recovery
- Use secret references for credentials
- Rotate secrets periodically
- Monitor logs for suspicious activity
- Keep Docker image updated
- Review user access regularly
- Document disaster recovery procedure
Authentication
- Enable two-factor authentication for users
- Configure SSO providers (if multi-user)
- Disable open registration (if not needed)
- Use strong passwords
- Review organization memberships
- Remove unused accounts
Compliance
Data Encryption
- At rest: All sensitive data encrypted in database (AES-256)
- In transit: HTTPS (when configured)
- Backups: AES-256 via Restic
Data Residency
All application data stored in:/var/lib/zerobyte(SQLite database)- Configured repository backends (you control location)
- Choose repository location based on requirements
- Use regional S3 buckets / storage
- Self-host repositories on-premises
Audit Trail
Zerobyte logs:- User authentication
- Backup operations
- Configuration changes
- Access attempts
Incident Response
Suspected Compromise
-
Immediately:
- Stop the container:
docker compose down - Disconnect from network
- Preserve logs:
docker compose logs zerobyte > incident.log
- Stop the container:
-
Investigate:
- Review logs for unauthorized access
- Check user accounts for suspicious activity
- Verify backup integrity
-
Remediate:
- Generate new
APP_SECRET - Rotate all credentials
- Reset user passwords
- Update container image
- Reconfigure firewall rules
- Generate new
-
Recovery:
- Restore from known-good backup
- Rebuild container with new secrets
- Force all users to re-authenticate
Lost APP_SECRET
What’s affected:- Repository passwords
- Storage backend credentials
- Volume mount credentials
- User 2FA secrets
-
If you have backups of the secret:
- Restore the original
APP_SECRET - Restart container
- Restore the original
-
If the secret is permanently lost:
- Create new repositories with new passwords
- Reconfigure storage backends
- Reconfigure volume mounts
- Users must re-enable 2FA
- Store
APP_SECRETin a password manager - Document secret location
- Include in disaster recovery plan
- Test recovery procedure
