Embucket implements Snowflake’s authentication mechanisms and provides multiple options for securing your deployment. This guide covers authentication methods, token management, and production security recommendations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/embucket/embucket/llms.txt
Use this file to discover all available pages before exploring further.
Authentication Overview
Embucket supports two primary authentication methods:Demo Credentials
Username/password authentication for development and testing environments.
JWT Tokens
JSON Web Token-based authentication for secure production deployments.
Demo User/Password Authentication
Default Credentials
For local development, Embucket provides demo credentials:- Username:
embucket - Password:
embucket
Configuration
Demo credentials are configured at startup:Login Process
When a client connects, they authenticate via the Snowflake login endpoint:JWT Token Configuration
JWT Secret Setup
The JWT secret is used to sign and verify authentication tokens. Set it using environment variables or command-line flags:Generating Secure Secrets
Generate a cryptographically secure JWT secret:JWT Token Properties
Tokens expire after 3 days (259,200 seconds) by default.
Tokens are signed using HMAC-SHA256.
Includes session_id, username, account, database, schema, and host.
Token Anatomy
A decoded JWT token contains:Session Management
Session Creation
Sessions are created upon successful login:- Client sends credentials to
/session/v1/login-request - Embucket validates credentials against configured demo user/password
- A new session is created with a unique session_id
- A JWT token is generated and returned
Session Lifecycle
Sessions remain active as long as:- The JWT token hasn’t expired (3 days)
- The session hasn’t been explicitly deleted
- The Embucket instance is running
Session Termination
Delete a session explicitly:Sessions are stored in-memory and are lost when Embucket restarts.
Query Context
Each query execution carries session context:- Database: Active database for the query
- Schema: Active schema for the query
- Warehouse: Virtual warehouse identifier
- User: Authenticated username
- Request ID: Unique identifier for query tracking
Authorization
Currently, Embucket uses a simplified authorization model:Authenticated users have full access to all databases and schemas
No role-based access control (RBAC) - coming in future releases
All operations are permitted once authenticated
Role and permission management is planned for future releases. Track progress on the Embucket GitHub repository.
Network Security
TLS/HTTPS
For production deployments, use TLS encryption:- Reverse Proxy (Recommended)
- Load Balancer
- API Gateway
Deploy Embucket behind a reverse proxy like Nginx or Traefik:
Network Isolation
Restrict network access to Embucket:Lambda Security
For AWS Lambda deployments:Production Security Best Practices
Rotate Secrets
Regularly rotate JWT secrets and demo credentials. Update all client configurations after rotation.
Use Strong Passwords
Set complex demo passwords with high entropy: uppercase, lowercase, numbers, and symbols.
Enable TLS
Always use HTTPS/TLS in production. Never transmit credentials over unencrypted connections.
Monitor Access
Log authentication attempts and query activity for security auditing.
Limit Exposure
Deploy in private networks with restricted access. Use VPNs or bastion hosts.
Update Regularly
Keep Embucket updated to the latest version for security patches.
Security Checklist
Security Limitations
These features are on the roadmap. See the GitHub issues for status updates.Environment-Specific Security
Development
Staging
Production
Troubleshooting
Authentication fails with correct credentials
Authentication fails with correct credentials
Solution:
- Verify credentials match server configuration:
- Check JWT secret is set:
- Ensure client is sending correct Content-Type header
- Review server logs for authentication errors
JWT token expired errors
JWT token expired errors
Solution:
- Tokens expire after 3 days - re-authenticate to get a new token
- Check system clock synchronization on client and server
- Use the Snowflake CLI which handles token refresh automatically
Invalid JWT signature
Invalid JWT signature
Solution:
- Verify JWT_SECRET matches on server and during token generation
- Don’t change JWT_SECRET while sessions are active
- Restart Embucket and re-authenticate after changing secrets
Connection works locally but fails remotely
Connection works locally but fails remotely
Solution:
- Ensure firewall rules allow inbound connections
- Verify TLS certificate is valid and trusted
- Check if reverse proxy is properly forwarding requests
- Test with curl to isolate client vs server issues:
Next Steps
Deployment Guide
Secure deployment patterns for production
Configuration
Advanced configuration options
Monitoring
Log authentication events and monitor security
API Reference
Programmatic authentication via REST API