We recommend using Redis as a message broker for Security Monkey. If deployed on AWS, it's best to make use of AWS ElastiCache.
This will outline some directions on what you will need to have set-up.
Similar to the setup for RDS, you will need to make a security group for ElastiCache.
- Create a security group named
securitymonkey-cache
that lives in the same VPC and region as the existingsecuritymonkey
security group created. - In the security group, add a new rule to permit
securitymonkey
ingress on TCP port 6379
Go to the AWS console to create an AWS ElastiCache Cluster. We are going to create a cluster in the same VPC and region that Security Monkey resides.
- Create a Redis Cluster. Most of the defaults are fine. However, you will likely not need something massive. A standard M3 medium should be fine for the majority of use cases.
- For Your
Advanced Redis settins
, ensure that it's placed in a subnet group that is within the same VPC as Security Monkey - For
Security
, attach thesecuritymonkey-cache
security group created earlier - For
Backup and Maintenance
, automatic backups are probably not needed. - For
Maintenance
the defaults are sufficient. - Click
Create
- Wait for AWS to provision your cluster.
You will now need to grab the URL to the ElastiCache cluster. Once AWS has completed provisioning your cluster, you will
need find the Primary Endpont
(visible by selecting the cluster in the console), and paste that into
your celeryconfig.py
file. This is the path to the ElastiCache cluster that Celery will use for scheduling and worker management.
For Redis, the path needs to be set for the broker_url
variable in the celeryconfig.py
file needs to be in the format of:
broker_url = 'redis://<COPY-THE-ENDPOINT-PATH-HERE>'
After you make the changes to your Celery configuration, re-deploy Security Monkey.
If the security monkey scheduler and workers hang on start-up, it's likely the security groups are incorrectly configured. Please ensure that the Redis instance has the proper security group attached, and that the security monkey workers and scheduler instances are deployed with a security group that is ingressed properly to the ElastiCache security group.