简体   繁体   English

加密 Sidekiq 与 Redis 的连接

[英]Encrypt Sidekiq's connection to Redis

We currently have Sidekiq setup with Azure Redis Cache and would like to encrypt the connection between them.我们目前使用 Azure Redis 缓存设置 Sidekiq,并希望加密它们之间的连接。 After a little googling I came across a recently merged pull request that adds native encryption to Redis but this as of yet has not been released.经过一番谷歌搜索后,我发现了一个最近合并的拉取请求,该请求将本机加密添加到 Redis 但这尚未发布。 I have seen people suggest Stunnel but I was wondering if there were any alternatives to this approach?我看到有人建议使用 Stunnel,但我想知道是否有其他方法可以替代这种方法?

Sidekiq uses the redis gem which has SSL/TLS support if you provide a connection URL using the rediss:// scheme (second 's' is not a typo). Sidekiq 使用redis gem,如果您使用rediss://方案提供连接 URL (第二个“s”不是错字),则该 gem 具有SSL/TLS 支持

# https://github.com/redis/redis-rb/blob/1317ecb518c2d0d0263f1cfc49f104cea3ea24b3/lib/redis/cluster/option.rb#L29
class Redis
  class Cluster
    class Option
      DEFAULT_SCHEME = 'redis'
      SECURE_SCHEME = 'rediss'

      # ...

      def secure?
        @node_uris.any? { |uri| uri.scheme == SECURE_SCHEME } || @options[:ssl_params] || false
      end
    end
  end
end

I've used this with AWS ElastiCache which supports in-transit encryption .我已经将它与支持传输中加密的 AWS ElastiCache 一起使用。 The Azure docs suggest Azure Cache has similar SSL capability . Azure 文档建议Azure 缓存具有类似的 SSL 功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM