Commit graph

654 commits

Author SHA1 Message Date
Clinton Wolfe
86e7da02a1
Merge pull request #5664 from inspec/nm/postgres-socket
Add option in `postgres_session` resource to establish socket connection
2021-09-28 00:30:49 -04:00
Vasu1105
63e7eb5395 Fix opa_api and opa_cli resource to handle empty result
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-09-22 16:23:12 +05:30
Vasu1105
cc0d86a185 Add csv without headers support in csv resource
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-09-16 15:56:07 +05:30
Nikita Mathur
bdde8ffc3b Add optional parameter to establish socket based connection with postgres
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-09-16 13:06:07 +05:30
Clinton Wolfe
49cd6883b9
Merge pull request #5589 from collinmcneese/cmcneese/chrony_conf
adds chrony_conf InSpec resource
2021-09-13 14:39:34 -04:00
Clinton Wolfe
ceaef891bb
Merge branch 'main' into nm/oracle-conf 2021-09-13 14:33:51 -04:00
Vasu1105
10d96ece3f Add windows platform support for ibmdb2_conf and ibmdb2_session resource
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-09-01 18:06:16 +05:30
Vasu1105
30ea9cfe57 Add ibmdb2_conf and ibmdb2_session resource
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-09-01 18:06:16 +05:30
Mendy Baitelman
7abebdf80b Merge remote-tracking branch 'upstream/main' into add-http-for-windows-2 2021-08-31 17:08:28 -07:00
Tim Smith
403647c3e4 Fix typos identified by cspell
Just a pile of misc typos

