inspec 3.7.1 → 3.7.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -2
  3. data/lib/inspec/config.rb +12 -0
  4. data/lib/inspec/shell.rb +2 -15
  5. data/lib/inspec/version.rb +1 -1
  6. data/lib/plugins/inspec-habitat/Berksfile +5 -0
  7. data/lib/plugins/inspec-habitat/README.md +150 -0
  8. data/lib/plugins/inspec-habitat/kitchen.yml +28 -0
  9. data/lib/plugins/inspec-habitat/lib/inspec-habitat/cli.rb +9 -9
  10. data/lib/plugins/inspec-habitat/lib/inspec-habitat/profile.rb +164 -280
  11. data/lib/plugins/inspec-habitat/templates/habitat/config/inspec_exec_config.json.erb +25 -0
  12. data/lib/plugins/inspec-habitat/templates/habitat/default.toml.erb +9 -0
  13. data/lib/plugins/inspec-habitat/templates/habitat/hooks/run.erb +32 -0
  14. data/lib/plugins/inspec-habitat/templates/habitat/plan.sh.erb +85 -0
  15. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/Berksfile +2 -0
  16. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/README.md +3 -0
  17. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/files/hab_setup.exp +28 -0
  18. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/metadata.rb +9 -0
  19. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/recipes/default.rb +61 -0
  20. data/lib/plugins/inspec-habitat/test/functional/inspec_habitat_test.rb +38 -0
  21. data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/README.md +3 -0
  22. data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/controls/inspec_habitat.rb +40 -0
  23. data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/inspec.yml +10 -0
  24. data/lib/plugins/inspec-habitat/test/support/example_profile/README.md +3 -0
  25. data/lib/plugins/inspec-habitat/test/support/example_profile/controls/example.rb +7 -0
  26. data/lib/plugins/inspec-habitat/test/support/example_profile/inspec.yml +10 -0
  27. data/lib/plugins/inspec-habitat/test/unit/profile_test.rb +188 -132
  28. data/lib/plugins/inspec-init/templates/profiles/azure/README.md +56 -0
  29. data/lib/plugins/inspec-init/templates/profiles/azure/controls/example.rb +15 -0
  30. data/lib/plugins/inspec-init/templates/profiles/azure/inspec.yml +14 -0
  31. data/lib/plugins/inspec-init/templates/profiles/azure/libraries/.gitkeep +0 -0
  32. data/lib/plugins/inspec-init/test/functional/inspec_init_profile_test.rb +12 -0
  33. data/lib/resources/aide_conf.rb +2 -2
  34. data/lib/resources/apache.rb +2 -2
  35. data/lib/resources/apache_conf.rb +2 -2
  36. data/lib/resources/apt.rb +2 -2
  37. data/lib/resources/audit_policy.rb +2 -2
  38. data/lib/resources/auditd.rb +2 -2
  39. data/lib/resources/auditd_conf.rb +2 -2
  40. data/lib/resources/aws/aws_billing_report.rb +3 -2
  41. data/lib/resources/aws/aws_billing_reports.rb +11 -10
  42. data/lib/resources/aws/aws_cloudtrail_trail.rb +2 -2
  43. data/lib/resources/aws/aws_cloudtrail_trails.rb +2 -2
  44. data/lib/resources/aws/aws_cloudwatch_alarm.rb +9 -9
  45. data/lib/resources/aws/aws_cloudwatch_log_metric_filter.rb +18 -18
  46. data/lib/resources/aws/aws_config_delivery_channel.rb +2 -2
  47. data/lib/resources/aws/aws_config_recorder.rb +2 -2
  48. data/lib/resources/aws/aws_ebs_volume.rb +2 -2
  49. data/lib/resources/aws/aws_ebs_volumes.rb +2 -2
  50. data/lib/resources/aws/aws_ec2_instance.rb +2 -2
  51. data/lib/resources/aws/aws_ec2_instances.rb +2 -2
  52. data/lib/resources/aws/aws_ecs_cluster.rb +2 -2
  53. data/lib/resources/aws/aws_eks_cluster.rb +2 -2
  54. data/lib/resources/aws/aws_elb.rb +2 -2
  55. data/lib/resources/aws/aws_elbs.rb +2 -2
  56. data/lib/resources/aws/aws_flow_log.rb +2 -2
  57. data/lib/resources/aws/aws_iam_access_key.rb +2 -2
  58. data/lib/resources/aws/aws_iam_access_keys.rb +2 -2
  59. data/lib/resources/aws/aws_iam_group.rb +2 -2
  60. data/lib/resources/aws/aws_iam_groups.rb +2 -2
  61. data/lib/resources/aws/aws_iam_password_policy.rb +2 -2
  62. data/lib/resources/aws/aws_iam_policies.rb +2 -2
  63. data/lib/resources/aws/aws_iam_policy.rb +2 -2
  64. data/lib/resources/aws/aws_iam_role.rb +2 -2
  65. data/lib/resources/aws/aws_iam_root_user.rb +2 -2
  66. data/lib/resources/aws/aws_iam_user.rb +2 -2
  67. data/lib/resources/aws/aws_iam_users.rb +2 -2
  68. data/lib/resources/aws/aws_kms_key.rb +2 -2
  69. data/lib/resources/aws/aws_kms_keys.rb +2 -2
  70. data/lib/resources/aws/aws_rds_instance.rb +2 -2
  71. data/lib/resources/aws/aws_route_table.rb +2 -2
  72. data/lib/resources/aws/aws_route_tables.rb +2 -2
  73. data/lib/resources/aws/aws_s3_bucket.rb +2 -2
  74. data/lib/resources/aws/aws_s3_bucket_object.rb +2 -2
  75. data/lib/resources/aws/aws_s3_buckets.rb +2 -2
  76. data/lib/resources/aws/aws_security_group.rb +5 -5
  77. data/lib/resources/aws/aws_security_groups.rb +2 -2
  78. data/lib/resources/aws/aws_sns_subscription.rb +2 -2
  79. data/lib/resources/aws/aws_sns_topic.rb +2 -2
  80. data/lib/resources/aws/aws_sns_topics.rb +2 -2
  81. data/lib/resources/aws/aws_sqs_queue.rb +2 -2
  82. data/lib/resources/aws/aws_subnet.rb +2 -2
  83. data/lib/resources/aws/aws_subnets.rb +2 -2
  84. data/lib/resources/aws/aws_vpc.rb +2 -2
  85. data/lib/resources/aws/aws_vpcs.rb +2 -2
  86. data/lib/resources/bash.rb +2 -2
  87. data/lib/resources/bond.rb +2 -2
  88. data/lib/resources/bridge.rb +2 -2
  89. data/lib/resources/chocolatey_package.rb +2 -2
  90. data/lib/resources/command.rb +2 -2
  91. data/lib/resources/cpan.rb +2 -2
  92. data/lib/resources/cran.rb +2 -2
  93. data/lib/resources/crontab.rb +2 -2
  94. data/lib/resources/csv.rb +2 -2
  95. data/lib/resources/dh_params.rb +2 -2
  96. data/lib/resources/directory.rb +2 -2
  97. data/lib/resources/docker.rb +2 -2
  98. data/lib/resources/docker_container.rb +2 -2
  99. data/lib/resources/docker_image.rb +2 -2
  100. data/lib/resources/docker_plugin.rb +2 -2
  101. data/lib/resources/docker_service.rb +2 -2
  102. data/lib/resources/elasticsearch.rb +2 -2
  103. data/lib/resources/etc_fstab.rb +2 -2
  104. data/lib/resources/etc_group.rb +2 -2
  105. data/lib/resources/etc_hosts.rb +2 -2
  106. data/lib/resources/etc_hosts_allow_deny.rb +4 -4
  107. data/lib/resources/file.rb +2 -2
  108. data/lib/resources/filesystem.rb +2 -2
  109. data/lib/resources/firewalld.rb +2 -2
  110. data/lib/resources/gem.rb +2 -2
  111. data/lib/resources/groups.rb +4 -4
  112. data/lib/resources/grub_conf.rb +2 -2
  113. data/lib/resources/host.rb +2 -2
  114. data/lib/resources/http.rb +25 -5
  115. data/lib/resources/iis_app.rb +2 -2
  116. data/lib/resources/iis_app_pool.rb +6 -3
  117. data/lib/resources/iis_site.rb +4 -4
  118. data/lib/resources/inetd_conf.rb +2 -2
  119. data/lib/resources/ini.rb +2 -2
  120. data/lib/resources/interface.rb +2 -2
  121. data/lib/resources/iptables.rb +2 -2
  122. data/lib/resources/json.rb +2 -3
  123. data/lib/resources/kernel_module.rb +17 -18
  124. data/lib/resources/kernel_parameter.rb +2 -2
  125. data/lib/resources/key_rsa.rb +2 -2
  126. data/lib/resources/ksh.rb +2 -2
  127. data/lib/resources/limits_conf.rb +2 -2
  128. data/lib/resources/login_def.rb +2 -2
  129. data/lib/resources/mount.rb +2 -2
  130. data/lib/resources/mssql_session.rb +2 -2
  131. data/lib/resources/mysql_conf.rb +2 -2
  132. data/lib/resources/mysql_session.rb +2 -2
  133. data/lib/resources/nginx.rb +2 -2
  134. data/lib/resources/nginx_conf.rb +2 -2
  135. data/lib/resources/npm.rb +2 -2
  136. data/lib/resources/ntp_conf.rb +2 -2
  137. data/lib/resources/oneget.rb +2 -2
  138. data/lib/resources/oracledb_session.rb +2 -2
  139. data/lib/resources/os.rb +2 -2
  140. data/lib/resources/os_env.rb +2 -2
  141. data/lib/resources/package.rb +2 -2
  142. data/lib/resources/packages.rb +2 -2
  143. data/lib/resources/parse_config.rb +4 -4
  144. data/lib/resources/passwd.rb +2 -2
  145. data/lib/resources/pip.rb +2 -2
  146. data/lib/resources/platform.rb +2 -2
  147. data/lib/resources/port.rb +2 -2
  148. data/lib/resources/postgres_conf.rb +2 -2
  149. data/lib/resources/postgres_hba_conf.rb +2 -2
  150. data/lib/resources/postgres_ident_conf.rb +2 -2
  151. data/lib/resources/postgres_session.rb +2 -2
  152. data/lib/resources/powershell.rb +2 -2
  153. data/lib/resources/processes.rb +2 -2
  154. data/lib/resources/rabbitmq_conf.rb +2 -2
  155. data/lib/resources/registry_key.rb +2 -2
  156. data/lib/resources/security_identifier.rb +2 -2
  157. data/lib/resources/security_policy.rb +2 -2
  158. data/lib/resources/service.rb +14 -14
  159. data/lib/resources/shadow.rb +2 -2
  160. data/lib/resources/ssh_conf.rb +4 -4
  161. data/lib/resources/ssl.rb +2 -2
  162. data/lib/resources/sys_info.rb +2 -2
  163. data/lib/resources/toml.rb +2 -2
  164. data/lib/resources/users.rb +4 -4
  165. data/lib/resources/vbscript.rb +2 -2
  166. data/lib/resources/virtualization.rb +2 -2
  167. data/lib/resources/windows_feature.rb +2 -2
  168. data/lib/resources/windows_hotfix.rb +2 -2
  169. data/lib/resources/windows_task.rb +2 -2
  170. data/lib/resources/wmi.rb +2 -2
  171. data/lib/resources/x509_certificate.rb +2 -2
  172. data/lib/resources/xinetd.rb +2 -2
  173. data/lib/resources/xml.rb +2 -2
  174. data/lib/resources/yaml.rb +2 -2
  175. data/lib/resources/yum.rb +2 -2
  176. data/lib/resources/zfs_dataset.rb +2 -2
  177. data/lib/resources/zfs_pool.rb +2 -2
  178. metadata +26 -4
