inspec-core 2.3.10 → 2.3.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -13
  3. data/etc/plugin_filters.json +25 -0
  4. data/inspec-core.gemspec +1 -1
  5. data/lib/bundles/inspec-compliance/api.rb +3 -0
  6. data/lib/bundles/inspec-compliance/configuration.rb +3 -0
  7. data/lib/bundles/inspec-compliance/http.rb +3 -0
  8. data/lib/bundles/inspec-compliance/support.rb +3 -0
  9. data/lib/bundles/inspec-compliance/target.rb +3 -0
  10. data/lib/inspec/objects/attribute.rb +3 -0
  11. data/lib/inspec/plugin/v2.rb +3 -0
  12. data/lib/inspec/plugin/v2/filter.rb +62 -0
  13. data/lib/inspec/plugin/v2/installer.rb +21 -1
  14. data/lib/inspec/plugin/v2/loader.rb +4 -0
  15. data/lib/inspec/profile.rb +3 -1
  16. data/lib/inspec/version.rb +1 -1
  17. data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb +25 -3
  18. data/lib/plugins/inspec-plugin-manager-cli/test/functional/inspec-plugin_test.rb +65 -11
  19. data/lib/plugins/inspec-plugin-manager-cli/test/unit/cli_args_test.rb +5 -1
  20. data/lib/resources/package.rb +1 -1
  21. metadata +4 -197
  22. data/docs/.gitignore +0 -2
  23. data/docs/README.md +0 -41
  24. data/docs/dev/control-eval.md +0 -62
  25. data/docs/dev/filtertable-internals.md +0 -353
  26. data/docs/dev/filtertable-usage.md +0 -533
  27. data/docs/dev/integration-testing.md +0 -31
  28. data/docs/dev/plugins.md +0 -323
  29. data/docs/dsl_inspec.md +0 -354
  30. data/docs/dsl_resource.md +0 -100
  31. data/docs/glossary.md +0 -381
  32. data/docs/habitat.md +0 -193
  33. data/docs/inspec_and_friends.md +0 -114
  34. data/docs/matchers.md +0 -161
  35. data/docs/migration.md +0 -293
  36. data/docs/platforms.md +0 -119
  37. data/docs/plugin_kitchen_inspec.md +0 -60
  38. data/docs/plugins.md +0 -57
  39. data/docs/profiles.md +0 -576
  40. data/docs/reporters.md +0 -170
  41. data/docs/resources/aide_conf.md.erb +0 -86
  42. data/docs/resources/apache.md.erb +0 -77
  43. data/docs/resources/apache_conf.md.erb +0 -78
  44. data/docs/resources/apt.md.erb +0 -81
  45. data/docs/resources/audit_policy.md.erb +0 -57
  46. data/docs/resources/auditd.md.erb +0 -89
  47. data/docs/resources/auditd_conf.md.erb +0 -78
  48. data/docs/resources/bash.md.erb +0 -85
  49. data/docs/resources/bond.md.erb +0 -100
  50. data/docs/resources/bridge.md.erb +0 -67
  51. data/docs/resources/bsd_service.md.erb +0 -77
  52. data/docs/resources/chocolatey_package.md.erb +0 -68
  53. data/docs/resources/command.md.erb +0 -176
  54. data/docs/resources/cpan.md.erb +0 -89
  55. data/docs/resources/cran.md.erb +0 -74
  56. data/docs/resources/crontab.md.erb +0 -103
  57. data/docs/resources/csv.md.erb +0 -64
  58. data/docs/resources/dh_params.md.erb +0 -221
  59. data/docs/resources/directory.md.erb +0 -40
  60. data/docs/resources/docker.md.erb +0 -240
  61. data/docs/resources/docker_container.md.erb +0 -113
  62. data/docs/resources/docker_image.md.erb +0 -104
  63. data/docs/resources/docker_plugin.md.erb +0 -80
  64. data/docs/resources/docker_service.md.erb +0 -124
  65. data/docs/resources/elasticsearch.md.erb +0 -252
  66. data/docs/resources/etc_fstab.md.erb +0 -135
  67. data/docs/resources/etc_group.md.erb +0 -85
  68. data/docs/resources/etc_hosts.md.erb +0 -88
  69. data/docs/resources/etc_hosts_allow.md.erb +0 -84
  70. data/docs/resources/etc_hosts_deny.md.erb +0 -84
  71. data/docs/resources/file.md.erb +0 -543
  72. data/docs/resources/filesystem.md.erb +0 -51
  73. data/docs/resources/firewalld.md.erb +0 -117
  74. data/docs/resources/gem.md.erb +0 -108
  75. data/docs/resources/group.md.erb +0 -71
  76. data/docs/resources/grub_conf.md.erb +0 -111
  77. data/docs/resources/host.md.erb +0 -96
  78. data/docs/resources/http.md.erb +0 -207
  79. data/docs/resources/iis_app.md.erb +0 -132
  80. data/docs/resources/iis_site.md.erb +0 -145
  81. data/docs/resources/inetd_conf.md.erb +0 -104
  82. data/docs/resources/ini.md.erb +0 -86
  83. data/docs/resources/interface.md.erb +0 -68
  84. data/docs/resources/iptables.md.erb +0 -74
  85. data/docs/resources/json.md.erb +0 -73
  86. data/docs/resources/kernel_module.md.erb +0 -130
  87. data/docs/resources/kernel_parameter.md.erb +0 -63
  88. data/docs/resources/key_rsa.md.erb +0 -95
  89. data/docs/resources/launchd_service.md.erb +0 -67
  90. data/docs/resources/limits_conf.md.erb +0 -85
  91. data/docs/resources/login_defs.md.erb +0 -81
  92. data/docs/resources/mount.md.erb +0 -79
  93. data/docs/resources/mssql_session.md.erb +0 -78
  94. data/docs/resources/mysql_conf.md.erb +0 -109
  95. data/docs/resources/mysql_session.md.erb +0 -84
  96. data/docs/resources/nginx.md.erb +0 -89
  97. data/docs/resources/nginx_conf.md.erb +0 -148
  98. data/docs/resources/npm.md.erb +0 -78
  99. data/docs/resources/ntp_conf.md.erb +0 -70
  100. data/docs/resources/oneget.md.erb +0 -63
  101. data/docs/resources/oracledb_session.md.erb +0 -103
  102. data/docs/resources/os.md.erb +0 -153
  103. data/docs/resources/os_env.md.erb +0 -101
  104. data/docs/resources/package.md.erb +0 -130
  105. data/docs/resources/packages.md.erb +0 -77
  106. data/docs/resources/parse_config.md.erb +0 -113
  107. data/docs/resources/parse_config_file.md.erb +0 -148
  108. data/docs/resources/passwd.md.erb +0 -151
  109. data/docs/resources/pip.md.erb +0 -77
  110. data/docs/resources/port.md.erb +0 -147
  111. data/docs/resources/postgres_conf.md.erb +0 -89
  112. data/docs/resources/postgres_hba_conf.md.erb +0 -103
  113. data/docs/resources/postgres_ident_conf.md.erb +0 -86
  114. data/docs/resources/postgres_session.md.erb +0 -79
  115. data/docs/resources/powershell.md.erb +0 -112
  116. data/docs/resources/processes.md.erb +0 -119
  117. data/docs/resources/rabbitmq_config.md.erb +0 -51
  118. data/docs/resources/registry_key.md.erb +0 -197
  119. data/docs/resources/runit_service.md.erb +0 -67
  120. data/docs/resources/security_policy.md.erb +0 -57
  121. data/docs/resources/service.md.erb +0 -131
  122. data/docs/resources/shadow.md.erb +0 -267
  123. data/docs/resources/ssh_config.md.erb +0 -83
  124. data/docs/resources/sshd_config.md.erb +0 -93
  125. data/docs/resources/ssl.md.erb +0 -129
  126. data/docs/resources/sys_info.md.erb +0 -52
  127. data/docs/resources/systemd_service.md.erb +0 -67
  128. data/docs/resources/sysv_service.md.erb +0 -67
  129. data/docs/resources/upstart_service.md.erb +0 -67
  130. data/docs/resources/user.md.erb +0 -150
  131. data/docs/resources/users.md.erb +0 -137
  132. data/docs/resources/vbscript.md.erb +0 -65
  133. data/docs/resources/virtualization.md.erb +0 -67
  134. data/docs/resources/windows_feature.md.erb +0 -69
  135. data/docs/resources/windows_hotfix.md.erb +0 -63
  136. data/docs/resources/windows_task.md.erb +0 -95
  137. data/docs/resources/wmi.md.erb +0 -91
  138. data/docs/resources/x509_certificate.md.erb +0 -161
  139. data/docs/resources/xinetd_conf.md.erb +0 -166
  140. data/docs/resources/xml.md.erb +0 -95
  141. data/docs/resources/yaml.md.erb +0 -79
  142. data/docs/resources/yum.md.erb +0 -108
  143. data/docs/resources/zfs_dataset.md.erb +0 -63
  144. data/docs/resources/zfs_pool.md.erb +0 -57
  145. data/docs/shared/matcher_be.md.erb +0 -1
  146. data/docs/shared/matcher_cmp.md.erb +0 -43
  147. data/docs/shared/matcher_eq.md.erb +0 -3
  148. data/docs/shared/matcher_include.md.erb +0 -1
  149. data/docs/shared/matcher_match.md.erb +0 -1
  150. data/docs/shell.md +0 -217
  151. data/docs/style.md +0 -178
  152. data/examples/README.md +0 -8
  153. data/examples/custom-resource/README.md +0 -3
  154. data/examples/custom-resource/controls/example.rb +0 -7
  155. data/examples/custom-resource/inspec.yml +0 -8
  156. data/examples/custom-resource/libraries/batsignal.rb +0 -20
  157. data/examples/custom-resource/libraries/gordon.rb +0 -21
  158. data/examples/inheritance/README.md +0 -65
  159. data/examples/inheritance/controls/example.rb +0 -14
  160. data/examples/inheritance/inspec.yml +0 -16
  161. data/examples/kitchen-ansible/.kitchen.yml +0 -25
  162. data/examples/kitchen-ansible/Gemfile +0 -19
  163. data/examples/kitchen-ansible/README.md +0 -53
  164. data/examples/kitchen-ansible/files/nginx.repo +0 -6
  165. data/examples/kitchen-ansible/tasks/main.yml +0 -16
  166. data/examples/kitchen-ansible/test/integration/default/default.yml +0 -5
  167. data/examples/kitchen-ansible/test/integration/default/web_spec.rb +0 -28
  168. data/examples/kitchen-chef/.kitchen.yml +0 -20
  169. data/examples/kitchen-chef/Berksfile +0 -3
  170. data/examples/kitchen-chef/Gemfile +0 -19
  171. data/examples/kitchen-chef/README.md +0 -27
  172. data/examples/kitchen-chef/metadata.rb +0 -7
  173. data/examples/kitchen-chef/recipes/default.rb +0 -6
  174. data/examples/kitchen-chef/recipes/nginx.rb +0 -30
  175. data/examples/kitchen-chef/test/integration/default/web_spec.rb +0 -28
  176. data/examples/kitchen-puppet/.kitchen.yml +0 -23
  177. data/examples/kitchen-puppet/Gemfile +0 -20
  178. data/examples/kitchen-puppet/Puppetfile +0 -25
  179. data/examples/kitchen-puppet/README.md +0 -53
  180. data/examples/kitchen-puppet/manifests/site.pp +0 -33
  181. data/examples/kitchen-puppet/metadata.json +0 -11
  182. data/examples/kitchen-puppet/modules/.gitkeep +0 -0
  183. data/examples/kitchen-puppet/test/integration/default/web_spec.rb +0 -28
  184. data/examples/meta-profile/README.md +0 -37
  185. data/examples/meta-profile/controls/example.rb +0 -13
  186. data/examples/meta-profile/inspec.yml +0 -13
  187. data/examples/plugins/inspec-resource-lister/Gemfile +0 -12
  188. data/examples/plugins/inspec-resource-lister/LICENSE +0 -13
  189. data/examples/plugins/inspec-resource-lister/README.md +0 -62
  190. data/examples/plugins/inspec-resource-lister/Rakefile +0 -40
  191. data/examples/plugins/inspec-resource-lister/inspec-resource-lister.gemspec +0 -45
  192. data/examples/plugins/inspec-resource-lister/lib/inspec-resource-lister.rb +0 -16
  193. data/examples/plugins/inspec-resource-lister/lib/inspec-resource-lister/cli_command.rb +0 -70
  194. data/examples/plugins/inspec-resource-lister/lib/inspec-resource-lister/plugin.rb +0 -55
  195. data/examples/plugins/inspec-resource-lister/lib/inspec-resource-lister/version.rb +0 -10
  196. data/examples/plugins/inspec-resource-lister/test/fixtures/README.md +0 -24
  197. data/examples/plugins/inspec-resource-lister/test/functional/README.md +0 -18
  198. data/examples/plugins/inspec-resource-lister/test/functional/inspec_resource_lister_test.rb +0 -110
  199. data/examples/plugins/inspec-resource-lister/test/helper.rb +0 -26
  200. data/examples/plugins/inspec-resource-lister/test/unit/README.md +0 -17
  201. data/examples/plugins/inspec-resource-lister/test/unit/cli_args_test.rb +0 -64
  202. data/examples/plugins/inspec-resource-lister/test/unit/plugin_def_test.rb +0 -51
  203. data/examples/profile-attribute.yml +0 -2
  204. data/examples/profile-attribute/README.md +0 -14
  205. data/examples/profile-attribute/controls/example.rb +0 -11
  206. data/examples/profile-attribute/inspec.yml +0 -8
  207. data/examples/profile-sensitive/README.md +0 -29
  208. data/examples/profile-sensitive/controls/sensitive-failures.rb +0 -9
  209. data/examples/profile-sensitive/controls/sensitive.rb +0 -9
  210. data/examples/profile-sensitive/inspec.yml +0 -8
  211. data/examples/profile/README.md +0 -48
  212. data/examples/profile/controls/example.rb +0 -24
  213. data/examples/profile/controls/gordon.rb +0 -36
  214. data/examples/profile/controls/meta.rb +0 -36
  215. data/examples/profile/inspec.yml +0 -11
  216. data/examples/profile/libraries/gordon_config.rb +0 -59
