forked from 0xWheatyz/SPARC
Replace hardcoded DB credentials in docker-compose.yml with .env file reference #926
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
docker-compose.ymlembedspostgres:postgrescredentials in plain text. Anyone with read access to the file (or the repository) obtains working database credentials.Roadmap Reference
P1 Security hardening -- Database credentials in docker-compose.yml (ROADMAP.md)
What to do
.env.example(or extend it if it already exists) withPOSTGRES_USER,POSTGRES_PASSWORD, andPOSTGRES_DBplaceholders.docker-compose.ymlto reference${POSTGRES_USER},${POSTGRES_PASSWORD}, and${POSTGRES_DB}..envis already in.gitignore; add it if it is not..env.exampleto.envbefore runningdocker compose up.Acceptance criteria
docker-compose.ymlcontains no literal credential values.docker compose configresolves correctly when.envis populated from.env.example..envis present in.gitignore.This issue has been resolved.
docker-compose.ymluses environment variable references (${POSTGRES_USER},${POSTGRES_PASSWORD},${POSTGRES_DB}) instead of hardcoded credentials. Users set these via a.envfile. Closing as completed.