@@ -11,7 +11,7 @@ module Inspec::Resources
11
11
  name 'wmi'
12
12
  supports platform: 'windows'
13
13
  desc 'request wmi information'
14
- example "
14
+ example <<~EXAMPLE
15
15
  describe wmi({
16
16
  class: 'RSOP_SecuritySettingNumeric',
17
17
  namespace: 'root\\rsop\\computer',
@@ -19,7 +19,7 @@ module Inspec::Resources
19
19
  }) do
20
20
  its('Setting') { should eq true }
21
21
  end
22
- "
22
+ EXAMPLE
23
23
 
24
24
  include ObjectTraverser
25
25
  attr_accessor :content
@@ -10,7 +10,7 @@ module Inspec::Resources
10
10
  supports platform: 'unix'
11
11
  supports platform: 'windows'
12
12
  desc 'Used to test x.509 certificates'
13
- example "
13
+ example <<~EXAMPLE
14
14
  describe x509_certificate('/etc/pki/www.mywebsite.com.pem') do
15
15
  its('subject') { should match /CN=My Website/ }
16
16
  its('validity_in_days') { should be > 30 }
@@ -31,7 +31,7 @@ module Inspec::Resources
31
31
  its('key_length') { should be >= 2048 }
32
32
  its('extensions.subjectKeyIdentifier') { should cmp 'A5:16:0B:12:F4:48:0F:06:6C:32:29:67:98:12:DF:3D:0D:75:9D:5C' }
