You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
infoprint "Skipped due to unsupported feature for MySQL 8.0+";
2258
-
return;
2259
-
}
2260
2256
2261
2257
#exit 0;
2262
2258
if ( $opt{skippassword} eq 1 ) {
@@ -2377,15 +2373,17 @@ sub security_recommendations {
2377
2373
}
2378
2374
2379
2375
# Looking for User with user/ uppercase /capitalise user as password
2380
-
@mysqlstatlist = select_array
2376
+
if ( !mysql_version_ge(8) ) {
2377
+
@mysqlstatlist = select_array
2381
2378
"SELECT CONCAT(QUOTE(user), '\@', QUOTE(host)) FROM mysql.user WHERE user != '' AND (CAST($PASS_COLUMN_NAME as Binary) = PASSWORD(user) OR CAST($PASS_COLUMN_NAME as Binary) = PASSWORD(UPPER(user)) OR CAST($PASS_COLUMN_NAME as Binary) = PASSWORD(CONCAT(UPPER(LEFT(User, 1)), SUBSTRING(User, 2, LENGTH(User)))))";
2382
-
if (@mysqlstatlist) {
2383
-
foreachmy$line ( sort@mysqlstatlist ) {
2384
-
chomp($line);
2385
-
badprint "User " . $line . " has user name as password.";
2386
-
push( @generalrec,
2379
+
if (@mysqlstatlist) {
2380
+
foreachmy$line ( sort@mysqlstatlist ) {
2381
+
chomp($line);
2382
+
badprint "User " . $line . " has user name as password.";
2383
+
push( @generalrec,
2387
2384
"Set up a Secure Password for $line user: SET PASSWORD FOR $line = PASSWORD('secure_password');"
2388
-
);
2385
+
);
2386
+
}
2389
2387
}
2390
2388
}
2391
2389
@@ -2419,44 +2417,46 @@ sub security_recommendations {
2419
2417
my$nbins = 0;
2420
2418
my$passreq;
2421
2419
if (@passwords) {
2422
-
my$nbInterPass = 0;
2423
-
foreachmy$pass (@passwords) {
2424
-
$nbInterPass++;
2425
-
2426
-
$pass =~ s/\s//g;
2427
-
$pass =~ s/\'/\\\'/g;
2428
-
chomp($pass);
2429
-
2430
-
# Looking for User with user/ uppercase /capitalise weak password
2431
-
@mysqlstatlist =
2432
-
select_array
2420
+
if ( !mysql_version_ge(8) ) {
2421
+
my$nbInterPass = 0;
2422
+
foreachmy$pass (@passwords) {
2423
+
$nbInterPass++;
2424
+
2425
+
$pass =~ s/\s//g;
2426
+
$pass =~ s/\'/\\\'/g;
2427
+
chomp($pass);
2428
+
2429
+
# Looking for User with user/ uppercase /capitalise weak password
2430
+
@mysqlstatlist =
2431
+
select_array
2433
2432
"SELECT CONCAT(user, '\@', host) FROM mysql.user WHERE $PASS_COLUMN_NAME = PASSWORD('"
2434
-
. $pass
2435
-
. "') OR $PASS_COLUMN_NAME = PASSWORD(UPPER('"
2436
-
. $pass
2437
-
. "')) OR $PASS_COLUMN_NAME = PASSWORD(CONCAT(UPPER(LEFT('"
2438
-
. $pass
2439
-
. "', 1)), SUBSTRING('"
2440
-
. $pass
2441
-
. "', 2, LENGTH('"
2442
-
. $pass . "'))))";
2443
-
debugprint "There are " . scalar(@mysqlstatlist) . " items.";
2444
-
if (@mysqlstatlist) {
2445
-
foreachmy$line (@mysqlstatlist) {
2446
-
chomp($line);
2447
-
badprint "User '" . $line
2448
-
. "' is using weak password: $pass in a lower, upper or capitalize derivative version.";
2433
+
. $pass
2434
+
. "') OR $PASS_COLUMN_NAME = PASSWORD(UPPER('"
2435
+
. $pass
2436
+
. "')) OR $PASS_COLUMN_NAME = PASSWORD(CONCAT(UPPER(LEFT('"
2437
+
. $pass
2438
+
. "', 1)), SUBSTRING('"
2439
+
. $pass
2440
+
. "', 2, LENGTH('"
2441
+
. $pass . "'))))";
2442
+
debugprint "There are " . scalar(@mysqlstatlist) . " items.";
2443
+
if (@mysqlstatlist) {
2444
+
foreachmy$line (@mysqlstatlist) {
2445
+
chomp($line);
2446
+
badprint "User '" . $line
2447
+
. "' is using weak password: $pass in a lower, upper or capitalize derivative version.";
2449
2448
2450
-
push( @generalrec,
2449
+
push( @generalrec,
2451
2450
"Set up a Secure Password for $line user: SET PASSWORD FOR '"
goodprint "Your innodb_redo_log_capacity is sized to handle more than 1 hour of writes.";
6629
+
if ( hr_raw( $myvar{'innodb_redo_log_capacity'} ) < $hourly_rate ) {
6630
+
badprint
6631
+
"Your innodb_redo_log_capacity is not large enough to hold at least 1 hour of writes.";
6632
+
push( @adjvars,
6633
+
"innodb_redo_log_capacity (>= "
6634
+
. $suggested_redo_log_capacity_str
6635
+
. ")" );
6636
+
}
6637
+
else {
6638
+
goodprint
6639
+
"Your innodb_redo_log_capacity is sized to handle more than 1 hour of writes.";
6620
6640
}
6621
6641
6622
6642
# Sanity check against total InnoDB data size
6623
-
if ( defined$enginestats{'InnoDB'} and$enginestats{'InnoDB'} > 0 ) {
6643
+
if ( defined$enginestats{'InnoDB'} and$enginestats{'InnoDB'} > 0 )
6644
+
{
6624
6645
my$total_innodb_size = $enginestats{'InnoDB'};
6625
-
if ( $suggested_redo_log_capacity_bytes > $total_innodb_size * 0.25 ) {
6626
-
infoprint "The suggested innodb_redo_log_capacity (" . $suggested_redo_log_capacity_str . ") is more than 25% of your total InnoDB data size. This might be unnecessarily large.";
6646
+
if ( $suggested_redo_log_capacity_bytes >
6647
+
$total_innodb_size * 0.25 )
6648
+
{
6649
+
infoprint "The suggested innodb_redo_log_capacity ("
6650
+
. $suggested_redo_log_capacity_str
6651
+
. ") is more than 25% of your total InnoDB data size. This might be unnecessarily large.";
6627
6652
}
6628
6653
}
6629
-
} else {
6630
-
infoprint "Server uptime is less than 1 hour. Cannot make a reliable recommendation for innodb_redo_log_capacity.";
6654
+
}
6655
+
else {
6656
+
infoprint
6657
+
"Server uptime is less than 1 hour. Cannot make a reliable recommendation for innodb_redo_log_capacity.";
6631
6658
}
6632
6659
}
6633
6660
else {
@@ -6648,11 +6675,12 @@ sub mysql_innodb {
6648
6675
. ") if possible, so InnoDB Redo log Capacity equals 25% of buffer pool size."
6649
6676
);
6650
6677
push( @generalrec,
6651
-
"Be careful, increasing innodb_redo_log_capacity means higher crash recovery mean time"
6678
+
"Be careful, increasing innodb_redo_log_capacity means higher crash recovery mean time"
0 commit comments