Review changes - File renames and copy right line removed from resources for oracle conf resources

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
This commit is contained in:
Nikita Mathur 2021-06-29 12:25:03 +05:30
parent 534f601f52
commit 6ea2023922
7 changed files with 29 additions and 35 deletions

View file

@ -1,17 +1,17 @@
+++
title = "oracle_db_conf resource"
title = "oracledb_conf resource"
draft = false
gh_repo = "inspec"
platform = "os"
[menu]
[menu.inspec]
title = "oracle_db_conf"
identifier = "inspec/resources/os/oracle_db_conf.md oracle_db_conf resource"
title = "oracledb_conf"
identifier = "inspec/resources/os/oracledb_conf.md oracledb_conf resource"
parent = "inspec/resources/os"
+++
Use the `oracle_db_conf` Chef InSpec audit resource to test the system parameters of Oracle.
Use the `oracledb_conf` Chef InSpec audit resource to test the system parameters of Oracle.
### Installation
@ -23,15 +23,15 @@ You must have access to a database user that has access to the `DBA` role.
## Syntax
A `oracle_db_conf` resource block declares user and password to use. It fetches system parameters which are defined in `V$SYSTEM_PARAMETER` database view, and then compares those parameters to the values stated in the test:
A `oracledb_conf` resource block declares user and password to use. It fetches system parameters which are defined in `V$SYSTEM_PARAMETER` database view, and then compares those parameters to the values stated in the test:
describe oracle_db_conf(user: 'USER', password: 'PASSWORD') do
describe oracledb_conf(user: 'USER', password: 'PASSWORD') do
its("config item") { should cmp "value" }
end
### Optional Parameters
`oracle_db_conf` is based on `oracle_session`, and accepts all parameters that `oracle_session` accepts.
`oracledb_conf` is based on `oracledb_session`, and accepts all parameters that `oracledb_session` accepts.
## Examples
@ -39,7 +39,7 @@ The following examples show how to use this Chef InSpec audit resource.
### Test parameters set within the database view
describe oracle_db_conf(user: 'USER', password: 'PASSWORD') do
describe oracledb_conf(user: 'USER', password: 'PASSWORD') do
its("audit_sys_operations") { should cmp "true" }
its("sql92_security") { should cmp "true" }
end

View file

