Skip to content

Commit b9f1bcd

Browse files
authored
Merge pull request #31 from dev-sec/chris-rock/SCRAM-SHA-256
scram sha 256
2 parents b3877b2 + e0b9f55 commit b9f1bcd

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
DevSec PostgreSQL Baseline
2-
==========================
1+
# DevSec PostgreSQL Baseline
32

43
This Compliance Profile ensures, that all hardening projects keep the same quality.
54

@@ -23,12 +22,12 @@ $ inspec exec https://github.com/dev-sec/postgres-baseline
2322

2423
## License and Author
2524

26-
* Author:: Patrick Muench <[email protected] >
27-
* Author:: Dominik Richter <[email protected]>
28-
* Author:: Christoph Hartmann <[email protected]>
29-
* Author:: Edmund Haselwanter <[email protected]>
25+
- Author:: Patrick Muench <[email protected] >
26+
- Author:: Dominik Richter <[email protected]>
27+
- Author:: Christoph Hartmann <[email protected]>
28+
- Author:: Edmund Haselwanter <[email protected]>
3029

31-
* Copyright 2014-2017, The Hardening Framework Team
30+
- Copyright 2014-2019, The DevSec Hardening Framework Team
3231

3332
Licensed under the Apache License, Version 2.0 (the "License");
3433
you may not use this file except in compliance with the License.

controls/postgres_spec.rb

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# encoding: utf-8
22

33
# Copyright 2016, Patrick Muench
4+
# Copyright 2016-2019 DevSec Hardening Framework Team
45
#
56
# Licensed under the Apache License, Version 2.0 (the "License");
67
# you may not use this file except in compliance with the License.
@@ -155,13 +156,23 @@
155156

156157
control 'postgres-06' do
157158
impact 1.0
158-
title 'Use salted MD5 to store postgresql passwords'
159+
title 'Use salted hash to store postgresql passwords'
159160
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' }
161+
case postgres.version
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
165176
end
166177
end
167178

0 commit comments

Comments
 (0)