Redis user permissions (ACL) and python connection
Recently, I was working on setting up a redis cluster along with separate users for readwrite and readonly. I setup the readonly user using the below privileges (ACLs): user redisreadonly on >mySuperSecretPassword ~* resetchannels -@all +@read +ping +asking Once this is setup, I wrote a simple program in python to connect to the redis cluster using the readonly credentials and print the number of keys. #!/usr/bin/env python3 """ pip3 install redis """ from redis.cluster import RedisCluster, ClusterNode # ─────── Cluster connection ─────── startup_nodes = [ ClusterNode("redis_host_1", 6379), ClusterNode("redis_host_2", 6379), ClusterNode("redis_host_3", 6379) ] rc = RedisCluster(startup_nodes=startup_nodes,decode_responses=True,username='redisreadonly',password='mySuperSecretPassw...
Comments
I am the author of ModSecurity.
Although you can use the bundled version, I would advise you to upgrade to the latest branch (currently 2.5.5), which is superior to 1.8.x in many, many ways.