File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 157
157
impact 1.0
158
158
title 'Use salted MD5 to store postgresql passwords'
159
159
desc 'Store postgresql passwords in salted hash format (e.g. salted MD5).'
160
- describe postgres_session ( USER , PASSWORD ) . query ( 'SELECT passwd FROM pg_shadow;' ) do
161
- its ( 'output' ) { should match ( /^md5\S *$/ ) }
162
- end
163
- describe postgres_conf ( POSTGRES_CONF_PATH ) do
164
- its ( 'password_encryption' ) { should eq 'on' }
160
+ describe command ( 'psql -V' ) do
161
+ case its ( 'output' )
162
+ when /^9/
163
+ describe postgres_session ( USER , PASSWORD ) . query ( 'SELECT passwd FROM pg_shadow;' ) do
164
+ its ( 'output' ) { should match ( /^md5\S *$/ ) }
165
+ end
166
+ describe postgres_conf ( POSTGRES_CONF_PATH ) do
167
+ its ( 'password_encryption' ) { should eq 'on' }
168
+ end
169
+ when /^10/
170
+ describe postgres_session ( USER , PASSWORD ) . query ( 'SELECT passwd FROM pg_shadow;' ) do
171
+ its ( 'output' ) { should match ( /^scram-sha-256\S *$/ ) }
172
+ end
173
+ describe postgres_conf ( POSTGRES_CONF_PATH ) do
174
+ its ( 'password_encryption' ) { should eq 'scram-sha-256' }
175
+ end
176
+ end
177
+ end
165
178
end
166
179
end
167
180
You can’t perform that action at this time.
0 commit comments