Signed-off-by: Tim Smith <tsmith@chef.io>
2021-08-30 16:49:46 -07:00
Clinton Wolfe
83fcc7fec4
Merge pull request #5629 from inspec/vasundhara/fix_for_security_policy_resource
Fix for security_policy resource does not return array for local groups
2021-08-30 17:17:16 -04:00
Vasu1105
8487da327f Fix for security_policy resource does not return array for local groups
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-08-27 18:34:25 +05:30
Clinton Wolfe
77297cfef0
Merge pull request #5578 from elsnepal/aliyun3
Add aliyun3 support to service resource
2021-08-23 22:49:28 -04:00
Vasu1105
d1bc86a214 Fix postgres_session error Unable to connect to database
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-08-19 14:15:39 +05:30
Clinton Wolfe
dcf49ad510
Merge pull request #5601 from inspec/nm/bug-apache-conf
Fix apache_conf issue when Server Root is not present in configuration
2021-08-17 21:00:38 -04:00
Clinton Wolfe
48c5e22fc0
Merge pull request #5572 from inspec/vasundhara/add_mongodb_session
Add mongodb_session resource and docs.
2021-07-27 22:54:48 -04:00
Clinton Wolfe
e1f63cc7a5
Merge pull request #5592 from inspec/vasundhara/add_OPA_support
Add support for OPA: add resource opa_cli and opa_api
2021-07-27 22:47:23 -04:00
Nikita Mathur
82db157c06 Apache conf doc changes for server root requirement and review changes
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-07-19 17:56:13 +05:30
Vasu1105
6ed14dc7de Fix lint
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-07-19 15:01:31 +05:30
Vasu1105
f0ca02a1c5 Adds unit test for opa_api and opa_cli resource
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-07-19 14:44:47 +05:30
Nikita Mathur
1e8363587e Test case to test apache_conf when server root is not configured
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-07-19 14:41:29 +05:30
Nikita Mathur
89b0f95c75 Using os_env resource to read ORACLE_HOME env in oracle listener conf resource
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-07-09 16:31:45 +05:30
Clinton Wolfe
69213b555b
Merge pull request #5576 from inspec/vasundhara/postgresql_resource_update
Update postgresql resources to normalize it for platform supports
2021-07-08 18:48:04 -05:00
Clinton Wolfe
f22c342704
Merge pull request #5584 from inspec/nm/mssql-port-fix
Remove default port for mssql_session, allowing named connections
2021-07-08 18:39:33 -05:00
Collin McNeese
06eb9b9a84
adds chrony_conf InSpec resource
Signed-off-by: Collin McNeese <cmcneese@chef.io>
2021-07-06 10:46:47 -05:00
Vasu1105
6bfc2fad2f Fixed failing specs
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-07-01 15:28:58 +05:30
Nikita Mathur
46328b4812 Removed default port option to enable using named instances with no port option
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-06-30 17:19:19 +05:30
Nikita Mathur
cb31cefaa2 Review changes - Fetching listener file using env variable
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-06-29 14:43:56 +05:30
Nikita Mathur
6ea2023922 Review changes - File renames and copy right line removed from resources for oracle conf resources
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-06-29 12:25:48 +05:30
Nikita Mathur
f921c25efc Oracle_db_conf and oracle_listener_conf changes, test cases and doc added
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-06-29 12:25:48 +05:30
Clinton Wolfe
61c83d28b3
Merge pull request #5567 from inspec/nm/oracle-session-exception
Oracle Session Exception Handling
2021-06-29 00:47:23 -04:00
Ashish Nepal
80b00794d5 add aliyun3 support 2021-06-26 20:30:57 +01:00
Vasu1105
964a5142f7 Revert changes for password authentication removal
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-25 16:53:49 +05:30
Vasu1105
74cbcc1c5a Removed password authentication as it breaks for windows and it needs to be handle by user using postgress configuration files
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-25 13:29:23 +05:30
Vasu1105
7f7cbf0ddb Add unit test for mongodb_session resource
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-24 12:03:53 +05:30
Nikita Mathur
88641c3fac Fix in oracle command which weren't working in windows powershell
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-06-21 12:09:54 +05:30
Clinton Wolfe
e4c7dea551
Merge pull request #5562 from inspec/vasundhara/add_mongodb_conf_resource
Add support for mongodb_conf resource in InSpec
2021-06-16 22:24:24 -04:00
Nikita Mathur
c28bacdab7 Oracle session exception handling
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-06-16 19:37:58 +05:30
Vasu1105
607d9a1ebc Removed port property
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-15 20:04:00 +05:30
Vasu1105
da00e359aa Add mongodb_conf resource to InSpec
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-14 18:17:05 +05:30
Clinton Wolfe
6080ba3108
Merge pull request #5553 from inspec/vasundhara/fix-postgres-session-resource
Fix postgres_session resource to raise exception if there is a error in connection or in query
2021-06-09 20:50:52 -04:00
Vasu1105
c801a03b88 Fix postgres_session resource to raise exception if database connection is not established due to any reason or there is error with query
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-03 19:11:25 +05:30
Vasu1105
3d31bbf09b Fixed typo
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-03 19:02:43 +05:30
Vasu1105
7d91371d9f Fix mysql_session resource to handle the exceptions if the mysql session is not established. Currently it does not raise any exception due to which the inspec test gives false result
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-02 15:35:23 +05:30
Clinton Wolfe
85ecf5373d
Merge pull request #5522 from inspec/vasundhara/fix-for-port-resource
Fix for port resource performance: adding more specific search while using ss command
2021-05-18 15:37:01 -04:00
Nikita Mathur
8403780995 test case added for file resource when it does not exist
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-05-17 14:02:27 +05:30
Vasu1105
da75f0ce33 Removed old ubuntu version from mock_loader file as it's not getting used and added new version of Ubuntu in mock_loader file.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-05-17 11:28:39 +05:30
Vasu1105
7990b31f5f Updated test to mock the newly added command
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-05-17 11:12:27 +05:30
Kannan Ramakrishnan
d1831a318c Lint errors handled. Signed-off-by: @kannanr <kannaa.ram@gmail.com> 2021-05-15 17:48:19 +05:30
Kannan Ramakrishnan
19c624cf38 Support zfs_pool and zfs_dataset resources on Linux. Handled #5075. Signed-off-by: @kannanr <kannaa.ram@gmail.com> 2021-05-15 12:18:39 +05:30
Nikita Mathur
7693363a1a Fix for default null values compatible for both windows and non-windows system
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-04-28 22:27:30 +05:30
Nikita Mathur
457e544724 Fix for non-existent member for group resource
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-04-28 22:26:33 +05:30
Clinton Wolfe
0fa00ed252
Merge pull request #5479 from inspec/nm/groups-members-fix
Added new property `members_array` for group & groups resources.
2021-04-28 12:33:02 -04:00
Nikita Mathur
b70f3166d4 New property members_array added for group and groups resources and updated documentation
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-04-23 13:48:29 +05:30
Vasu1105
76dca7f97c Adds policy property, unit test and documentation for modules and booleans
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-04-22 11:40:32 +05:30
Vasu1105
58e30cfa81 Review comments fixed
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-04-21 11:43:03 +05:30
Vasu1105
bd9d81314d Integrated review comments
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-04-21 11:43:02 +05:30
Vasu1105
cbe7e8c03f Add selinux resource with basic features support
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-04-21 11:43:02 +05:30
Clinton Wolfe
b3e367da57 Remove default of 3600 seconds for command timeout
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2021-04-20 13:32:33 -04:00
Clinton Wolfe
dfb7f64ba6 Explicitly force default timeout in tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2021-03-29 22:13:11 -04:00
mbaitelman
974d78af76 Add head test
Signed-off-by: mbaitelman <mendy@baitelman.com>
2021-03-09 21:42:50 -08:00
mbaitelman
39c22f4189 cookstyle fixes
Signed-off-by: mbaitelman <mendy@baitelman.com>
2021-03-08 07:02:11 -08:00
mbaitelman
ad1bf219eb Merge remote-tracking branch 'upstream/master' into add-http-for-windows-2
Signed-off-by: mbaitelman <mendy@baitelman.com>
2021-03-08 06:47:36 -08:00
mbaitelman
4ad11e8103 fixed tests
Signed-off-by: mbaitelman <mendy@baitelman.com>
2021-03-07 23:58:50 -08:00
Clinton Wolfe
d22a1bd931 Failing unit test for multiple values in ssh_config
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2021-02-21 15:06:18 -05:00
Clinton Wolfe
10255e4118
Update oracledb_session resource to use more general invocation options 2021-01-24 22:46:07 -05:00
Clinton Wolfe
acc4b412ab Silence linter warning
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-12-21 13:25:04 -05:00
Clinton Wolfe
cdfb325ca3 Apply chefstyle -a, and manually remove duplicate requires
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-12-21 13:25:04 -05:00
Raphael Geissert
4872ddb780 Accept arrays in parse_config's method_missing
A single-element array allows Rspec's its behaviour to be worked around
and allow options containing dots to be tested using its.

