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 PostgreSQL credential security issues and naming inconsistencies
The previous PostgreSQL setup had several security and consistency
problems:
Security issues:
1. POSTGRESQL_ADMIN_PASSWORD was set, making the postgres superuser
accessible remotely (not just locally via `oc rsh` + `psql`). [1]
2. Both lightspeed-stack and llama-stack were connecting as the postgres
superuser rather than a dedicated non-admin user.
3. The postgres superuser username usage was hardcoded and credential
paths into the app and db pods were inconsistent.
Naming/consistency issues:
4. lightspeed-stack used database "postgres" while llama-stack used
"llamastack", with no explicit database name in llama-stack's config.
5. POSTGRES_USER/POSTGRES_PASSWORD env var names did not follow the
POSTGRESQL_* convention of the PostgreSQL container image and also
the usage of these env vars was insonsistent across the operator
code.
6. Bootstrap SQL was embedded in postgres_bootstrap.sh, making it hard
to read and maintain.
Fixes:
- Remove POSTGRESQL_ADMIN_PASSWORD. The postgres superuser is now only
accessible locally via `oc rsh` + `psql` (no password required).
- Introduce a dedicated non-admin user "lightspeed-app-user", stored in
lightspeed-postgres-secret alongside the password. Both apps now
connect as this user via POSTGRESQL_USER and POSTGRESQL_PASSWORD.
- Rename the lightspeed-stack database from "postgres" to
"lightspeed-stack" and make llama-stack's "llamastack" database
selection explicit in its config.
- Rename POSTGRES_USER/POSTGRES_PASSWORD ->
POSTGRESQL_USER/POSTGRESQL_PASSWORD throughout to match the container
image's naming convention.
- Extract bootstrap SQL into postgres_bootstrap.sql to enable syntax
highlighting and improve maintainability.
[1]
https://github.com/sclorg/postgresql-container/blob/master/src/root/usr/share/container-scripts/postgresql/README.md#postgresql-admin-account
0 commit comments