fix: [#277] remove public MySQL port exposure for security#278
Merged
Conversation
MySQL port 3306 was publicly accessible from outside the VM, allowing anyone on the network to connect to the database. This posed a security risk as the database credentials could be brute-forced. Changes: - Removed ports: - "3306:3306" from MySQL service in docker-compose - Added security comment explaining why port is not exposed - Updated unit test to verify port is NOT exposed MySQL remains accessible to the Tracker via Docker's internal database_network, and the healthcheck still works because mysqladmin ping runs inside the container. Closes #277
Member
Author
|
ACK b645f66 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a security vulnerability where MySQL port 3306 was publicly accessible from outside the VM, allowing anyone on the network to connect to the database.
Problem
The MySQL service in the Docker Compose template exposed port 3306 to all network interfaces:
This allowed external connections to the database:
Solution
Removed the
portssection from the MySQL service. The database remains accessible to the Tracker container through Docker's internaldatabase_network, and the healthcheck still works becausemysqladmin pingruns inside the container.Changes
ports: - "3306:3306"from MySQL service indocker-compose.yml.teraVerification
Tested by deploying a MySQL environment and confirming:
nc -zv <VM_IP> 3306times out (port not accessible externally)Related
Closes #277
Issue Specification: docs/issues/277-mysql-port-publicly-exposed.md