-
Notifications
You must be signed in to change notification settings - Fork 110
Description
Describe the bug
Currently ScanCode.io does not use TLS when connecting to Redis and does not offer an option to enable it. This is an issue when attempting to deploy ScanCode.io with Redis hosted on a separate system (e.g. a cloud deployment with ElastiCache), unlike the default docker-compose deployment.
The root cause is that ScanCode.io uses django-rq, which disables TLS by default unless specific options are passed.
As can be seen in the following lines, only HOST
, PORT
, PASSWORD
, and DEFAULT_TIMEOUT
are being set by ScanCode.io:
scancode.io/scancodeio/settings.py
Lines 357 to 364 in d3e537a
RQ_QUEUES = { | |
"default": { | |
"HOST": env.str("SCANCODEIO_REDIS_HOST", default="localhost"), | |
"PORT": env.str("SCANCODEIO_REDIS_PORT", default="6379"), | |
"PASSWORD": env.str("SCANCODEIO_REDIS_PASSWORD", default=""), | |
"DEFAULT_TIMEOUT": env.int("SCANCODEIO_REDIS_DEFAULT_TIMEOUT", default=360), | |
}, | |
} |
Without either SSL
or URL
set to contain rediss://
(two s!), it will not use TLS:
https://github.com/rq/django-rq/blob/cd05d2f427e6bd54ce91f78549f05884fa96753e/django_rq/queues.py#L137
System configuration
Not relevant.
To Reproduce
See above.
Expected behavior
ScanCode.io should provide an option to enable TLS for the REDIS connection.
Screenshots
Not applicable.