Authentication
User Management
TensorDB provides built-in user authentication with password-based credentials.
-- Create a userCREATE USER alice WITH PASSWORD 'secret123';
-- Change passwordALTER USER alice SET PASSWORD 'newsecret';
-- Disable a userALTER USER alice DISABLE;
-- Grant rolesGRANT admin TO alice;GRANT reader TO bob;
-- Revoke rolesREVOKE admin FROM alice;Session Management
Sessions are token-based with configurable TTL:
- Token-based authentication for API access
- Session expiration with automatic cleanup
- Session revocation for immediate logout
Security Best Practices
- File permissions: Restrict access to the data directory
- Encryption at rest: Enable with
--features encryptionfor AES-256-GCM block-level encryption - Network isolation: When using pgwire server, bind to localhost unless TLS is configured
- Application-level auth: Validate users in your application before database calls
- Audit logging: Enable and monitor the audit log via
SHOW AUDIT LOG