inspec/lib/utils
eramoto c7e87ca3e3 Unify method in which file content is read across all resources (#2359)
* Create file-check functionality into utility file

There are the similar issues as PR #2302. Almost resources return false
positives when a file does not exist or is not read.

* Replace to file-check functionality
* Fix dh_params and x509_certificate resources

If a file is empty, OpenSSL::PKey::DH and OpenSSL::X509::Certificate have
raised an exception and have skipped the inspection. Thus x509_certificate
and dh_params resources are not allowed to read a empty file.

* to_s of shadow expects filters is not nil
* Remove workaround of sshd_config

Removes the workaround of sshd_config since Travis CI fails due to a bug
of dev-sec/ssh-baseline and the PR #100 will fix it.

* Use init block variable in methods

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
2018-03-22 08:25:45 -04:00
..
command_wrapper.rb Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
convert.rb lint 2016-01-15 04:07:25 +01:00
database_helpers.rb mssql_session - Handling cases where the data is nil (#2752) 2018-03-01 14:30:07 -05:00
erlang_parser.rb add rabbitmq config resource 2017-04-12 20:51:12 +02:00
file_reader.rb Unify method in which file content is read across all resources (#2359) 2018-03-22 08:25:45 -04:00
filter.rb Allow skipping/failing resources in FilterTable (#2349) 2017-11-29 07:32:40 -05:00
filter_array.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
find_files.rb Add wildcard support to Utils::FindFiles (#2159) 2017-09-23 09:17:34 +02:00
hash.rb implement be_mounted.with for file resources 2016-01-03 00:03:24 +01:00
json_log.rb Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
latest_version.rb Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
modulator.rb add author header 2015-10-06 18:55:44 +02:00
nginx_parser.rb nginx resource: support quoted identifiers (#2292) 2017-11-08 12:42:37 -05:00
object_traversal.rb Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
parser.rb Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
plugin_registry.rb Address rubocop violations 2017-02-08 16:49:16 -06:00
simpleconfig.rb Remove deprecations for InSpec 2.0 (#2506) 2018-02-08 11:05:21 +01:00
spdx.rb verifies that inspec.yml uses licenses in SPDX format 2017-05-31 00:21:05 -05:00
spdx.txt update unit tests 2017-05-31 00:21:05 -05:00