security_monkey
security_monkey copied to clipboard
SSL Redis isn't usable
IF you setup Redis with SSL, celery (e.g. scheduler/workers) won't be able to connect to it and get failures in the logs. E.g.
[2019-02-19 18:47:50,400: ERROR/MainProcess] consumer: Cannot connect to redis://***:6379/0: Error while reading from socket: ('Connection closed by server.',).
Trying again in 6.00 seconds...
Should be able to adjust the celeryconfig.py file to be:
broker_url = '{}://{}/{}'.format(
os.getenv('SECURITY_MONKEY_REDIS_PROTOCOL', 'redis'),
os.getenv('SECURITY_MONKEY_REDIS_HOST', 'redis'),
os.getenv('SECURITY_MONKEY_REDIS_DB', '0')
)
Then for those using SSL, set SECURITY_MONKEY_REDIS_PROTOCOL to "rediss" not "redis" and then things seem to work fine.
Can you submit a PR with these changes?
Will do soon as I can get a chance. Was working on some updates to the docker sections - e.g. originally was trying to get running in k8s, though leaning back towards ECS so was creating demo terraform for that.