网络安全系列 之 MySQL数据库安全

数据库安全使用规则

1. 数据库版本及运行要求

  1. 使用稳定的解决了已知漏洞的版本,如5.6.39或5.7.20 (更新 于2018.2)
  2. 以--skip-symbolic-links选项启动数据库:禁止在创建索引和创建表的时候,将索引文件和数据文件链接到其他文件。

2. 通用加固项

  1. 删除冗余数据库, 如test。
    drop database if exists ${dbname};
    
  2. 清除无用用户(没有用户名的用户)。
    drop user ''
    
  3. 修改超级用户的密码。
    set password for <user>@<hostname> = password('<yourpassword>')
    
  4. 配置密码复杂度
    使用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进行登录;

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值