You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
security: remove hardcoded secrets, add secure defaults and CI/CD workflows
- Replace hardcoded JWT secret/encryption key with env-var loading + auto-generated random fallback
- Remove hardcoded admin/admin1234 credentials, add CLI-based admin creation with password policy
- Fix deterministic salt in encryption to use os.urandom()
- Fix CORS wildcard to configurable origins
- Add nightly.yml and weekly.yml CI/CD workflows with security scanning
- Update README with security configuration section
|`EDB_JWT_SECRET`|**Required.** Secret key for JWT signing. If not set, a random key is generated per session (tokens won't persist across restarts). |
151
+
|`EDB_ENCRYPTION_KEY`|**Required.** Key for AES-256-GCM encryption at rest. If not set, a random key is generated (encrypted data won't be recoverable after restart). |
152
+
|`EDB_CORS_ORIGINS`| Comma-separated allowed origins. Defaults to `http://localhost:3000`. |
153
+
154
+
### Admin User Setup
155
+
156
+
Admin users are **not** auto-created. Use the CLI to create one:
157
+
158
+
```bash
159
+
edb admin create --username admin
160
+
# You'll be prompted for a password interactively.
161
+
# Password must be 12+ chars with uppercase, lowercase, digit, and special char.
138
162
```
139
163
164
+
### Security Best Practices
165
+
166
+
- Always set `EDB_JWT_SECRET` and `EDB_ENCRYPTION_KEY` in production
167
+
- Use strong, unique values (e.g., `openssl rand -base64 48`)
168
+
- Never commit `.env` files to version control
169
+
- Restrict CORS origins to your actual frontend domains
170
+
- Review audit logs regularly via `/admin/audit` endpoint
171
+
172
+
See [SECURITY.md](SECURITY.md) for vulnerability reporting.
173
+
140
174
## Development
141
175
142
176
### Python Backend
@@ -180,10 +214,6 @@ ruff format src/ tests/
180
214
181
215
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
182
216
183
-
## Security
184
-
185
-
See [SECURITY.md](SECURITY.md) for vulnerability reporting and security best practices.
0 commit comments