Authentication
JWT token-based authentication
Local authentication uses JSON Web Tokens:- Tokens are signed with a secret key
- Include user email and tenant name in claims
- Expire after configured time period
- Validated on every request
SyftHub satellite tokens
For marketplace integration:- Issued by SyftHub marketplace
- Contain user identity and permissions
- Validated via public key cryptography
- Short-lived with automatic refresh
Authorization
Tenant isolation
All data is scoped to tenants:Policy-based access control
Endpoints can have access policies: Allow mode (whitelist):Role-based access control
Future enhancement for admin roles:- Owner - Full control
- Admin - Manage endpoints and policies
- User - Query endpoints only
- Viewer - Read-only access
Data protection
Data at rest
SQLite database:- Stored in
~/.syft-space/app.db - File-level encryption supported via OS
- Regular backups recommended
- Data persisted in Docker volumes
- Isolated per tenant
- Cleanup on dataset deletion
Data in transit
HTTPS/TLS:- Use TLS 1.2 or higher
- Use strong cipher suites
- Enable HSTS headers
- Use valid certificates (Let’s Encrypt)
Secrets management
API keys and tokens:- Use secret management tools (Vault, AWS Secrets Manager)
- Rotate API keys regularly
- Use separate keys per environment
- Never log sensitive values
Input validation
Pydantic schemas
All inputs validated:- SQL injection (via SQLModel ORM)
- XSS attacks (via input sanitization)
- Buffer overflows (via length limits)
- Invalid data types
Rate limiting
Protect against abuse:Network security
CORS configuration
Firewall rules
Recommended iptables configuration:Docker socket security
Alternatives:- Docker-in-Docker (DinD)
- Rootless Docker
- Pre-provisioned databases (no dynamic provisioning)
Audit logging
Track all security-relevant events:- Authentication attempts
- Authorization failures
- Endpoint queries
- Policy violations
- Configuration changes
Compliance
GDPR compliance
- Right to access - Users can export their data
- Right to erasure - Users can delete their account
- Data minimization - Only collect necessary data
- Purpose limitation - Data used only as specified
Data retention
Security best practices
Production deployment
Production deployment
- Use HTTPS with valid certificates
- Enable firewall and restrict ports
- Use strong passwords and 2FA
- Keep software updated
- Regular security audits
API keys and secrets
API keys and secrets
- Store in environment variables or secret manager
- Rotate regularly (every 90 days)
- Use separate keys per environment
- Never commit to version control
- Revoke compromised keys immediately
Access control
Access control
- Implement least privilege principle
- Use access policies on all endpoints
- Enable rate limiting
- Monitor for suspicious activity
- Regular access reviews
Data protection
Data protection
- Encrypt data in transit (HTTPS/TLS)
- Encrypt sensitive data at rest
- Regular backups to secure location
- Test restore procedures
- Secure backup storage
Vulnerability reporting
If you discover a security vulnerability:Email security team
Send details to [email protected]
Provide details
Include:
- Description of vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
Responsible disclosure is appreciated. We aim to fix critical vulnerabilities within 30 days.