Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bind Redis to localhost and update port mapping #3091

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SamDingore
Copy link

Description 📣

This PR enhances the security of the Redis service in the Infisical Docker setup by binding it strictly to 127.0.0.1.

Problem

Currently, the Redis service is exposed to the public internet due to the default ports configuration (6379:6379). This can lead to unauthorized access and potential security vulnerabilities, as Redis does not have built-in authentication by default.

Solution

  • Modified the Redis service in docker-compose.yml to bind explicitly to 127.0.0.1, preventing external access.
  • This ensures Redis is only accessible from the local machine while maintaining full functionality within the Docker network.

Why is this Important?

  • Prevents unauthorized access to Redis from external IPs.
  • Mitigates potential security threats where misconfigured Redis instances can expose sensitive data.
  • Aligns with best practices for self-hosted Redis deployments, as recommended in security guidelines.

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

Tested the fix by:

  1. Deploying Infisical with the updated docker-compose.yml.
  2. Verifying that Redis is no longer accessible externally using:
    telnet <SERVER_IP> 6379  # Should fail
  3. Confirming that the backend successfully connects to Redis internally:
    docker exec -it infisical-backend redis-cli -h infisical-dev-redis ping
    Expected output: PONG

Redis is fully functional internally but no longer exposed publicly.


This fix is crucial for securing Redis in Infisical deployments, especially for self-hosted users. Please review and merge at the earliest convenience. 🚀

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.

1 participant