-
Notifications
You must be signed in to change notification settings - Fork 0
Update overlay.rb for SV-261937 #10
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
base: main
Are you sure you want to change the base?
Conversation
Adds overlay logic for SV-261937. Rather than psql --version, it uses SHOW server_version, querying directly into the server. The original STIG assumed a hosted instance, whereby the psql and server versions are stated, but the later won't state with an RDS instance - you'll only get the version of the psql binary on your InSpec runner.
georgedias
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review my updated comment and suggestion.
| end | ||
| end | ||
|
|
||
| control 'SV-261937' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after further reviewing the control, I believe we should change it to the following:
control 'SV-261937' do
min_org_allowed_postgres_version = input('min_org_allowed_postgres_version')
installed_postgres_version = command('psql --version').stdout.split[2]
# If no organization specified postgres version was given, inform the user to manually review the control for proper major and minor release versions
if (min_org_allowed_postgres_version.nil? || min_org_allowed_postgres_version.empty?)
describe "Your installed Postgres version is: #{installed_postgres_version}. You must review this control manually or set / pass the 'min_org_allowed_postgres_version' to the profile. The latest supported releases can be found at http://www.postgresql.org/support/versioning/" do
skip "Your installed Postgres version is: #{installed_postgres_version}. You must review this control manually or set / pass the 'min_org_allowed_postgres_version' to the profile. The latest supported releases can be found at http://www.postgresql.org/support/versioning/"
end
else
sql = postgres_session(input('pg_dba'), input('pg_dba_password'), input('pg_host'), input('pg_port'))
describe sql.query('SHOW server_version;', [input('pg_db')]) do
its('output') { should cmp >= min_org_allowed_postgres_version }
end
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I think this one is ready to merge
| end | ||
| end | ||
|
|
||
| control 'SV-261937' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I think this one is ready to merge
Signed-off-by: skarikar <[email protected]>
Signed-off-by: skarikar <[email protected]>
Adds overlay logic for SV-261937. Rather than psql --version, it uses SHOW server_version, querying directly into the server. The original STIG assumed a hosted instance, whereby the psql and server versions are stated, but the later won't state with an RDS instance - you'll only get the version of the psql binary on your InSpec runner.