Use the mssql_sys_conf Chef InSpec audit resource to test the configuration of a Microsoft SQL Server database.
This resource is distributed along with Chef InSpec itself. You can use it automatically.
You must have database access.
A mssql_sys_conf resource block declares the configuration item, user, and password to test.
describe mssql_sys_conf("CONFIGURATION ITEM TO TEST", user: 'USER', password: 'PASSWORD') do
its("value_in_use") { should cmp "EXPECTED_VALUE" }
its("value_configured") { should cmp "EXPECTED_VALUE" }
end
where:
mssql_sys_conf declares a configuration item, user, and password with permission to use sys.configurations.its('value_in_use') { should cmp 'EXPECTED_VALUE' } compares the current running value of the configuration item against an expected value.its('value_configured') { should cmp 'EXPECTED_VALUE' } compares the saved value of the configuration item against an expected value.mssql_sys_conf is based on the mssql_session resource and accepts all the parameters that mssql_session accepts.
usernameThe user name. Default value: SA.
The following examples show how to use this Chef InSpec audit resource.
describe mssql_sys_conf("clr_enabled", user: 'USER', password: 'PASSWORD') do
its("value_in_use") { should cmp "0" }
its("value_configured") { should cmp "0" }
end
For a full list of available matchers, please visit our matchers page.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/mssql_sys_conf/