@ -1,17 +1,17 @@
+++
title = "oracle_listener_conf resource"
title = "oracledb_listener_conf resource"
draft = false
gh_repo = "inspec"
platform = "os"
[menu]
[menu.inspec]
title = "oracle_listener_conf"
identifier = "inspec/resources/os/oracle_listener_conf.md oracle_listener_conf resource"
title = "oracledb_listener_conf"
identifier = "inspec/resources/os/oracledb_listener_conf.md oracledb_listener_conf resource"
parent = "inspec/resources/os"
+++
Use the `oracle_listener_conf` Chef InSpec audit resource to test the listeners settings of Oracle DB, typically located at `$ORACLE_HOME/network/admin/listener.ora` or `$ORACLE_HOME\network\admin\listener.ora` depending upon the platform.
Use the `oracledb_listener_conf` Chef InSpec audit resource to test the listeners settings of Oracle DB, typically located at `$ORACLE_HOME/network/admin/listener.ora` or `$ORACLE_HOME\network\admin\listener.ora` depending upon the platform.
### Installation
@ -23,9 +23,9 @@ You must have sufficient permission to access listener settings defined in `list
## Syntax
A `oracle_listener_conf` resource block fetches listeners settings in the `listener.ora` file, and then compares them with the value stated in the test:
A `oracledb_listener_conf` resource block fetches listeners settings in the `listener.ora` file, and then compares them with the value stated in the test:
describe oracle_listener_conf do
describe oracledb_listener_conf do
its('config item') { should eq 'value' }
end
@ -35,7 +35,7 @@ The following examples show how to use this Chef InSpec audit resource.
### Test parameters set within the listener file
describe oracle_listener_conf do
describe oracledb_listener_conf do
its('DEFAULT_SERVICE_LISTENER') { should eq 'XE' }
its('EM_EXPRESS_PORT') { should eq '5500' }
end

View file

@ -84,8 +84,8 @@ require "inspec/resources/npm"
require "inspec/resources/ntp_conf"
require "inspec/resources/oneget"
require "inspec/resources/oracle"
require "inspec/resources/oracle_db_conf"
require "inspec/resources/oracle_listener_conf"
require "inspec/resources/oracledb_conf"
require "inspec/resources/oracledb_listener_conf"
require "inspec/resources/oracledb_session"
require "inspec/resources/os"
require "inspec/resources/os_env"

View file

@ -1,5 +1,3 @@
# copyright: 2015, Vulcano Security GmbH
require "inspec/resources/powershell"
module Inspec::Resources
@ -8,7 +6,7 @@ module Inspec::Resources
supports platform: "unix"
supports platform: "windows"
desc "The 'oracle' resource is a helper for the 'oracle_listener_conf'"
desc "The 'oracle' resource is a helper for the 'oracledb_listener_conf'"
attr_reader :conf_path

View file

@ -1,15 +1,13 @@
# copyright: 2015, Vulcano Security GmbH
require "inspec/resources/oracledb_session"
module Inspec::Resources
class OracleDbConf < Inspec.resource(1)
name "oracle_db_conf"
class OracledbConf < Inspec.resource(1)
name "oracledb_conf"
supports platform: "unix"
supports platform: "windows"
desc "Use the oracle_db_conf InSpec audit resource to test the database settings for Oracle DB"
desc "Use the oracledb_conf InSpec audit resource to test the database settings for Oracle DB"
example <<~EXAMPLE
describe oracle_db_conf(user: 'USER', password: 'PASSWORD') do
describe oracledb_conf(user: 'USER', password: 'PASSWORD') do
its("audit_sys_operations") { should cmp "true" }
its("sql92_security") { should cmp "true" }
end

View file

@ -1,5 +1,3 @@
# copyright: 2015, Vulcano Security GmbH
require "inspec/utils/object_traversal"
require "inspec/utils/simpleconfig"
require "inspec/utils/find_files"
@ -7,13 +5,13 @@ require "inspec/utils/file_reader"
require "inspec/resources/oracle"
module Inspec::Resources
class OracleListenerConf < Inspec.resource(1)
name "oracle_listener_conf"
class OracledbListenerConf < Inspec.resource(1)
name "oracledb_listener_conf"
supports platform: "unix"
supports platform: "windows"
desc "Use the oracle_listener_conf InSpec audit resource to test the listener settings for Oracle DB"
desc "Use the oracledb_listener_conf InSpec audit resource to test the listener settings for Oracle DB"
example <<~EXAMPLE
describe oracle_listener_conf do
describe oracledb_listener_conf do
its('DEFAULT_SERVICE_LISTENER') { should eq 'XE' }
end
EXAMPLE

View file

@ -1,16 +1,16 @@
require "helper"
require "inspec/resource"
require "inspec/resources/oracle_listener_conf"
require "inspec/resources/oracledb_listener_conf"
describe "Inspec::Resources::OracleListenerConf" do
it "verify listener settings of oracle DB in linux" do
resource = MockLoader.new(:centos7).load_resource("oracle_listener_conf", "network/admin/listener.ora")
resource = MockLoader.new(:centos7).load_resource("oracledb_listener_conf", "network/admin/listener.ora")
_(resource.params["DEFAULT_SERVICE_LISTENER"]).must_equal "XE"
_(resource.params["EM_EXPRESS_PORT"]).must_equal "5500"
end
it "verify listener settings of oracle DB in windows" do
resource = MockLoader.new(:windows).load_resource("oracle_listener_conf", "network\\admin\\listener.ora")
resource = MockLoader.new(:windows).load_resource("oracledb_listener_conf", "network\\admin\\listener.ora")
_(resource.params["DEFAULT_SERVICE_LISTENER"]).must_equal "XE"
_(resource.params["EM_EXPRESS_PORT"]).must_equal "5500"
end