数据库安全使用规则
1. 数据库版本及运行要求
- 使用稳定的解决了已知漏洞的版本,如5.6.39或5.7.20 (更新 于2018.2)
- 以--skip-symbolic-links选项启动数据库:禁止在创建索引和创建表的时候,将索引文件和数据文件链接到其他文件。
2. 通用加固项
- 删除冗余数据库, 如test。
drop database if exists ${dbname}; - 清除无用用户(没有用户名的用户)。
drop user '' - 修改超级用户的密码。
set password for <user>@<hostname> = password('<yourpassword>') - 配置密码复杂度
使用validate_password.so插件:
Installing the MySQL Password Validation Plugin
配置后,举例:
mysql> create user testuser;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> CREATE USER 'test'@'localhost' IDENTIFIED BY '123456';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> grant all privileges on *.* to testuser@"%" Identified by "123456";
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> use mysql; update user set password =PASSWORD('123456') where user ='system';
Database changed
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
自问: 使用insert能够绕过 !?
mysql> insert into user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) values('%','testuser','123456','BLOB','BLOB','BLOB');
Query OK, 1 row affected (0.00 sec)
自答:
. insert直接插入的123456虽然可以插入成功但表中保存的应是加密后的内容,不能用123456进行登录;

最低0.47元/天 解锁文章
1334

被折叠的 条评论
为什么被折叠?



