Redis Secure Configuration
Secure configuration recommendations for Redis in HEAL.
Version: Redis 7.x
Setting a Strong Password#
Always set a strong password for your Redis instance.
Risk/Impact#
Risk Rating: High
An easy characteristic password can be decoded easily, which poses significant security risks.
Verification/Implementation steps#
Ensure the password is strong by executing the below command:
consul kv get service/redis/password
SSL Encryption#
Redis supports SSL/TLS out of the box.
Enabling SSL encryption in Redis helps:
- Protect Data in Transit
- Ensure Secure Client-Server Communication
- Comply with Security Standards
Risk/Impact#
Risk Rating: High
SSL encryption is used in Redis to secure data transmitted between HEAL modules and Redis.
Verification/Implementation steps#
Ensure the SSL Encryption is as follows:
1. Check Redis logs for SSL connection messages:
nomad logs -f -job redis | grep -i TLS
2. Use OpenSSL to test the connection:
openssl s_client -connect <redis-host>:<redis-port> -CAfile <A1HOME>/Appsone_Services/data/cert/appnomic-rootca.crt
Firewall Configuration#
Use firewall rules to restrict access to your Redis instances. Allow only trusted IPs to connect to Redis ports.
Risk/Impact#
Risk Rating: High
If firewall rules are not enforced to restrict Redis access to trusted IPs, then the risk of unauthorized access and exploitation of Redis vulnerabilities will increase.
Verification/Implementation steps#
Ensure the firewall configuration is secured by the following steps:
- To allow a trusted IP address to connect to a Redis port (repeat for each trusted IP address, including every HEAL node that connects to Redis, and for each Redis port):
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="<trusted-ip>" port port="<redis-port>" protocol="tcp" accept'
- If the Redis port is open to all addresses, remove that rule:
firewall-cmd --permanent --remove-port=<redis-port>/tcp
- To apply the rules and check them:
firewall-cmd --reload
firewall-cmd --list-rich-rules
Enabled Redis Cluster#
Enabling the Redis cluster is known as high availability (HA).
Risk/Impact#
Risk Rating: Medium
If the Redis cluster is not enabled, then it affects load balancing, effective data durability, fault tolerance, scalability, and data redundancy.
Verification/Implementation steps#
Ensure that the Redis cluster is enabled by the following steps:
1. Log in to Redis Docker container:
docker exec -it <redis container ID> bash
2. Log in to Redis CLI:
redis-cli -p <redis-port>
3. To check the Redis cluster status/node info, execute the below command:
cluster info
Or
cluster nodes