Skip to content

Remove hardcoded JWT/session secrets from docker-compose#24

Merged
krellekrelle merged 3 commits into
mainfrom
copilot/investigate-jwt-token-security
May 27, 2026
Merged

Remove hardcoded JWT/session secrets from docker-compose#24
krellekrelle merged 3 commits into
mainfrom
copilot/investigate-jwt-token-security

Conversation

Copilot AI commented May 27, 2026

Copy link
Copy Markdown
Contributor

A real 64-byte JWT secret and a hardcoded SESSION_SECRET were committed directly in docker-compose.yml, exposing them to anyone with repo access.

Changes

  • docker-compose.yml: Replace hardcoded JWT_SECRET across all 5 services (auth-service, landing-page, hello-world-app, hearts-game-service, training-peaks-service) with ${JWT_SECRET}. Remove SESSION_SECRET entirely — no service reads it at runtime (auth-service uses an internal hardcoded string for its short-lived OAuth state session only).
  • .env.example: Document JWT_SECRET as required, with generation instructions (openssl rand -hex 64). Add missing POSTGRES_DB/USER/PASSWORD vars. Drop SESSION_SECRET.
# Before
- JWT_SECRET=7aa5c54ef4656dc9141d86d0448995227515021093db7bad9c10a085bef3b00fab31da0e2bdde0a55b481a66f233127f3c74eeb9cb035595bbfa6f5e478795fd
- SESSION_SECRET=dev-secret-key-change-in-production

# After
- JWT_SECRET=${JWT_SECRET}

The .env file is already git-ignored; operators need to create one with a generated secret.

Copilot AI linked an issue May 27, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix exposed jwt token in docker compose file Remove hardcoded JWT and session secrets from docker-compose.yml May 27, 2026
Copilot AI requested a review from krellekrelle May 27, 2026 12:40
Copilot AI changed the title Remove hardcoded JWT and session secrets from docker-compose.yml Remove hardcoded JWT/session secrets from docker-compose May 27, 2026
@krellekrelle
krellekrelle marked this pull request as ready for review May 27, 2026 15:41
@krellekrelle
krellekrelle merged commit 6de8e67 into main May 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exposed jwt token in docker compose file

2 participants