nchan_redis_discovered_ip_range_blacklist

The nchan_redis_discovered_ip_range_blacklist directive defines a range of IP addresses that are blacklisted for Redis connections in Nchan's pub/sub operations.

Syntaxnchan_redis_discovered_ip_range_blacklist ip_range1 ip_range2 ip_range3 ...;
Defaultnone
Contextupstream
Arguments7

Description

The nchan_redis_discovered_ip_range_blacklist directive is a configuration setting used within the Nchan module to specifically prohibit connections from certain IP address ranges to Redis servers. This is particularly useful in scenarios where Redis is discovered dynamically, such as in cloud environments or when using a service discovery mechanism. By employing this blacklist, administrators can prevent unwanted or malicious Redis clients that fall within specified IP ranges from accessing the pub/sub channels, thus enhancing security and stabilizing the network architecture.

This directive allows for specifying multiple IP address ranges that will be denied access to Redis communication. The argument for this directive can take up to seven parameters, each representing a different IP range. The IP ranges can be defined using CIDR notation, which allows for easy specification of entire networks (for example, 192.168.1.0/24 would block all addresses from 192.168.1.0 to 192.168.1.255). The flexibility to specify multiple ranges allows for comprehensive network management, especially in environments with complex infrastructure setups.

In terms of implementation, this directive is evaluated during the configuration processing phase of the Nginx server startup. When a Redis connection request is made, the Nchan module checks the client's IP address against the ranges specified in the blacklist. If a match is found, the connection is refused, ensuring that these ranges are effectively isolated from the Redis services that the Nchan module utilizes for message brokering.

Config Example

upstream my_redis {
    server localhost:6379;
    nchan_redis_discovered_ip_range_blacklist 192.168.1.0/24 10.0.0.0/8;
}

Make sure to correctly specify IP ranges to avoid blocking legitimate Redis clients.

Check for overlapping ranges to prevent unintentional access issues.

The directive is only effective if Redis is being used as a backend for Nchan.

← Back to all directives