inspec 1.48.0 → 1.49.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/CHANGELOG.md +40 -16
  4. data/Rakefile +1 -1
  5. data/docs/resources/bond.md.erb +6 -1
  6. data/docs/resources/mysql_session.md.erb +24 -12
  7. data/docs/resources/passwd.md.erb +1 -1
  8. data/docs/resources/xml.md.erb +7 -2
  9. data/docs/shell.md +22 -0
  10. data/inspec.gemspec +1 -1
  11. data/lib/bundles/inspec-artifact/cli.rb +0 -2
  12. data/lib/bundles/inspec-compliance/api.rb +58 -3
  13. data/lib/bundles/inspec-compliance/cli.rb +1 -1
  14. data/lib/bundles/inspec-habitat/profile.rb +1 -1
  15. data/lib/fetchers/url.rb +1 -1
  16. data/lib/inspec/base_cli.rb +3 -1
  17. data/lib/inspec/cli.rb +11 -1
  18. data/lib/inspec/control_eval_context.rb +13 -2
  19. data/lib/inspec/dependencies/lockfile.rb +0 -2
  20. data/lib/inspec/dsl_shared.rb +8 -0
  21. data/lib/inspec/library_eval_context.rb +12 -1
  22. data/lib/inspec/metadata.rb +13 -44
  23. data/lib/inspec/objects/attribute.rb +1 -1
  24. data/lib/inspec/plugins/resource.rb +18 -2
  25. data/lib/inspec/profile.rb +17 -11
  26. data/lib/inspec/profile_context.rb +9 -3
  27. data/lib/inspec/profile_vendor.rb +1 -1
  28. data/lib/inspec/resource.rb +5 -0
  29. data/lib/inspec/rspec_json_formatter.rb +3 -3
  30. data/lib/inspec/rule.rb +1 -1
  31. data/lib/inspec/runner.rb +13 -5
  32. data/lib/inspec/schema.rb +1 -1
  33. data/lib/inspec/shell.rb +1 -1
  34. data/lib/inspec/version.rb +1 -1
  35. data/lib/resources/aide_conf.rb +0 -2
  36. data/lib/resources/apache_conf.rb +9 -2
  37. data/lib/resources/auditd.rb +0 -1
  38. data/lib/resources/auditd_rules.rb +0 -2
  39. data/lib/resources/bond.rb +4 -0
  40. data/lib/resources/crontab.rb +1 -1
  41. data/lib/resources/docker.rb +1 -1
  42. data/lib/resources/elasticsearch.rb +1 -1
  43. data/lib/resources/file.rb +2 -0
  44. data/lib/resources/groups.rb +29 -5
  45. data/lib/resources/grub_conf.rb +1 -1
  46. data/lib/resources/os.rb +8 -20
  47. data/lib/resources/package.rb +20 -21
  48. data/lib/resources/platform.rb +112 -0
  49. data/lib/resources/port.rb +1 -1
  50. data/lib/resources/processes.rb +1 -1
  51. data/lib/resources/registry_key.rb +1 -1
  52. data/lib/resources/service.rb +1 -1
  53. data/lib/resources/virtualization.rb +1 -1
  54. data/lib/resources/x509_certificate.rb +1 -1
  55. data/lib/resources/xml.rb +1 -0
  56. metadata +5 -10
@@ -381,7 +381,7 @@ module Inspec::Resources
381
381
  end
382
382
 
383
383
  # extract port information from netstat
384
- class LinuxPorts < PortsInfo # rubocop:disable Metrics/ClassLength
384
+ class LinuxPorts < PortsInfo
385
385
  ALLOWED_PROTOCOLS = %w{tcp tcp6 udp udp6}.freeze
386
386
 
387
387
  def info
@@ -7,7 +7,7 @@ require 'utils/filter'
7
7
  require 'ostruct'
8
8
 
9
9
  module Inspec::Resources
10
- class Processes < Inspec.resource(1) # rubocop:disable Metrics/ClassLength
10
+ class Processes < Inspec.resource(1)
11
11
  name 'processes'
12
12
  desc 'Use the processes InSpec audit resource to test properties for programs that are running on the system.'
13
13
  example "
@@ -47,7 +47,7 @@ require 'json'
47
47
  # end
48
48
 
49
49
  module Inspec::Resources
50
- class RegistryKey < Inspec.resource(1) # rubocop:disable Metrics/ClassLength
50
+ class RegistryKey < Inspec.resource(1)
51
51
  name 'registry_key'
52
52
  desc 'Use the registry_key InSpec audit resource to test key values in the Microsoft Windows registry.'
53
53
  example "
@@ -68,7 +68,7 @@ module Inspec::Resources
68
68
  # Ubuntu < 15.04 : upstart
69
69
  #
70
70
  # TODO: extend the logic to detect the running init system, independently of OS
71
- class Service < Inspec.resource(1) # rubocop:disable ClassLength
71
+ class Service < Inspec.resource(1)
72
72
  name 'service'
73
73
  desc 'Use the service InSpec audit resource to test if the named service is installed, running and/or enabled.'
74
74
  example "
@@ -4,7 +4,7 @@
4
4
  require 'hashie/mash'
5
5
 
6
6
  module Inspec::Resources
7
- class Virtualization < Inspec.resource(1) # rubocop:disable Metrics/ClassLength
7
+ class Virtualization < Inspec.resource(1)
8
8
  name 'virtualization'
9
9
  desc 'Use the virtualization InSpec audit resource to test the virtualization platform on which the system is running'
10
10
  example "
@@ -6,7 +6,7 @@ require 'openssl'
6
6
  require 'hashie/mash'
7
7
 
8
8
  module Inspec::Resources
9
- class X509CertificateResource < Inspec.resource(1) # rubocop:disable Metrics/ClassLength
9
+ class X509CertificateResource < Inspec.resource(1)
10
10
  name 'x509_certificate'
11
11
  desc 'Used to test x.509 certificates'
12
12
  example "
@@ -8,6 +8,7 @@ module Inspec::Resources
8
8
  example "
9
9
  describe xml('default.xml') do
10
10
  its('key/sub_key') { should eq(['value']) }
11
+ its(['root/name.with.a.period']) { should cmp 'so_many_dots' }
11
12
  end
12
13
  "
13
14
 
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: 1.48.0
4
+ version: 1.49.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-07 00:00:00.000000000 Z
11
+ date: 2018-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: train
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.31'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.31.1
19
+ version: '0.32'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.31'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.31.1
26
+ version: '0.32'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: thor
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -619,6 +613,7 @@ files:
619
613
  - lib/resources/parse_config.rb
620
614
  - lib/resources/passwd.rb
621
615
  - lib/resources/pip.rb
616
+ - lib/resources/platform.rb
622
617
  - lib/resources/port.rb
623
618
  - lib/resources/postgres.rb
624
619
  - lib/resources/postgres_conf.rb