Before installing Redis, we recommend that you read through the security model of Redis, which is meant to be run within a strictly trusted environment. The below installation, and PANIC in general, takes this security model into account and includes the suggested security boosts.
-
To install Redis server on your system:
- On Linux, run:
sudo apt-get install redis-server # install Redis sudo systemctl enable redis-server.service # set Redis to start on boot
- On Windows, follow the installation steps here
- On Linux, run:
-
To configure Redis:
- First access the
redis.conf
file:- On Linux:
sudo nano /etc/redis/redis.conf
- On Windows: this is in the
conf/
folder of the installation directory.
- On Linux:
- In the
GENERAL
section, add (or uncomment) the linebind 127.0.0.1
to bind Redis only to localhost. This assumes that Redis is installed on the same system that will run the alerter. - In the
SECURITY
section, add (or uncomment) the linerequirepass <PASS>
, where<PASS>
is a complex password of your choosing. The alerter will ask for this password during setup. - In the
SECURITY
section, you can also choose to disable some commands to prevent some actions from taking place. For each command, add a line:rename-command <COMMAND> ""
.- The following commands are not used by PANIC and can thus be disabled:
FLUSHALL
,PEXPIRE
,CONFIG
,SHUTDOWN
,BGREWRITEAOF
,BGSAVE
,SAVE
,SPOP
,SREM
,RENAME
andDEBUG
.
- The following commands are not used by PANIC and can thus be disabled:
- On Linux, restart Redis to apply changes:
sudo service redis-server restart
- First access the
-
To run Redis:
- On Linux, the Redis server should already be running.
- On Windows, run
redis-server.exe
from the installation directory as administrator with the config file as an argument:.\redis-server.exe conf\redis.conf
At the end, you should have:
- Redis server installed, secured, and running.
- Ability to use Redis via the
redis-cli
command.- On Windows,
redis-cli.exe
is found in the installation directory. - To use Redis via the
redis-cli
, remember to authenticate using your password:AUTH <PASSWORD>
. - Note that you do not have to have the cli running for the alerter to work.
- On Windows,
- https://redis.io/topics/security
- https://redislabs.com/blog/3-critical-points-about-security/
- https://www.digitalocean.com/community/tutorials/how-to-encrypt-traffic-to-redis-with-spiped-on-ubuntu-16-04
- https://www.digitalocean.com/community/tutorials/how-to-secure-your-redis-installation-on-ubuntu-14-04
- https://www.digitalocean.com/community/tutorials/how-to-secure-your-redis-installation-on-ubuntu-18-04
- https://stackoverflow.com/questions/40114913/allow-redis-connections-from-only-localhost