This is already implemented by resources such as `json` and those based
on it (e.g. xml).

Related to issue #875.

Signed-off-by: Raphael Geissert <atomo64@gmail.com>
2020-12-08 10:40:51 +01:00
pacopal
28be72d967 Update oracledb_session.rb
Update format_options for sqlplus to support all versions.
Reference: Issue 5182

Signed-off-by: Francisco Palomares <fpalomares@hotmail.com>

Fixed Test Unit to compare with new values
2020-11-23 14:43:19 +01:00
superyarick
c653ce343a added platform-name wildcard support
added unit test for platform-name wildcard
added doc for release wildcard
added doc for platform-name wildcard

Signed-off-by: superyarick <yarick@yarick.net>
2020-11-08 15:24:43 -05:00
mbaitelman
f88404a865 call class insteader of loader
Signed-off-by: GitHub <noreply@github.com>
2020-10-19 05:24:09 +00:00
mbaitelman
89cb81ca33 Update to return JSON, start writing tests
Signed-off-by: GitHub <noreply@github.com>
2020-10-16 18:01:38 +00:00
Mendy Baitelman
c31057e6f9 Update method name in tests
Signed-off-by: Mendy Baitelman <mendy@baitelman.com>
2020-10-15 23:16:27 +00:00
Raphael Geissert
b2e62b5b2f Run ps with an ulimited width on linux
On some systems the output of ps may be truncated, which may prevent
profiles from working as intended.

Some implementations specifically mention that the output width is
undefined "(it may be 80, unlimited, determined by the TERM variable,
and so on)".

This fixes #5226.

Signed-off-by: Raphael Geissert <atomo64@gmail.com>
2020-09-02 08:34:11 +02:00
Nick Schwaderer
1d71ce141a
Merge pull request #5185 from StylusEaterChef/amd/issue-5183
First pass at fixing issue #5183.
2020-08-27 12:43:18 +01:00
Tim Smith
303f530850 Update to Chefstyle 1.2.1
Update a few cop names
Remove redundant returns

