This documentation covers security features available in Cellar API v3.2.0+
Cellar is designed with security as a priority.
This page covers security features, best practices, and deployment considerations.
File Upload Security
When using the v2 API for file uploads, Cellar implements several security measures to protect against common attack vectors.
File Size Limits
The APP_MAX_FILE_SIZE_MB configuration setting controls the maximum file size that can be uploaded.
The default of 8 MB is designed to:
Support common use cases (QR codes, screenshots, PDFs, credentials, configuration files)
Remain compatible with AWS Lambda deployments (API Gateway has a 10 MB payload limit)
Prevent denial-of-service attacks via large file uploads
Balance memory usage during encryption (files are buffered in memory)
Files that fit within 8 MB:
QR codes and barcodes (< 1 MB)
Screenshots and compressed images (2-5 MB)
PDFs with text and images (1-6 MB)
Private keys, certificates, and credential files (< 1 MB)
Source code archives and configuration files (1-5 MB)
Short audio recordings (1-2 MB)
Increasing the limit:
For Docker or traditional server deployments, you can increase the limit by setting a higher value.
Note that Lambda deployments are constrained by the API Gateway 10 MB limit.
APP_MAX_FILE_SIZE_MB=20# Increase to 20 MB for Docker deployments
Automatic Security Protections
Cellar automatically applies the following security measures to file uploads and downloads:
Input Validation:
Empty files (0 bytes) are rejected
File size is validated before encryption
Malformed multipart requests are rejected
Download Protection:
Files are served with security headers that prevent common web vulnerabilities:
Content-Type: application/octet-stream - Forces browser to treat all files as downloads
X-Content-Type-Options: nosniff - Prevents MIME type sniffing attacks
Content-Security-Policy: default-src 'none' - Blocks any script execution
Cache-Control: no-store, no-cache, must-revalidate - Prevents caching of sensitive files
File Type Support:
All file types are supported without restrictions.
This provides maximum flexibility for users to share any type of secret.
Recipients are responsible for safely handling downloaded files.
Cellar focuses on secure transmission and storage, not content filtering.
Deployment Best Practices
When deploying Cellar in production, consider these security recommendations:
1. Use HTTPS
Always deploy Cellar behind HTTPS in production.
While Cellar encrypts secrets at rest using your chosen cryptography engine, HTTPS protects secrets in transit between clients and the API.
Configure your reverse proxy or load balancer to:
Terminate TLS with valid certificates
Force HTTPS redirects for HTTP requests
Use strong cipher suites (TLS 1.2+)
2. Configure Appropriate File Size Limits
Set APP_MAX_FILE_SIZE_MB based on your:
Use case: What types of files will users share?
Deployment environment: Are you using Lambda (10 MB limit) or Docker (flexible)?
Available memory: Files are buffered in memory during encryption
Redis capacity: Encrypted files are stored in Redis
3. Monitor Storage Usage
Cellar stores all data in Redis.
Monitor your Redis instance to prevent memory exhaustion:
Track total memory usage
Set up alerts for approaching memory limits
Configure Redis maxmemory policy appropriately
Consider Redis persistence settings based on your durability requirements
4. Implement Rate Limiting
While Cellar implements file size limits, consider adding rate limiting at your reverse proxy or API gateway:
Limit requests per IP address
Limit file uploads per time period
Protect against brute force access attempts
Prevent automated scanning of secret IDs
Popular tools for rate limiting:
nginx limit_req module
AWS API Gateway throttling
Cloudflare rate limiting
Traefik rate limiting middleware
5. Secure Your Cryptography Engine
For HashiCorp Vault:
Use the principle of least privilege for AppRole permissions