Fix: Consumer PII sent to MySQL over an unencrypted connection and written to DEBUG SQL logs - #312
WesternConcrete wants to merge 2 commits into
Conversation
…mer data Co-Authored-By: Wes Convery <2wconvery@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| logging.level.org.hibernate.SQL=DEBUG | ||
| spring.datasource.url=jdbc:mysql://${DOCKER_HOST_IP:localhost}/ftgo?useSSL=false&allowPublicKeyRetrieval=true | ||
| logging.level.org.hibernate.SQL=WARN | ||
| spring.datasource.url=jdbc:mysql://${DOCKER_HOST_IP:localhost}/ftgo?sslMode=REQUIRED |
There was a problem hiding this comment.
There was a problem hiding this comment.
Correct that sslMode=REQUIRED is encryption without server authentication. I kept it at REQUIRED deliberately rather than moving to VERIFY_CA/VERIFY_IDENTITY, because verification needs trust material this repo does not have:
- The bundled server's certificate is auto-generated per container by the MySQL entrypoint (self-signed, CN
MySQL_Server_..._Auto_Generated_Server_Certificate), so there is no stable CA to pin andVERIFY_IDENTITYwould fail hostname matching againstmysql. - Making verification work requires a committed dev CA plus a server cert issued for the
mysqlhostname and a client truststore (trustCertificateKeyStoreUrl) — and, for real deployments, per-environment CA distribution rather than anything checked into the repo.
That is a separate change with its own surface (cert lifecycle, truststore wiring for both the app and Flyway, k8s/deployment config), so this PR closes the plaintext-transit gap and leaves identity verification as follow-up. Happy to do it here instead if you'd prefer it in scope.
Co-Authored-By: Wes Convery <2wconvery@gmail.com>
Summary
Finding: Consumer PII sent to MySQL over an unencrypted connection and written to DEBUG SQL logs (COMPLIANCE / NS terms — data-flow and boundary gap) in COG-GTM/ftgo-monolith.
Consumer names (
PersonName) and delivery addresses (Address) crossed the app→MySQL link in cleartext, and Hibernate mirrored the same statements into application stdout, which the container log pipeline collects. Fix requires TLS on every app-owned datasource URL and drops SQL statement logging:allowPublicKeyRetrievalis removed rather than kept: it only exists to letcaching_sha2_passwordauth fall back over an insecure channel, whichsslMode=REQUIREDmakes unnecessary. Test-scoped properties are left untouched.Link to Devin session: https://app.devin.ai/sessions/7c734a49fa1849bc9ef496bfc9c72d10
Open in Devin Desktop: https://app.devin.ai/desktop/session/7c734a49fa1849bc9ef496bfc9c72d10?variant=devin
Requested by: @WesternConcrete