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
Copy file name to clipboardExpand all lines: controls/mysql_db.rb
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -54,11 +54,25 @@
54
54
control'mysql-db-05'do
55
55
impact1.0
56
56
title'default passwords must be changed'
57
+
only_if('mysql user table has a password column')do
58
+
command("mysql -u#{user} -p#{pass} mysql -sN -e 'SELECT count(COLUMN_NAME) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = \"mysql\" AND TABLE_NAME = \"user\" AND COLUMN_NAME = \"password\";'").stdout.strip == '1'
59
+
end
57
60
describecommand("mysql -u#{user} -p#{pass} mysql -s -e 'select count(*) from mysql.user where length(password)=0 or password=\"\";' | tail -1")do
58
61
its(:stdout){shouldmatch(/^0/)}
59
62
end
60
63
end
61
64
65
+
control'mysql-db-05b'do
66
+
impact1.0
67
+
title'default passwords must be changed'
68
+
only_if('mysql user table has an authentication_string column')do
69
+
command("mysql -u#{user} -p#{pass} mysql -sN -e 'SELECT count(COLUMN_NAME) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = \"mysql\" AND TABLE_NAME = \"user\" AND COLUMN_NAME = \"authentication_string\";'").stdout.strip == '1'
70
+
end
71
+
describecommand("mysql -u#{user} -p#{pass} mysql -s -e 'select count(*) from mysql.user where length(authentication_string)=0 or authentication_string=\"\";' | tail -1")do
0 commit comments