Bird
Raised Fist0
Redisquery~20 mins

Network security (bind, protected-mode) in Redis - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Redis Network Security Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding the purpose of the 'bind' directive in Redis

What is the primary purpose of the bind directive in the Redis configuration?

ATo set the data persistence mode for Redis
BTo enable password authentication for Redis clients
CTo configure the maximum number of client connections
DTo specify which network interfaces Redis listens on for incoming connections
Attempts:
2 left
💡 Hint

Think about how Redis controls which IP addresses can connect to it.

❓ query_result
intermediate
1:30remaining
Effect of protected-mode on Redis connection

Given Redis is started with protected-mode yes and no password set, what happens when a client tries to connect from a remote IP?

AThe client connection is refused unless the client is connecting from localhost
BThe client can connect without restrictions
CThe client is prompted for a password
DRedis crashes due to configuration error
Attempts:
2 left
💡 Hint

Consider what protected-mode does when no authentication is configured.

📝 Syntax
advanced
2:00remaining
Identify the correct Redis configuration to bind to localhost and enable protected-mode

Which of the following Redis configuration snippets correctly binds Redis to localhost and enables protected-mode?

A
bind 0.0.0.0
protected-mode no
B
bind 127.0.0.1
protected-mode yes
C
bind localhost
protected-mode yes
D
bind 127.0.0.1
protected-mode no
Attempts:
2 left
💡 Hint

Remember the exact IP format Redis expects for binding and the default protected-mode setting.

❓ optimization
advanced
2:00remaining
Optimizing Redis security for a public server

You want to run Redis on a public server accessible from multiple IPs but want to keep it secure. Which configuration approach is best?

ABind Redis to 0.0.0.0, enable protected-mode, and set a strong password
BBind Redis to 127.0.0.1 only and disable protected-mode
CBind Redis to 0.0.0.0 and disable password authentication
DDisable binding and protected-mode, rely on firewall only
Attempts:
2 left
💡 Hint

Think about how to allow remote access safely.

🔧 Debug
expert
2:30remaining
Diagnosing Redis connection refusal with protected-mode enabled

You configured Redis with bind 0.0.0.0 and protected-mode yes. Remote clients cannot connect. What is the most likely cause?

ARedis is not running on the server
BThe bind directive is invalid and causes Redis to crash
CProtected-mode blocks remote connections because no password or ACL is set
DFirewall is blocking localhost connections
Attempts:
2 left
💡 Hint

Consider how protected-mode behaves with open binding and no authentication.

Practice

(1/5)
1. What is the main purpose of the bind configuration in Redis?
easy
A. To configure the Redis password
B. To enable data encryption for Redis connections
C. To set the maximum number of client connections
D. To specify which IP addresses can connect to the Redis server

Solution

  1. Step 1: Understand the role of bind in Redis

    The bind setting restricts Redis to listen only on specified IP addresses.
  2. Step 2: Compare other options

    Encryption, max clients, and password settings are handled by other configurations, not bind.
  3. Final Answer:

    To specify which IP addresses can connect to the Redis server -> Option D
  4. Quick Check:

    bind controls allowed IPs [OK]
Hint: Remember: bind = allowed IP addresses [OK]
Common Mistakes:
  • Confusing bind with password setting
  • Thinking bind enables encryption
  • Assuming bind sets max clients
2. Which of the following is the correct way to disable protected mode in the Redis configuration file?
easy
A. protected-mode no
B. protected_mode no
C. protected-mode yes
D. disable-protected-mode true

Solution

  1. Step 1: Identify correct syntax for protected mode setting

    The correct syntax uses a hyphen and accepts 'yes' or 'no' values: protected-mode no disables it.
  2. Step 2: Eliminate incorrect options

    Options with underscores or 'disable-' prefix are invalid in Redis config.
  3. Final Answer:

    protected-mode no -> Option A
  4. Quick Check:

    Disable protected mode with protected-mode no [OK]
Hint: Use hyphen and 'no' to disable protected mode [OK]
Common Mistakes:
  • Using underscore instead of hyphen
  • Writing 'disable-protected-mode' which is invalid
  • Setting 'protected-mode yes' to disable
3. Given this Redis config snippet:
bind 127.0.0.1
protected-mode yes

Which clients can connect to the Redis server?
medium
A. Only clients connecting from localhost (127.0.0.1)
B. Any client on the network can connect
C. No clients can connect because protected mode is enabled
D. Only clients with a password can connect

Solution

  1. Step 1: Analyze the bind setting

    Binding to 127.0.0.1 means Redis listens only on localhost, so only local clients can connect.
  2. Step 2: Understand protected-mode effect

    Protected mode 'yes' prevents external access if no password or bind is not localhost, but here bind restricts to localhost anyway.
  3. Final Answer:

    Only clients connecting from localhost (127.0.0.1) -> Option A
  4. Quick Check:

    bind localhost + protected-mode yes = local clients only [OK]
Hint: bind localhost + protected-mode yes = local access only [OK]
Common Mistakes:
  • Thinking protected mode blocks all connections
  • Assuming any network client can connect
  • Confusing password requirement with protected mode
4. You set bind 0.0.0.0 and protected-mode no in your Redis config. What is the main security issue with this setup?
medium
A. Redis will only accept connections from localhost
B. Redis will reject all connections due to conflicting settings
C. Redis will be open to all network clients without protection
D. Redis will require a password for all connections

Solution

  1. Step 1: Understand bind 0.0.0.0 meaning

    Binding to 0.0.0.0 means Redis listens on all network interfaces, allowing any IP to connect.
  2. Step 2: Effect of disabling protected mode

    Protected mode off disables safety checks, so no restrictions or warnings prevent unauthorized access.
  3. Final Answer:

    Redis will be open to all network clients without protection -> Option C
  4. Quick Check:

    bind all + protected-mode no = open and unsafe [OK]
Hint: bind all + protected-mode no = open to everyone [OK]
Common Mistakes:
  • Thinking Redis blocks connections with these settings
  • Assuming password is required automatically
  • Believing protected mode disables binding
5. You want your Redis server to accept connections only from two IP addresses: 192.168.1.10 and 10.0.0.5, and ensure it is protected from unauthorized access. Which configuration is correct?
hard
A. bind 0.0.0.0\nprotected-mode no
B. bind 192.168.1.10 10.0.0.5\nprotected-mode yes
C. bind 192.168.1.10\nprotected-mode no
D. bind 10.0.0.5\nprotected-mode yes

Solution

  1. Step 1: Set bind to specific IP addresses

    Using bind 192.168.1.10 10.0.0.5 restricts Redis to listen only on these two IPs.
  2. Step 2: Enable protected mode for safety

    Setting protected-mode yes adds an extra layer of protection against unauthorized access.
  3. Final Answer:

    bind 192.168.1.10 10.0.0.5\nprotected-mode yes -> Option B
  4. Quick Check:

    Bind specific IPs + protected mode yes = secure setup [OK]
Hint: Bind only allowed IPs and keep protected mode on [OK]
Common Mistakes:
  • Binding to all IPs with protected mode off
  • Binding only one IP when two are needed
  • Disabling protected mode when security is required
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard