Closed
Description
ray.init(redis_protected_mode=True)
still allows outside connections to Redis.
Steps to reproduce:
- On remote:
ray.init(redis_protected_mode=True)
- On local:
$ telnet <remote_ip> <redis_port>
Trying 169.229.49.180...
Connected to 169.229.49.180.
Escape character is '^]'.
PING
+PONG
FLUSHALL
+OK
There's 2 causes to the issue:
- The
redis_protected_mode
argument isn't propagated frominit()
inworker.py
tostart_redis()
inservices.py
. This is a quick fix. _make_temp_redis_config()
which sets the Redis configuration binds to the node IP address. According to the Redis documentation, this disables Redis protected mode. Fixing this is more complicated -- because Ray processes connect to Redis via the node IP address, binding Redis to just127.0.0.1
results in connection errors.
Solving this is tricky, but there's a few possible solutions:
- Use Redis protected mode. On every connection, check if the head node IP address == the current node IP address. If so, use
127.0.0.1
. - Simulate Redis protected mode by generating a password for the Redis server. Expose the password to processes on the same node.
Personally, I prefer option (2) because launching Redis with a password seems like a good feature anyway.