SURFscz / SRAM-deploy

Deploy scripts for the SCZ
Apache License 2.0
5 stars 5 forks source link

Add password to redis #327

Closed baszoetekouw closed 1 year ago

baszoetekouw commented 2 years ago

Redis is currently running without authentication. That's not really an issue, as the network is properly secures using security groups . Nevertheless, it adds an extra layer of protection to add a password here.

Taken:

baszoetekouw commented 2 years ago

See https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth.html

baszoetekouw commented 1 year ago

Voor de release moet dit worden gecombineerd met een terraform redis update. (kost ~15m)

baszoetekouw commented 1 year ago

Helaas, er gaat op test nog iets mis: bij het aanzetten van een auth-token zet AWS ook direct TLS aan, en dat snapt SBS nog niet. @mrvanes heb jij tijd om dit te debuggen?
De SBS config van redis staat hier: https://github.com/SURFscz/SBS/blob/main/server/db/redis.py

Vanaf app1-tf1 kan ik de redis bereiken met

redis-cli --tls -h master.sram-tst.ffqqpq.euc1.cache.amazonaws.com -a $PASSWD

Maar in SBS werkt het niet zomaar (zelf niet als ik ssl met de hand aanzet in de SBS code). Vast iets met SSL certificaten.

mrvanes commented 1 year ago

Waarschijnlijk iets met eventlet, monkey_patching en SSL/sockets

baszoetekouw commented 1 year ago

@oharsta @mrvanes hebben we hier inmiddels een oplossing voor? Of duidelijkheid wat het probleem is?

mrvanes commented 1 year ago

Ik niet iig, dus ik ben bang dat het kiezen wordt tussen FlaskIO/eventlet of een password op de redis DB?

oharsta commented 1 year ago

Nieuwe build loopt met daarin https://github.com/SURFscz/SBS/commit/71c33f4cad9eb130228345a7bcbf00c29b026411. Even afwachten

oharsta commented 1 year ago

Helaas. Dat lost het probleem niet op.

baszoetekouw commented 1 year ago

Achterliggende bug in eventlet is deze: https://github.com/eventlet/eventlet/issues/692

Heb daar hulp aangeboden om eventlet te fixen; @mrvanes werkt aan een tijdelijke fix voor SBS.

baszoetekouw commented 1 year ago

werkt!