Skip to main content

Tracking logins to MySQL, potential breach

Comments

7 comments

  • GoWilkes
    Sorry for 1000 edits on the previous post, I kept getting an error from the forum. Apparently you can't post "var" following by "log" :-/
    0
  • rbairwell
    It seems you have MySQL open to the entire world. This is a security issue as it allows password guessing etc. I would suggest either entirely firewalling it off and changing /etc/my.cnf to only allow localhost/127.0.0.1 access or set your firewall rules up so only specific external addresses can access MySQL directly.
    0
  • cPRex Jurassic Moderator
    I'm not finding any successful logins to the MySQL service when I do a "mysql -u username -p" type of login from the command line, so it looks like those may not be tracked. From what I'm seeing, you would have to enable the General log to see this, which logs EVERYTHING and can take up a lot of space quickly.
    0
  • GoWilkes
    That's unfortunate, @cPRex :-/ @rbairwell, how do you suggest that I tighten it up? I'm using CSF and it looks like the default setting enables ST_MYSQL_USER and ST_MYSQL_HOST to restrict access to "localhost". And I double checked, in WHM there's nothing under "Additional MySQL Access Hosts".
    0
  • quietFinn
    ST_MYSQL_USER

    Those settings in CSF are for CSF's Statistics. If you don't want to allow MySQL connections from outside your server you can close TCP port 3306, and in /etc/my.cnf have line: bind-address=127.0.0.1 (I like to wear a belt and braces) :)
    0
  • GoWilkes
    Is there a way to close the port within WHM, separate from the firewall? I occasionally have to disable the firewall (like when a hosting client is working with an international customer, or a good user is accidentally blocked and I'm trying to track it down), so I'd rather use the firewall as a backup plan rather than the primary.
    0
  • quietFinn
    If you have port 3306 open but have line: bind-address=127.0.0.1 in /etc/my.cnf, then anyone can connect to port 3306, but MySQL is not listening in that port. Well, more precisely, MySQL IS listening in port 3306 but only in address 127.0.0.1.
    0

Please sign in to leave a comment.