Skip to content

redis_sentinel: No SSL/TLS support for Sentinel connections #2938

@amendez-primer

Description

@amendez-primer

Problem

In redis_sentinel.py line 33, the Redis connection is created without any SSL/TLS parameters:

redis_conn = redis.StrictRedis(host=host, port=port, password=password, db=0)

This makes it impossible to connect to Redis Sentinel instances that require TLS, which is increasingly common in production environments (e.g. AWS ElastiCache, Azure Cache for Redis, or any hardened deployment).

Expected Behavior

The check should support ssl, ssl_certfile, ssl_keyfile, ssl_ca_certs, and related parameters from the instance config, similar to the core Redis integration.

Suggested Fix

Pass SSL parameters from the instance config through to redis.StrictRedis:

ssl = instance.get('ssl', False)
ssl_kwargs = {}
if ssl:
    ssl_kwargs = {
        'ssl': True,
        'ssl_certfile': instance.get('ssl_certfile'),
        'ssl_keyfile': instance.get('ssl_keyfile'),
        'ssl_ca_certs': instance.get('ssl_ca_certs'),
        'ssl_cert_reqs': instance.get('ssl_cert_reqs', 'required'),
    }

redis_conn = redis.StrictRedis(host=host, port=port, password=password, db=0, **ssl_kwargs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions