等保稽核 --- MySQL密碼複雜度
阿新 • • 發佈:2020-09-02
環境介紹:
系統版本: Centos 7
MySQL版本: 5.7.19
架構: 主從架構
審計外掛:
validate_password.so(資料庫自帶5.6後版本都擁有此外掛)
操作過程:
1). 安裝validate_password.so
2). 密碼複雜度設定
配置說明:
1). validate-password=ON/OFF/FORCE/FORCE_PLUS_PERMANENT: 決定是否使用該外掛(及強制/永久強制使用)。
2). validate_password_dictionary_file=xxx/xxx/xx:外掛用於驗證密碼強度的字典檔案路徑,策略為STRONG才需要
3). validate_password_policy= 0 #0(LOW), 1 (MEDIUM), 2 (STRONG)
4). validate_password_length = 8 : 密碼最短長度
5). validate_password_mixed_case_count = 1 :大小寫字元長度,至少1個
6). validate_password_number_count = 2 : 數字至少1個
7). validate_password_special_char_count = 1: 特殊字元至少1個
策略 | 檢查規則 |
0 or LOW | Length |
1 or MEDIUM | Length; numeric, lowercase/uppercase, and special characters |
0 or LOW | Length; numeric, lowercase/uppercase, and special characters; dictionary file |
一、 安裝validate_password.so
mysql> install plugin validate_password soname 'validate_password.so' mysql> show plugins; ... validate_password | ACTIVE | VALIDATE PASSWORD | validate_password.so | GPL ... # 檢視預設密碼複雜策略; mysql> show global variables like 'validate%';
二、 密碼複雜度設定
~]# vim /etc/my.cnf # 密碼複雜度審計 plugin-load-add=validate_password.so validate-password=ON validate_password_policy = 1 validate_password_length = 8 validate_password_mixed_case_count = 1 validate_password_number_count = 2 validate_password_special_char_count = 1