Deployment hardening
Harden secrets, transport, headers, origins, network exposure, sessions, and operational access.
Transport and proxy
- Serve the public origin over HTTPS.
- Set exact public base URLs after the final proxy hostname is known.
- Keep PostgreSQL, Valkey, SearXNG, and normally the API off the public network.
- Test streaming through the proxy.
Browser security
Enable and validate SECURITY_CSP_ENABLED and the configured CSP value. Enable HSTS only after HTTPS works across the intended domain scope. Set CORS_ORIGINS to exact trusted origins and avoid wildcard origins with credentials.
Secrets
Use high-entropy values for database, JWT, encryption, bootstrap, Entra, search, and provider secrets. Do not commit .env, log secrets, or paste credentials into tickets. Back up CREDENTIAL_ENCRYPTION_KEY securely.
Authentication and abuse controls
Disable self-registration unless needed. Require MFA for privileged local users. Set appropriate normal and authentication rate limits. Choose a session duration with JWT_EXP_MINUTES that matches the environment's risk.
Network isolation
If the API should not have general internet access, run the search broker on a separate controlled host and allow only approved identity, provider, and update endpoints from the relevant services.