Implementing proper authentication and access control is essential for securing your Redis environment. This section covers password management and role-based access control configuration for Redis instances.
Redis 5.0 supports only basic password authentication with a single credential set, while Redis 6.0 and later versions implement a comprehensive Access Control List (ACL) system that supports multiple users with granular permissions. Redis 6.0+ maintains the default user for backward compatibility with legacy clients.
The following methods allow you to view all users associated with a Redis instance.
Redis instances (version 6.0+) utilize the RedisUser
Custom Resource (CR) to manage user accounts. To list all users associated with a specific instance:
For example, to list all users for the instance named s6
:
The output fields provide the following information:
Field | Description |
---|---|
NAME | The RedisUser custom resource identifier |
INSTANCE | The associated Redis instance name |
USERNAME | The username registered within Redis |
PHASE | The synchronization status:
|
Each Redis instance includes a built-in operator user that is automatically provisioned during instance creation. This system account has comprehensive permissions (including user management capabilities) and is secured with a complex 64-character password.
This account is reserved exclusively for system operations and should never be used for application access. Any modification to this account's configuration may cause severe instance instability and potentially lead to unrecoverable failure states.
The following procedures allow you to update user passwords for enhanced security. Regular password rotation is recommended as a security best practice.
The following operations apply only to Redis 6.0 or later versions. For Redis 5.0, refer to the "Redis 5.0 CLI" tab.
Identify the target user from the RedisUser list.
For this example, we'll update the password for the default
user of instance s6
.
Retrieve the RedisUser resource to identify the associated password Secret:
From the spec.passwordSecrets[0]
field, we can see that the password is stored in the Secret redis-s6-2hqxb
.
Note: The
password
key is a reserved field name utilized by the Redis Operator. Its value is stored as a base64-encoded string.
After updating the password, the RedisUser resource will temporarily enter the Pending
state while the change propagates to all Redis nodes. Once synchronized, the status will return to Success
.
Redis 6.0+ supports fine-grained access control through its ACL system. The platform provides predefined permission profiles for common use cases:
Permission Profile | ACL Rules | Description |
---|---|---|
NotDangerous | +@all -@dangerous ~* | Grants access to all commands on all keys except those classified as potentially dangerous operations |
ReadWrite | -@all +@write +@read -@dangerous ~* | Permits read and write operations on all keys while blocking dangerous commands |
ReadOnly | -@all +@read -keys ~* | Restricts access to read-only operations on all keys |
Administrator | +@all -acl ~* | Provides comprehensive access to all Redis functionality except ACL management commands |
For advanced use cases, custom ACL rules are supported. Refer to the Redis ACL Documentation for detailed syntax and capabilities.
Note: All permission profiles, including custom ones, explicitly revoke ACL management permissions. User modifications must be performed through the platform's user management interfaces.
After successful creation, the user randomly enters the Pending
state. Wait for it to change to the Success
state, indicating that the update has been successful.
Create for the Redis cluster instance.