@@ -1,63 +0,0 @@
1
- ---
2
- title: About the kernel_parameter Resource
3
- platform: linux
4
- ---
5
-
6
- # kernel_parameter
7
-
8
- Use the `kernel_parameter` InSpec audit resource to test kernel parameters on Linux platforms.
9
- These parameters are located under `/proc/cmdline`.
10
- <br>
11
-
12
- ## Availability
13
-
14
- ### Installation
15
-
16
- This resource is distributed along with InSpec itself. You can use it automatically.
17
-
18
- ### Version
19
-
20
- This resource first became available in v1.0.0 of InSpec.
21
-
22
- ## Syntax
23
-
24
- A `kernel_parameter` resource block declares a parameter and then a value to be tested:
25
-
26
- describe kernel_parameter('path.to.parameter') do
27
- its('value') { should eq 0 }
28
- end
29
-
30
- where
31
-
32
- * `'kernel.parameter'` must specify a kernel parameter, such as `'net.ipv4.conf.all.forwarding'`
33
- * `{ should eq 0 }` states the value to be tested
34
-
35
- <br>
36
-
37
- ## Examples
38
-
39
- The following examples show how to use this InSpec audit resource.
40
-
41
- ### Test if global forwarding is enabled for an IPv4 address
42
-
43
- describe kernel_parameter('net.ipv4.conf.all.forwarding') do
44
- its('value') { should eq 1 }
45
- end
46
-
47
- ### Test if global forwarding is disabled for an IPv6 address
48
-
49
- describe kernel_parameter('net.ipv6.conf.all.forwarding') do
50
- its('value') { should eq 0 }
51
- end
52
-
53
- ### Test if an IPv6 address accepts redirects
54
-
55
- describe kernel_parameter('net.ipv6.conf.interface.accept_redirects') do
56
- its('value') { should cmp 'true' }
57
- end
58
-
59
- <br>
60
-
61
- ## Matchers
62
-
63
- For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
@@ -1,95 +0,0 @@
1
- ---
2
- title: The key_rsa Resource
3
- platform: os
4
- ---
5
-
6
- # key_rsa
7
-
8
- Use the `key_rsa` InSpec audit resource to test RSA public/private keypairs.
9
-
10
- This resource is mainly useful when used in conjunction with the x509_certificate resource but it can also be used for checking SSH keys.
11
-
12
- <br>
13
-
14
- ## Availability
15
-
16
- ### Installation
17
-
18
- This resource is distributed along with InSpec itself. You can use it automatically.
19
-
20
- ### Version
21
-
22
- This resource first became available in v1.18.0 of InSpec.
23
-
24
- ## Syntax
25
-
26
- An `key_rsa` resource block declares a `key file` to be tested.
27
-
28
- describe key_rsa('mycertificate.key') do
29
- it { should be_private }
30
- it { should be_public }
31
- its('public_key') { should match "-----BEGIN PUBLIC KEY-----\n3597459df9f3982" }
32
- its('key_length') { should eq 2048 }
33
- end
34
-
35
- You can use an optional passphrase with `key_rsa`
36
-
37
- describe key_rsa('mycertificate.key', 'passphrase') do
38
- it { should be_private }
39
- end
40
-
41
- <br>
42
-
43
- ## Properties
44
-
45
- * `public_key`, `private_key`, `key_length`
46
-
47
- <br>
48
-
49
- ## Property Examples
50
-
51
- ### public_key (String)
52
-
53
- The `public_key` property returns the public part of the RSA key pair
54
-
55
- describe key_rsa('/etc/pki/www.mywebsite.com.key') do
56
- its('public_key') { should match "-----BEGIN PUBLIC KEY-----\n3597459df9f3982......" }
57
- end
58
-
59
- ### private_key (String)
60
-
61
- The `private_key` property returns the private key or the RSA key pair.
62
-
63
- describe key_rsa('/etc/pki/www.mywebsite.com.key') do
64
- its('private_key') { should match "-----BEGIN RSA PRIVATE KEY-----\nMIIJJwIBAAK......" }
65
- end
66
-
67
- ### key_length
68
-
69
- The `key_length` property allows testing the number of bits in the key pair.
70
-
71
- describe key_rsa('/etc/pki/www.mywebsite.com.key') do
72
- its('key_length') { should eq 2048 }
73
- end
74
-
75
- <br>
76
-
77
- ## Matchers
78
-
79
- For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
80
-
81
- ### public?
82
-
83
- To verify if a key is public use the following:
84
-
85
- describe key_rsa('/etc/pki/www.mywebsite.com.key') do
86
- it { should be_public }
87
- end
88
-
89
- ### private?
90
-
91
- This property verifies that the key includes a private key:
92
-
93
- describe key_rsa('/etc/pki/www.mywebsite.com.key') do
94
- it { should be_private }
95
- end
@@ -1,67 +0,0 @@
1
- ---
2
- title: About the launchd_service Resource
3
- platform: linux
4
- ---
5
-
6
- # launchd_service
7
-
8
- Use the ``launchd_service`` InSpec audit resource to test a service using Launchd.
9
-
10
- <br>
11
-
12
- ## Availability
13
-
14
- ### Installation
15
-
16
- This resource is distributed along with InSpec itself. You can use it automatically.
17
-
18
- ### Version
19
-
20
- This resource first became available in v1.0.0 of InSpec.
21
-
22
- ## Syntax
23
-
24
- A ``launchd_service`` resource block declares the name of a service and then one (or more) matchers to test the state of the service:
25
-
26
- describe launchd_service('service_name') do
27
- it { should be_installed }
28
- it { should be_enabled }
29
- it { should be_running }
30
- end
31
-
32
- where
33
-
34
- * ``('service_name')`` must specify a service name
35
- * `be_installed`, `be_enabled`, and `be_running` are valid matchers for this resource; all matchers available to the `service` resource may be used
36
-
37
- The path to the service manager's control may be specified for situations where the path isn't available in the current ``PATH``. For example:
38
-
39
- describe launchd_service('service_name', '/path/to/control') do
40
- it { should be_enabled }
41
- it { should be_installed }
42
- it { should be_running }
43
- end
44
-
45
- <br>
46
-
47
- ## Matchers
48
-
49
- For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
50
-
51
- ### be_enabled
52
-
53
- The `be_enabled` matcher tests if the named service is enabled:
54
-
55
- it { should be_enabled }
56
-
57
- ### be_installed
58
-
59
- The `be_installed` matcher tests if the named service is installed:
60
-
61
- it { should be_installed }
62
-
63
- ### be_running
64
-
65
- The `be_running` matcher tests if the named service is running:
66
-
67
- it { should be_running }
@@ -1,85 +0,0 @@
1
- ---
2
- title: About the limits_conf Resource
3
- platform: linux
4
- ---
5
-
6
- # limits_conf
7
-
8
- Use the `limits_conf` InSpec audit resource to test configuration settings in the `/etc/security/limits.conf` file. The `limits.conf` defines limits for processes (by user and/or group names) and helps ensure that the system running those processes remains stable. Each process may be assigned a hard or soft limit.
9
-
10
- * Soft limits are maintained by the shell and defines the number of file handles (or open files) available to the user or group after login
11
- * Hard limits are maintained by the kernel and defines the maximum number of allowed file handles
12
-
13
- Entries in the `limits.conf` file are similar to:
14
-
15
- grantmc soft nofile 4096
16
- grantmc hard nofile 63536
17
-
18
- ^^^^^^^^^ ^^^^ ^^^^^^ ^^^^^
19
- domain type item value
20
-
21
- <br>
22
-
23
- ## Availability
24
-
25
- ### Installation
26
-
27
- This resource is distributed along with InSpec itself. You can use it automatically.
28
-
29
- ### Version
30
-
31
- This resource first became available in v1.0.0 of InSpec.
32
-
33
- ## Syntax
34
-
35
- A `limits_conf` resource block declares a domain to be tested, along with associated type, item, and value:
36
-
37
- describe limits_conf('path') do
38
- its('domain') { should include ['type', 'item', 'value'] }
39
- its('domain') { should eq ['type', 'item', 'value'] }
40
- end
41
-
42
- where
43
-
44
- * `('path')` is the non-default path to the `inetd.conf` file
45
- * `'domain'` is a user or group name, such as `grantmc`
46
- * `'type'` is either `hard` or `soft`
47
- * `'item'` is the item for which limits are defined, such as `core`, `nofile`, `stack`, `nproc`, `priority`, or `maxlogins`
48
- * `'value'` is the value associated with the `item`
49
-
50
- <br>
51
-
52
- ## Properties
53
-
54
- * `domain`
55
-
56
- <br>
57
-
58
- ## Examples
59
-
60
- The following examples show how to use this InSpec audit resource.
61
-
62
- ### domain
63
-
64
- The `domain` property tests the domain in the `limits.conf` file, along with associated type, item, and value:
65
-
66
- its('domain') { should include ['type', 'item', 'value'] }
67
- `
68
- For example:
69
-
70
- its('grantmc') { should include ['hard', 'nofile', '63536'] }
71
-
72
- ### Test limits
73
-
74
- describe limits_conf('path') do
75
- its('*') { should include ['soft', 'core', '0'], ['hard', 'rss', '10000'] }
76
- its('ftp') { should eq ['hard', 'nproc', '0'] }
77
- end
78
-
79
- <br>
80
-
81
- ## Matchers
82
-
83
- For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
84
-
85
-
@@ -1,81 +0,0 @@
1
- ---
2
- title: About the login_defs Resource
3
- platform: linux
4
- ---
5
-
6
- # login_defs
7
-
8
- Use the `login_defs` InSpec audit resource to test configuration settings in the `/etc/login.defs` file. The `logins.defs` file defines site-specific configuration for the shadow password suite on Linux and Unix platforms, such as password expiration ranges, minimum/maximum values for automatic selection of user and group identifiers, or the method with which passwords are encrypted.
9
-
10
- <br>
11
-
12
- ## Availability
13
-
14
- ### Installation
15
-
16
- This resource is distributed along with InSpec itself. You can use it automatically.
17
-
18
- ### Version
19
-
20
- This resource first became available in v1.0.0 of InSpec.
21
-
22
- ## Syntax
23
-
24
- A `login_defs` resource block declares the `login.defs` configuration data to be tested:
25
-
26
- describe login_defs do
27
- its('name') { should include('foo') }
28
- end
29
-
30
- where
31
-
32
- * `name` is a configuration setting in `login.defs`
33
- * `{ should include('foo') }` tests the value of `name` as read from `login.defs` versus the value declared in the test
34
-
35
- <br>
36
-
37
- ## Properties
38
-
39
- This resource supports the properties found in the `login.defs` configuration settings.
40
-
41
- <br>
42
-
43
- ## Examples
44
-
45
- The following examples show how to use this InSpec audit resource.
46
-
47
- ### name
48
-
49
- The `name` matcher tests the value of `name` as read from `login.defs` versus the value declared in the test:
50
-
51
- its('name') { should eq 'foo' }
52
-
53
- ### Test password expiration settings
54
-
55
- describe login_defs do
56
- its('PASS_MAX_DAYS') { should eq '180' }
57
- its('PASS_MIN_DAYS') { should eq '1' }
58
- its('PASS_MIN_LEN') { should eq '15' }
59
- its('PASS_WARN_AGE') { should eq '30' }
60
- end
61
-
62
- ### Test the encryption method
63
-
64
- describe login_defs do
65
- its('ENCRYPT_METHOD') { should eq 'SHA512' }
66
- end
67
-
68
- ### Test umask setting
69
-
70
- describe login_def do
71
- its('UMASK') { should eq '077' }
72
- its('PASS_MAX_DAYS') { should eq '90' }
73
- end
74
-
75
- <br>
76
-
77
- ## Matchers
78
-
79
- For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
80
-
81
-
@@ -1,79 +0,0 @@
1
- ---
2
- title: About the mount Resource
3
- platform: linux
4
- ---
5
-
6
- # mount
7
-
8
- Use the `mount` InSpec audit resource to test the mount points on FreeBSD and Linux systems.
9
-
10
- <br>
11
-
12
- ## Availability
13
-
14
- ### Installation
15
-
16
- This resource is distributed along with InSpec itself. You can use it automatically.
17
-
18
- ### Version
19
-
20
- This resource first became available in v1.0.0 of InSpec.
21
-
22
- ## Syntax
23
-
24
- An `mount` resource block declares the synchronization settings that should be tested:
25
-
26
- describe mount('path') do
27
- it { should MATCHER 'value' }
28
- end
29
-
30
- where
31
-
32
- * `('path')` is the path to the mounted directory
33
- * `MATCHER` is a valid matcher for this resource
34
- * `'value'` is the value to be tested
35
-
36
- <br>
37
-
38
- ## Examples
39
-
40
- The following examples show how to use this InSpec audit resource.
41
-
42
- ### Test a the mount point on '/'
43
-
44
- describe mount('/') do
45
- it { should be_mounted }
46
- its('device') { should eq '/dev/mapper/VolGroup-lv_root' }
47
- its('type') { should eq 'ext4' }
48
- its('options') { should eq ['rw', 'mode=620'] }
49
- end
50
-
51
- <br>
52
-
53
- ## Matchers
54
-
55
- For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
56
-
57
- ### be_mounted
58
-
59
- The `be_mounted` matcher tests if the file is accessible from the file system:
60
-
61
- it { should be_mounted }
62
-
63
- ### device
64
-
65
- The `device` matcher tests the device from the `fstab` table:
66
-
67
- its('device') { should eq '/dev/mapper/VolGroup-lv_root' }
68
-
69
- ### options
70
-
71
- The `options` matcher tests the mount options for the file system from the `fstab` table:
72
-
73
- its('options') { should eq ['rw', 'mode=620'] }
74
-
75
- ### type
76
-
77
- The `type` matcher tests the file system type:
78
-
79
- its('type') { should eq 'ext4' }