Signed-off-by: Tim Smith <tsmith@chef.io>
2020-08-12 13:12:26 -07:00
Adam M Dutko
04c3aef004 Fix Issue #5183.
Signed-off-by: Adam M Dutko <adutko@chef.io>
2020-08-11 10:34:13 -04:00
Nick Schwaderer
3129af9db9
Merge pull request #5123 from Perceptyx/fix-freebsd-osfamily-user-group-tests
Fix freebsd osfamily user group tests
2020-07-29 10:12:13 +01:00
Felipe Zipitria
dd8960dbf6
feat(sensitive): add sensitive output to mysql and postgres sessions
Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com>
2020-07-22 14:20:17 -03:00
Felipe Zipitria
d2ae7a7fbf
fix(osfamily): use corresponding family or name for bsd/freebsd
Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com>
2020-07-22 08:43:25 -03:00
Bryan McLellan
dada8ea074 Add the generic 'darwin' to the service resource
macOS 11 Big Sur will be released later this year. Current beta versions
return 10.16 as the version, but the product name has changed from 'Mac
OS X' to 'macOS'. Train probably needs to be modified to deprecate
'mac_os_x' as a platform in favor of 'macos' but that would be a
significant downstream change. Train does fall back to 'darwin' on macOS
10.16, so by adding darwin to the list of platform names for the service
resource we are able to work around this for the moment.

This is the only location where mac_os_x is currently being used in
InSpec. Because we're in a case statement on platform rather than the
more generic platform family, we can't simply remove mac_os_x in favor
of darwin.

Signed-off-by: Bryan McLellan <btm@loftninjas.org>
2020-07-02 09:36:27 -04:00
Clinton Wolfe
ad673fa570 Do not include CIDR range on ipv4_address and ipv6_address
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
Clinton Wolfe
d9007588a6 Add an heuristic-based IP lookup property
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
Clinton Wolfe
52468e470e Barebones plural interfaces resource
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
Clinton Wolfe
c386828e7a Add properties for ipv4 and ipv6 ipaddresses for compat
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
Clinton Wolfe
a4000d6912 Adds support for interface on BSD and MacOS
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
James Stocks
6c9cb23808 Update sslshake test for sslshake 1.13.1
There are now 1003 ciphers.

Signed-off-by: James Stocks <jstocks@chef.io>
2020-06-18 11:25:35 +01:00
James Stocks
951fcc9553
Merge pull request #4954 from tecracer-theinen/feature/virtualization-detection
Improve virtualization resource
2020-04-06 10:23:58 +01:00
Thomas Heinen
be120e13b1 Fix deprecation warning on auditd test
Signed-off-by: Thomas Heinen <theinen@tecracer.de>
2020-03-11 17:24:39 +00:00
Thomas Heinen
6a90c10ae3 Improve virtualization resource
Signed-off-by: Thomas Heinen <theinen@tecracer.de>
2020-03-11 17:46:32 +01:00
Ross Moles
e7f01151f0 Merge branch 'master' into oracledb_session_resource 2020-02-14 10:50:10 +00:00
Clinton Wolfe
03d394a51b
Fix auditd resource processing of action and list (#4665)
Fix auditd resource processing of action and list
2020-02-13 15:12:47 -05:00
Ross Moles
351c4e3651 update unit test
Signed-off-by: Ross Moles <rmoles@chef.io>
2020-02-12 18:17:04 +00:00
Ryan Davis
cea752a01d Tweak for aws resources to determine if they're still under test.
Everyone now has an `inspec` method, but the AWS ones still return
nil as their backend hasn't been set up.

This seems wrong...

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 14:41:37 -08:00
Ryan Davis
51b65f6c2e Overhaul Platform#supported?
+ State normal path first.
+ Use Enumerable to state your logic up front, don't build it into
  loops with breaks/returns.
+ Remove nonsensical duplication of key formats. (should push up or remove)
+ Had to add an extra test case that wasn't covered here but was in
  metadata_test.rb (why?!?)

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
2490a88b9c Minor test improvements
We need to track down `x.must_equal true`.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
f2155a64ed
Merge pull request #4843 from michaellihs/master
Add support for yocto linux in service resource
2020-01-29 16:19:27 -08:00
Ryan Davis
9c051da22b Fix platform on apache_conf to include all unix.
Now discovers the first available conf file from a list of known
paths. Might have to expand based on various distros.

Had to tweak the tests because the mock loader mocks EVERYTHING every
time. :/

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-01-28 14:53:37 -08:00
Ryan Davis
df31f744f4 Fix up platform on filesystem resource.
From linux to unix. This should work fine even on AIX, according to
the man pages.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-01-27 15:34:33 -08:00