Skip to content

Bug: ScanCode.io does not allow to use TLS for Redis connection #1465

@rogu-beta

Description

@rogu-beta

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions