Learn about Centmin Mod LEMP Stack today
Become a Member

Security Over 6,000 Redis Database Servers Ready for the Taking

Discussion in 'All Internet & Web Performance News' started by Jimmy, Jul 9, 2016.

  1. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:36 PM
    Over 6,000 Redis Database Servers Ready for the Taking

    "The total disregard for any security features in the creation of the Redis database server has come around to haunt the project years after, as Risk Based Security (RBS) reports discovering 6,338 compromised Redis servers."

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    1:36 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Also another reason why a firewall is needed like CSF Firewall which is installed by Centmin Mod out of the box.

    from A few things about Redis security - <antirez> posted 249+ days ago
    Redis Security – Redis

     
  3. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    1:36 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    and New security feature: Redis protected mode. : redis
     
  4. Revenge

    Revenge Active Member

    469
    93
    28
    Feb 21, 2016
    Portugal
    Ratings:
    +354
    Local Time:
    4:36 AM
    1.9.x
    10.1.x
    In terms of security, Memcached does not suffer from similar issues?
     
  5. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    11:36 PM
    I was thinking the same thing earlier, but didn't get a chance to post it yet. I'm not using Redis with IPB.
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    1:36 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    I believe out of box the difference is redis does not bind to 127.0.0.1 unless you enable it in redis.conf while memcached out of box binds to 127.0.01
     
  7. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    1:36 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    i believe redis.conf does now though http://download.redis.io/redis-stable/redis.conf ?

    or it's a redis 3.2+ thing
    Code (Text):
    ################################## NETWORK #####################################
    
    # By default, if no "bind" configuration directive is specified, Redis listens
    # for connections from all the network interfaces available on the server.
    # It is possible to listen to just one or multiple selected interfaces using
    # the "bind" configuration directive, followed by one or more IP addresses.
    #
    # Examples:
    #
    # bind 192.168.1.100 10.0.0.1
    # bind 127.0.0.1 ::1
    #
    # ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
    # internet, binding to all the interfaces is dangerous and will expose the
    # instance to everybody on the internet. So by default we uncomment the
    # following bind directive, that will force Redis to listen only into
    # the IPv4 lookback interface address (this means Redis will be able to
    # accept connections only from clients running into the same computer it
    # is running).
    #
    # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
    # JUST COMMENT THE FOLLOWING LINE.
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    bind 127.0.0.1
    
    # Protected mode is a layer of security protection, in order to avoid that
    # Redis instances left open on the internet are accessed and exploited.
    #
    # When protected mode is on and if:
    #
    # 1) The server is not binding explicitly to a set of addresses using the
    #    "bind" directive.
    # 2) No password is configured.
    #
    # The server only accepts connections from clients connecting from the
    # IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
    # sockets.
    #
    # By default protected mode is enabled. You should disable it only if
    # you are sure you want clients from other hosts to connect to Redis
    # even if no authentication is configured, nor a specific set of interfaces
    # are explicitly listed using the "bind" directive.
    protected-mode yes
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    1:36 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    checking an old copy of my redis 2.8.7 epel installed redis.conf and bind is enabled too
    Code (Text):
    # By default Redis listens for connections from all the network interfaces
    # available on the server. It is possible to listen to just one or multiple
    # interfaces using the "bind" configuration directive, followed by one or
    # more IP addresses.
    #
    # Examples:
    #
    # bind 192.168.1.100 10.0.0.1
    bind 127.0.0.1
    

    So problem that article was suggesting is probably folks who need remote redis server access are disabling bind to 127.0.0.1 and just leaving redis port and server wide open instead of properly firewalling their redis server which is what Redis Security – Redis is outlining

    CSF Firewall has advanced features to just whitelist a specific ip on a specific port CSF - CSF Firewall info | Centmin Mod Community

    i.e.
    # TCP connections inbound to port 6379 on redis server from IP 11.22.33.44 web server. Add to /etc/csf.allow
    Code (Text):
    tcp|in|d=6379|s=11.22.33.44
    

    and then restart csf firewall
    Code (Text):
    csf -r
     
    Last edited: Jul 10, 2016
  9. rdan

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    11:36 AM
    Mainline
    10.2
    I already have this:
    Code:
    # By default Redis listens for connections from all the network interfaces
    # available on the server. It is possible to listen to just one or multiple
    # interfaces using the "bind" configuration directive, followed by one or
    # more IP addresses.
    #
    # Examples:
    #
    # bind 192.168.1.100 10.0.0.1
    # bind 127.0.0.1
    bind 127.0.0.1
    
    
    I'll assume I'm fine with that :D.
     
  10. eva2000

    eva2000 Administrator Staff Member

    55,189
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    1:36 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah bind + csf firewall :)