Review the Redis firewall address range

Check that Azure Cache for Redis firewall rules allow only required client source addresses, alongside public and private connectivity settings.

Description

An Azure Cache for Redis firewall rule allows every IPv4 address between its start and end, inclusive. For a required public endpoint, a single approved client’s fixed public source address may be enough.

Potential impact

A broad public rule lets unintended clients try to connect. Removing a required address can interrupt an application. Authentication and data permissions still control what a connected client can do.

Remediation

Set start_ip_address and end_ip_address to valid IPv4 addresses in ascending order. Review all rules on the cache and test connections from approved and unapproved sources. For private-only access, configure a supported private path such as Private Link, test it, and check that public access is disabled.

Examples

Both tasks manage myRule on an existing cache. Neither task configures the cache’s public access setting or private connectivity.

Broad IPv4 range

yaml
- name: Create a Firewall rule for Azure Cache for Redis
  azure_rm_rediscachefirewallrule:
    resource_group: myResourceGroup
    cache_name: myRedisCache
    name: myRule
    start_ip_address: 1.2.3.4
    end_ip_address: 2.3.4.5

Narrow private IPv4 range

yaml
- name: Create a Firewall rule for Azure Cache for Redis
  azure_rm_rediscachefirewallrule:
    resource_group: myResourceGroup
    cache_name: myRedisCache
    name: myRule
    start_ip_address: 192.168.1.1
    end_ip_address: 192.168.1.4

Explanation:

  • First example: The range from 1.2.3.4 to 2.3.4.5 allows every address between those two endpoints.
  • Second example: The range from 192.168.1.1 to 192.168.1.4 contains four private addresses. Confirm that the cache sees these sources on the intended network path.

References