Add option to enable use of TLS for connection to Redis

未关闭
#672 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
django, python, redis

调研方向

从 purldb_project/settings.py 的第 308-315 行开始,比较其中引用的 DejaCode 和 ScanCode.io 补丁。检查涉及 TLS 的 django-rq 连接选项,然后验证 PurlDB 是否提供可用的 TLS 设置,以及启用该设置后 Redis 连接是否会使用它。

由索引模型根据 Issue 内容生成。

描述

Describe the bug
Currently PurlDB 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 PurlDB 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 PurlDB 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 PurlDB:
https://github.com/aboutcode-org/purldb/blob/e638d183b35c579f56140f453c530f0288fe182d/purldb_project/settings.py#L308-L315

Without either SSL set to True 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

Patches for this have already been added to DejaCode and ScanCode.io:

To Reproduce
See above.

Expected behavior
PurlDB should provide an option to enable TLS for the Redis connection in order protect the confidentiality and integrity of the data transmitted between the systems.

Screenshots
Not applicable

Context (OS, Browser, Device, etc.):
Not applicable

主要语言
HTML
星标
70
派生
74
平均合并
2 天 4 小时
30 天内合并 PR
7

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aboutcode-org/purldb 的其他 Issue

查看 aboutcode-org/purldb 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。