03 / 04

What is protected-mode in Redis, and when does it activate?

protected-mode yes (default) causes Redis to refuse connections from all addresses except loopback (127.0.0.1) unless either a bind directive is set or a requirepass is configured. It was introduced as a safety net after public internet-exposed Redis instances became a common attack vector. In production, always either bind to a private interface or enable auth — never rely solely on protected-mode.

Difficulty: 5/10
Topics: security, configuration, deployment

Scenario Questions

0-2 years experience
  1. 1

    If you spin up a fresh Redis instance on a public cloud VM without any authentication configured, what will happen when a client tries to connect, and why?

  2. 2

    You need to allow an internal service to write to Redis in a Docker container. How would you configure Redis to permit that while keeping protected-mode enabled?

2-5 years experience
  1. 1

    During a production incident, developers reported that their application suddenly could not write to Redis after a recent config change. The team suspects protected-mode. Walk me through how you would investigate and resolve the issue.

  2. 2

    You are adding TLS to a Redis deployment that currently runs with default settings. Explain how protected-mode interacts with TLS and what configuration steps you must take to ensure the service remains reachable.

5-8 years experience
  1. 1

    Design a multi-tenant Redis architecture for a SaaS platform where each tenant's data must be isolated. Discuss how you would leverage protected-mode, network segmentation, and authentication to prevent cross-tenant access.

  2. 2

    At scale, you notice that some Redis nodes are rejecting connections from legitimate internal services. Analyze how protected-mode could cause this and propose a strategy to safely disable it without exposing the cluster to external attacks.

8+ years experience
  1. 1

    Your organization plans to migrate legacy on-prem Redis clusters to a cloud-managed service. The legacy clusters run with protected-mode disabled. Outline the migration plan, focusing on security hardening, the role of protected-mode, and how to audit that no insecure configurations are introduced.

  2. 2

    As a staff engineer, you need to define a company-wide policy for Redis deployments across many teams. How would you incorporate protected-mode defaults, exceptions, and monitoring into that policy to balance security and operational flexibility?

Follow-up Questions

  • What are the default values for bind and requirepass that trigger protected-mode?
  • Can you disable protected-mode while still keeping the instance secure? How?
  • How does protected-mode interact with TLS or other network security layers?