No it's not. It's secure but not reliable, your ssh tunnel will disconnect at some point. Use firewall and/or native security.
Re:Secure your MongoDB, Redis, etc
by statictype on Tuesday December 27, 2016 @10:26AM
(#13263631)
Thanks!
I read somewhere that this was a good way to secure redis for compliances. Good to know it may not always work.
That's what the firewall is for. I set up iptables rules on all machines that only allow fixed IPs on the local network access to specific ports.
If you're running it over the public 'net, then I think Mongo and Redis allow for username/passwords and/or encrypted transit.
Is it viable to use an SSH tunnel with each service listening on localhost alone and using an encrypted tunnel to send data?