TLS / Security
ParticleDB supports direct TLS on the PostgreSQL wire, gRPC, and Redis listeners. The built-in HTTP server is plain HTTP today, so if you expose /v1/*, /health*, or /metrics externally, terminate TLS in your reverse proxy or ingress.
TLS Configuration
Section titled “TLS Configuration”Server-side TLS
Section titled “Server-side TLS”-
Generate or obtain certificates
Terminal window openssl req -x509 -newkey rsa:4096 -sha256 -days 365 \-nodes -keyout server.key -out server.crt \-subj "/CN=particledb" \-addext "subjectAltName=DNS:localhost,IP:127.0.0.1" -
Set file permissions
Terminal window chmod 600 server.keychmod 644 server.crt -
Start ParticleDB with TLS
Terminal window particledb start \--tls-cert /path/to/server.crt \--tls-key /path/to/server.keyIn config files, the server reads TLS paths from the network section:
[network]tls_cert_path = "/path/to/server.crt"tls_key_path = "/path/to/server.key"
Client Connections With TLS
Section titled “Client Connections With TLS”psql "postgresql://localhost:5432/particledb?sslmode=require"psql "postgresql://localhost:5432/particledb?sslmode=verify-full&sslrootcert=ca.crt"import psycopg2
conn = psycopg2.connect( host="localhost", port=5432, dbname="particledb", sslmode="require", sslrootcert="/path/to/ca.crt",)Authentication
Section titled “Authentication”ParticleDB supports three auth modes for PG wire and Redis:
| Method | Description |
|---|---|
trust | No password required |
password | Cleartext password exchange |
md5 | MD5 challenge-response |
Configure it with:
particledb start --auth-method password --pg-password mysecretpasswordparticledb start --auth-method md5 --pg-password mysecretpasswordPer-Protocol Notes
Section titled “Per-Protocol Notes”PostgreSQL Wire
Section titled “PostgreSQL Wire”- Direct TLS supported
- Auth:
trust,password,md5
- Direct TLS supported
- Auth header format when enabled:
Authorization: Bearer <username>:<password>Example:
grpcurl \ -cacert ca.crt \ -H "authorization: Bearer admin:secret" \ -import-path proto \ -proto proto/particledb.proto \ -d '{}' \ localhost:26257 \ particledb.v1.ParticleDB/HealthHTTP API
Section titled “HTTP API”- No built-in HTTPS listener today
- No PG/gRPC-style request authentication on
/v1/* - Recommended production pattern: terminate TLS and enforce auth in your reverse proxy / ingress
Example:
client -> https://db.example.com -> reverse proxy -> http://127.0.0.1:8080Redis RESP
Section titled “Redis RESP”- Direct TLS supported
- Auth via
AUTH
redis-cli -p 6379 --tls --cacert ca.crtAUTH mysecretpasswordSecurity Best Practices
Section titled “Security Best Practices”-
Enable TLS in production for PG wire, gRPC, and Redis.
-
Do not use
trustoutside local development. -
Front the built-in HTTP server with your normal reverse proxy if you need HTTPS, auth, rate limiting, or WAF behavior.
-
Bind listeners to specific interfaces when possible.
-
Use Unix sockets for local PG connections when you want the lowest-overhead trusted path.
-
Enable audit logging if you need an in-database activity trail:
Terminal window particledb start --audit-log
Next Steps
Section titled “Next Steps”- Configuration — Full server configuration reference
- PostgreSQL Wire Protocol — Client compatibility and auth behavior
- Connectivity Overview — All live protocols and ports