Skip to content

remove the sudo command and remove duplicate control #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions controls/postgres_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
impact 1.0
title 'Use stable postgresql version'
desc 'Use only community or commercially supported version of the PostgreSQL software. Do not use RC, DEVEL oder BETA versions in a production environment.'
describe command('sudo -i psql -V') do
describe command('psql -V') do
its('stdout') { should match(/9.[2-5]/) }
end
describe command('sudo -i psql -V') do
describe command('psql -V') do
its('stdout') { should_not match(/RC/) }
its('stdout') { should_not match(/DEVEL/) }
its('stdout') { should_not match(/BETA/) }
Expand Down Expand Up @@ -235,16 +235,7 @@
impact 1.0
title 'We accept one peer and one ident for now (chef automation)'
desc 'We accept one peer and one ident for now (chef automation)'
describe command('sudo -i cat ' + POSTGRES_HBA_CONF_FILE + ' | egrep \'peer|ident\' | wc -l') do
its('stdout') { should match(/^[2|1]/) }
end
end

control 'postgres-14' do
impact 1.0
title 'We accept one peer and one ident for now (chef automation)'
desc 'We accept one peer and one ident for now (chef automation)'
describe command('sudo -i cat ' + POSTGRES_HBA_CONF_FILE + ' | egrep \'peer|ident\' | wc -l') do
describe command('cat ' + POSTGRES_HBA_CONF_FILE + ' | egrep \'peer|ident\' | wc -l') do
its('stdout') { should match(/^[2|1]/) }
end
end
Expand Down