33
33
  end
34
- "
34
+ EXAMPLE
35
35
 
36
36
  include FileReader
37
37
 
@@ -9,7 +9,7 @@ module Inspec::Resources
9
9
  name 'xinetd_conf'
10
10
  supports platform: 'unix'
11
11
  desc 'Xinetd services configuration.'
12
- example "
12
+ example <<~EXAMPLE
13
13
  describe xinetd_conf.services('chargen') do
14
14
  its('socket_types') { should include 'dgram' }
15
15
  end
@@ -17,7 +17,7 @@ module Inspec::Resources
17
17
  describe xinetd_conf.services('chargen').socket_types('dgram') do
18
18
  it { should be_disabled }
19
19
  end
20
- "
20
+ EXAMPLE
21
21
 
22
22
  include XinetdParser
23
23
  include FileReader
@@ -6,12 +6,12 @@ module Inspec::Resources
6
6
  supports platform: 'unix'
7
7
  supports platform: 'windows'
8
8
  desc 'Use the xml InSpec resource to test configuration data in an XML file'
9
- example "
9
+ example <<~EXAMPLE
10
10
  describe xml('default.xml') do
11
11
  its('key/sub_key') { should eq(['value']) }
12
12
  its(['root/name.with.a.period']) { should cmp 'so_many_dots' }
