SQL Review Configuration
Configure SQL review rules to enforce standards across your team.SQL Review Policy
Configure 200+ linting rules for automated validation
Recommended Rules
Critical Rules (ERROR level):- ❌
DROP DATABASE - ❌
DROP TABLE(without confirmation) - ❌ Missing
WHEREclause inUPDATE/DELETE - ❌
NOT NULLon existing columns without default - ❌ Charset changes on existing columns
- ⚠️ Missing indexes on foreign keys
- ⚠️ Column without comments
- ⚠️ Table without primary key
- ⚠️ Large
INclause (> 1000 items)
- 💡 Consider partitioning for large tables
- 💡 Index naming convention suggestions
Example Policy
Review Severity Levels
Configure how different rule violations are handled:| Level | Behavior | Use Case |
|---|---|---|
| ERROR | Blocks merge | Dangerous operations, critical standards |
| WARNING | Allows merge with approval | Best practices, style guidelines |
| INFO | Informational only | Suggestions, optimization tips |
Security Best Practices
Use Service Accounts
Create dedicated service accounts for CI/CD:- Create service account in Bytebase
- Grant minimum required permissions
- Store token in CI/CD secrets
- Rotate tokens regularly
API Authentication
Learn about service account authentication
Least Privilege Database Access
Configure Bytebase with minimal database permissions: For schema changes:Protect Sensitive Migrations
For migrations containing sensitive data:- Store secrets in secret management systems (AWS Secrets Manager, HashiCorp Vault)
- Reference secrets via environment variables in CI/CD
- Use Bytebase secret integration
Instance Configuration
Configure database connections with secret managers
Secrets Management
Option 1: CI/CD SecretsAudit and Compliance
Enable comprehensive audit logging:- All schema changes
- Who approved changes
- When deployments occurred
- Access to sensitive data
- Policy violations
Audit Log
Configure audit logging for compliance
Network Security
Restrict Bytebase Access:- Use VPN or private networking for production
- Enable IP allowlisting
- Use TLS for all connections
- Implement firewall rules
Role-Based Access Control
Configure appropriate roles:| Role | Permissions | Use Case |
|---|---|---|
| Owner | Full access | Team leads, admins |
| DBA | Schema changes, admin mode | Database administrators |
| Developer | Create issues, query data | Application developers |
| Releaser | Deploy to production | Release engineers |
| Querier | Query data only | Analysts, support |
Roles and Permissions
Configure role-based access control
Code Review Security
Security checklist for PR/MR reviews:- ✅ No hardcoded secrets or passwords
- ✅ No
SELECT *exposing sensitive columns - ✅ Proper
WHEREclauses to prevent mass updates - ✅ No
DROPstatements without explicit approval - ✅ Appropriate indexes to prevent performance issues
- ✅ Data access follows compliance requirements

