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
fix: remove hardcoded password hashes and improve code quality
Security fixes:
- Remove hardcoded password hash from SQL schema (security vulnerability)
- Replace with secure user creation via setup script
- Update all documentation to emphasize secure user creation practices
Code quality improvements:
- Fix SQL schema: use ENUM types and constants instead of duplicated literals
- Fix Dockerfile: sort package names alphabetically and merge RUN instructions
- Fix CI/CD: correct Node.js paths (ui/web -> src/ui/web) and update CodeQL actions
Documentation updates:
- Add security warnings about not hardcoding credentials
- Update README.md, DEPLOYMENT.md, QUICK_START.md, docs/secrets.md
- Emphasize use of setup script for secure user creation
- Add production security best practices
**⚠️ Security Note:** The SQL schema does not contain hardcoded password hashes. Users must be created using the setup script, which generates secure password hashes from environment variables.
69
+
68
70
```bash
69
71
# Activate virtual environment
70
72
source env/bin/activate
71
73
74
+
# Set password via environment variable (optional, defaults to 'changeme' for development)
**⚠️ Security Note:** The SQL schema does not contain hardcoded password hashes. Users are created securely via the setup script using environment variables.
33
+
32
34
**Note:** For detailed setup instructions, see [DEPLOYMENT.md](DEPLOYMENT.md)
**⚠️ Security Note:** The SQL schema (`data/postgres/000_schema.sql`) does not contain hardcoded password hashes. Users must be created using the setup script, which generates secure password hashes from environment variables.
262
+
261
263
```bash
264
+
# Set password via environment variable (optional, defaults to 'changeme' for development)
Copy file name to clipboardExpand all lines: docs/secrets.md
+42-7Lines changed: 42 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,13 +67,48 @@ ERP_API_KEY=your-erp-api-key
67
67
## Security Best Practices
68
68
69
69
1.**Never commit secrets to version control**
70
-
2.**Use secrets management systems in production**
71
-
3.**Rotate credentials regularly**
72
-
4.**Use least privilege principle**
73
-
5.**Enable audit logging**
74
-
6.**Use secure communication protocols**
75
-
7.**Implement proper access controls**
76
-
8.**Regular security audits**
70
+
2.**Never hardcode password hashes in SQL files or source code**
71
+
- Password hashes should be generated dynamically from environment variables
72
+
- Use the setup script (`scripts/setup/create_default_users.py`) to create users securely
73
+
- The SQL schema (`data/postgres/000_schema.sql`) does not contain hardcoded credentials
74
+
3.**Use secrets management systems in production**
75
+
4.**Rotate credentials regularly**
76
+
5.**Use least privilege principle**
77
+
6.**Enable audit logging**
78
+
7.**Use secure communication protocols**
79
+
8.**Implement proper access controls**
80
+
9.**Regular security audits**
81
+
82
+
## User Creation Security
83
+
84
+
### ⚠️ Important: Never Hardcode Password Hashes
85
+
86
+
**The SQL schema file (`data/postgres/000_schema.sql`) does NOT contain hardcoded password hashes or sample user data.** This is a security best practice to prevent credential exposure in source code.
87
+
88
+
### Creating Users Securely
89
+
90
+
Users must be created using the setup script, which:
91
+
- Generates unique bcrypt hashes with random salts
92
+
- Reads passwords from environment variables (never hardcoded)
0 commit comments