13
13
  end
14
- "
14
+ EXAMPLE
15
15
 
16
16
  def parse(content)
17
17
  require 'rexml/document'
@@ -11,7 +11,7 @@ module Inspec::Resources
11
11
  class YamlConfig < JsonConfig
12
12
  name 'yaml'
13
13
  desc 'Use the yaml InSpec audit resource to test configuration data in a YAML file.'
14
- example "
14
+ example <<~EXAMPLE
15
15
  describe yaml('config.yaml') do
16
16
  its(['driver', 'name']) { should eq 'vagrant' }
17
17
  end
@@ -23,7 +23,7 @@ module Inspec::Resources
23
23
  describe yaml({ content: \"key1: value1\nkey2: value2\" }) do
24
24
  its('key2') { should cmp 'value2' }
25
25
  end
26
- "
26
+ EXAMPLE
27
27
 
28
28
  # override file load and parse hash from yaml
29
29
  def parse(content)
@@ -32,12 +32,12 @@ module Inspec::Resources
32
32
  name 'yum'
33
33
  supports platform: 'unix'
34
34
  desc 'Use the yum InSpec audit resource to test the configuration of Yum repositories.'
35
- example "
35
+ example <<~EXAMPLE
36
36
  describe yum.repo('name') do
37
37
  it { should exist }
38
38
  it { should be_enabled }
39
39
  end
40
- "
40
+ EXAMPLE
41
41
 
42
42
  # returns all repositories
43
43
  # works as following:
@@ -8,12 +8,12 @@ module Inspec::Resources
8
8
  Use the zfs_dataset InSpec audit resource to test if the named
9
9
  ZFS Dataset is present and/or has certain properties.
10
10
  "
11
- example "
11
+ example <<~EXAMPLE
12
12
  describe zfs_dataset('tank/tmp') do
13
13
  its('exec') { should eq('off') }
14
14
  its('setuid') { should eq('off') }
15
15
  end
16
- "
16
+ EXAMPLE
17
17
 
18
18
  def initialize(zfs_dataset)
19
19
  return skip_resource 'The `zfs_dataset` resource is not supported on your OS yet.' if !inspec.os.bsd?
@@ -8,11 +8,11 @@ module Inspec::Resources
8
8
  Use the zfs_pool InSpec audit resource to test if the named
9
9
  ZFS Pool is present and/or has certain properties.
10
10
  "
11
- example "
11
+ example <<~EXAMPLE
12
12
  describe zfs_pool('tank') do
13
13
  its('failmode') { should eq('continue') }
14
14
  end
15
- "
15
+ EXAMPLE
16
16
 
17
17
  def initialize(zfs_pool)
18
18
  return skip_resource 'The `zfs_pool` resource is not supported on your OS yet.' if !inspec.os.bsd?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-02 00:00:00.000000000 Z
11
+ date: 2019-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: train
@@ -501,9 +501,28 @@ files:
501
501
  - lib/plugins/inspec-compliance/test/unit/api/login_test.rb
502
502
  - lib/plugins/inspec-compliance/test/unit/api_test.rb
503
503
  - lib/plugins/inspec-compliance/test/unit/target_test.rb
504
+ - lib/plugins/inspec-habitat/Berksfile
505
+ - lib/plugins/inspec-habitat/README.md
506
+ - lib/plugins/inspec-habitat/kitchen.yml
504
507
  - lib/plugins/inspec-habitat/lib/inspec-habitat.rb
505
508
  - lib/plugins/inspec-habitat/lib/inspec-habitat/cli.rb
506
509
  - lib/plugins/inspec-habitat/lib/inspec-habitat/profile.rb
510
+ - lib/plugins/inspec-habitat/templates/habitat/config/inspec_exec_config.json.erb
511
+ - lib/plugins/inspec-habitat/templates/habitat/default.toml.erb
512
+ - lib/plugins/inspec-habitat/templates/habitat/hooks/run.erb
513
+ - lib/plugins/inspec-habitat/templates/habitat/plan.sh.erb
514
+ - lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/Berksfile
515
+ - lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/README.md
516
+ - lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/files/hab_setup.exp
517
+ - lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/metadata.rb
518
+ - lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/recipes/default.rb
519
+ - lib/plugins/inspec-habitat/test/functional/inspec_habitat_test.rb
520
+ - lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/README.md
521
+ - lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/controls/inspec_habitat.rb
522
+ - lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/inspec.yml
523
+ - lib/plugins/inspec-habitat/test/support/example_profile/README.md
524
+ - lib/plugins/inspec-habitat/test/support/example_profile/controls/example.rb
525
+ - lib/plugins/inspec-habitat/test/support/example_profile/inspec.yml
507
526
  - lib/plugins/inspec-habitat/test/unit/profile_test.rb
508
527
  - lib/plugins/inspec-init/README.md
509
528
  - lib/plugins/inspec-init/lib/inspec-init.rb
@@ -532,6 +551,10 @@ files:
532
551
  - lib/plugins/inspec-init/templates/profiles/aws/controls/example.rb
533
552
  - lib/plugins/inspec-init/templates/profiles/aws/inspec.yml
534
553
  - lib/plugins/inspec-init/templates/profiles/aws/libraries/.gitkeep
554
+ - lib/plugins/inspec-init/templates/profiles/azure/README.md
555
+ - lib/plugins/inspec-init/templates/profiles/azure/controls/example.rb
556
+ - lib/plugins/inspec-init/templates/profiles/azure/inspec.yml
557
+ - lib/plugins/inspec-init/templates/profiles/azure/libraries/.gitkeep
535
558
  - lib/plugins/inspec-init/templates/profiles/gcp/README.md
536
559
  - lib/plugins/inspec-init/templates/profiles/gcp/attributes.yml
537
560
  - lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
@@ -763,8 +786,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
763
786
  - !ruby/object:Gem::Version
764
787
  version: '0'
765
788
  requirements: []
766
- rubyforge_project:
767
- rubygems_version: 2.7.6
789
+ rubygems_version: 3.0.3
768
790
  signing_key:
769
791
  specification_version: 4
770
792
  summary: Infrastructure and compliance testing.