Security Overview
A production Edge Server deployment should implement multiple layers of security:- Transport Security: TLS/HTTPS encryption for all network traffic
- Authentication: API key authentication for HTTP endpoints
- Authorization: Permission-based access control
- Network Security: Proper firewall rules and network isolation
- Monitoring: Audit logging and health checks
TLS/HTTPS Configuration
TLS encrypts network traffic between clients and your Edge Server, preventing man-in-the-middle attacks and eavesdropping. Always use TLS in production deployments.Certificate Requirements
Edge Server requires:- A valid TLS certificate file in PEM format (typically
.pemor.crtextension) - The corresponding private key file in PEM format (typically
.pemor.keyextension)
- Match your server’s domain name or IP address
- Be signed by a trusted Certificate Authority (CA) for production
- Have appropriate key strength (2048-bit RSA minimum, 256-bit ECDSA recommended)
Obtaining TLS Certificates
Option 1: Let’s Encrypt (Recommended for Production)
Let’s Encrypt provides free, automated TLS certificates trusted by all major browsers. Using Certbot: Follow the official Certbot documentation to install Certbot and generate certificates for your domain. Select your web server type and operating system for specific instructions. After generating certificates with Certbot, they will typically be located at:- Certificate:
/etc/letsencrypt/live/your-domain.com/fullchain.pem - Private key:
/etc/letsencrypt/live/your-domain.com/privkey.pem
Let’s Encrypt certificates expire after 90 days. Follow the Certbot renewal documentation to set up automatic renewal. After renewal, restart Edge Server to load the new certificates.
Option 2: Commercial Certificate Authority
Purchase certificates from providers like DigiCert, GlobalSign, or Sectigo. Follow their documentation to generate a Certificate Signing Request (CSR) and obtain your certificate.Option 3: Self-Signed Certificates (Development Only)
For development and testing environments, you can generate self-signed certificates using OpenSSL. See the OpenSSL documentation for instructions on generating self-signed certificates for your platform. Once you have generated your certificate and key files, configure Edge Server:TLS Configuration Examples
Basic HTTPS Configuration
Certificate Path Options
Certificate paths can be specified as:- Absolute path:
/etc/ssl/certs/cert.pem - Relative to config file:
./certs/cert.pem - Relative to config file:
../certificates/cert.pem
Troubleshooting TLS
Common Issues:-
“No such file or directory” error
- Verify certificate and key file paths are correct
- Check file permissions (Edge Server must be able to read them)
- Use absolute paths if relative paths aren’t working
-
“Invalid certificate” error
- Ensure the certificate matches the private key
- Verify the certificate is in PEM format
- Check certificate hasn’t expired
-
“Connection refused” with HTTPS
- Verify the port is correct
- Check firewall rules allow the HTTPS port
- Ensure no other service is using the port
-
Browser shows “Not Secure” warning
- For self-signed certificates, this is expected
- For production, verify certificate is signed by a trusted CA
- Check certificate Common Name (CN) matches your domain
Client Authentication
Once TLS is configured to encrypt the transport layer, configure client authentication to control who can access your HTTP API endpoints. See the Client Authentication guide for detailed instructions on:- Generating secure API keys
- Configuring identities and permission sets
- Authenticating HTTP requests
- Rotating API keys
- Managing multiple clients
Database Authentication
In addition to HTTP API authentication, Edge Server’s database requires authentication to sync with peers and the cloud. This controls how your Edge Server participates in the Ditto mesh network and what data it can access. See the Database Authentication guide for configuration details on:- Cloud sync mode (connects to Ditto Cloud with webhook provider)
- Small peer only mode (air-gapped local mesh)
- Securing database credentials
- Authentication webhook configuration
Production Security Checklist
Required for Production
- Enable TLS/HTTPS - Use valid certificates from Let’s Encrypt or commercial CA
- Enable HTTP API authentication - Configure API keys and permission sets
- Configure database authentication - Use custom webhook provider (not playground mode) for cloud sync
- Use strong credentials - Generate API keys with the CLI, never manually
- Secure credential storage - Use secrets manager or environment variables for all tokens
- Configure firewall rules - Restrict access to necessary ports only
- Set up monitoring - Use health check endpoint for uptime monitoring
Recommended Best Practices
- Enable rate limiting - Configure throttling to prevent DoS attacks
- Use separate API keys per client - One key per service for easier rotation
- Implement key rotation - Regularly rotate API keys
- Minimize permissions - Use principle of least privilege
- Monitor logs - Review audit logs for suspicious activity
- Keep software updated - Apply Edge Server updates promptly
- Use network isolation - Deploy in private VPC/network when possible
- Configure request limits - Set appropriate max_body_size_mb for endpoints