Skip to content

Commit 92408c5

Browse files
committed
[CVE-2017-8418] - updating rubocop dependency.
Breaking Changes: - updatd `sensu-plugin` deps for 2.x Signed-off-by: Ben Abrams <[email protected]>
1 parent 0c7f19a commit 92408c5

24 files changed

+39
-51
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ This CHANGELOG follows the format located [here](https://github.com/sensu-plugin
55

66
## [Unreleased]
77

8+
### Security
9+
- updated rubocop dependency to `~> 0.51.0` per: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418. (@majormoses)
10+
11+
### Breaking Changes
12+
- bumped dependency of `sensu-plugin` to 2.x you can read about it [here](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v200---2017-03-29) (@majormoses)
13+
14+
815
## [1.0.0] - 2017-12-10
916
### Changed
1017
- changelog gudelines location (@majormoses)

Rakefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ require 'English'
1111
require 'kitchen/rake_tasks'
1212

1313
YARD::Rake::YardocTask.new do |t|
14-
OTHER_PATHS = %w().freeze
14+
OTHER_PATHS = %w[].freeze
1515
t.files = ['lib/**/*.rb', 'bin/**/*.rb', OTHER_PATHS]
16-
t.options = %w(--markup-provider=redcarpet --markup=markdown --main=README.md --files CHANGELOG.md)
16+
t.options = %w[--markup-provider=redcarpet --markup=markdown --main=README.md --files CHANGELOG.md]
1717
end
1818

1919
RuboCop::RakeTask.new
@@ -45,5 +45,5 @@ Kitchen::RakeTasks.new
4545
desc 'Alias for kitchen:all'
4646
task integration: 'kitchen:all'
4747

48-
task default: %i(spec make_bin_executable yard rubocop check_binstubs integration)
49-
task quick: %i(make_bin_executable yard rubocop check_binstubs)
48+
task default: %i[spec make_bin_executable yard rubocop check_binstubs integration]
49+
task quick: %i[make_bin_executable yard rubocop check_binstubs]

bin/check-azurerm-core-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-cores-d-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-cores-ds-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-cores-dsv2-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-cores-dv2-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-cores-f-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-cores-fs-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-load-balancers-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-network-interfaces-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-network-security-groups-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-public-ip-addresses-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-route-tables-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-service-bus-subscription.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ def run
107107
else
108108
ok "Subscription '#{config[:subscription_name]}' was found in topic '#{config[:topic_name]}'"
109109
end
110-
111-
rescue => e
110+
rescue StandardError => e
112111
puts "Error: exception: #{e}"
113112
critical
114113
end

bin/check-azurerm-service-bus-topic-size.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ def run
127127
else
128128
ok message
129129
end
130-
131-
rescue => e
130+
rescue StandardError => e
132131
puts "Error: exception: #{e}"
133132
critical
134133
end

bin/check-azurerm-static-public-ip-addresses-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-virtual-machines-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/check-azurerm-virtual-network-gateway-connected.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,12 @@ def run
9999
inbound = result.ingress_bytes_transferred
100100
outbound = result.egress_bytes_transferred
101101
message = "State is '#{connection_state}'. Usage is #{inbound} in / #{outbound} out"
102-
if result.connection_status.casecmp('connected') == 0
102+
if result.connection_status.casecmp('connected').zero?
103103
ok message
104104
else
105105
critical message
106106
end
107-
108-
rescue => e
107+
rescue StandardError => e
109108
puts "Error: exception: #{e}"
110109
critical
111110
end

bin/check-azurerm-virtual-network-gateway-failure-connected.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,13 @@ def run
119119
message = "Primary: State is '#{primary_connection_state}'. Usage is #{primary_inbound} in / #{primary_outbound} out.\n"
120120
message += "Secondary: State is '#{secondary_connection_state}'. Usage is #{secondary_inbound} in / #{secondary_outbound} out."
121121

122-
if primary_result.connection_status.casecmp('connected') == 0 ||
123-
secondary_result.connection_status.casecmp('connected') == 0
122+
if primary_result.connection_status.casecmp('connected').zero? ||
123+
secondary_result.connection_status.casecmp('connected').zero?
124124
ok message
125125
else
126126
critical message
127127
end
128-
129-
rescue => e
128+
rescue StandardError => e
130129
puts "Error: exception: #{e}"
131130
critical
132131
end

bin/check-azurerm-virtual-networks-usage.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def run
113113
else
114114
ok message
115115
end
116-
117-
rescue => e
116+
rescue StandardError => e
118117
puts "Error: exception: #{e}"
119118
critical
120119
end

bin/metric-azurerm-service-bus-subscription-message-count.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def run
127127

128128
output metric_name, count, timestamp
129129
ok
130-
rescue => e
130+
rescue StandardError => e
131131
puts "Error: exception: #{e}"
132132
critical
133133
end

bin/metric-azurerm-virtual-network-gateway-usage.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def run
112112
output inbound_name, inbound, timestamp
113113
output outbound_name, outbound, timestamp
114114
ok
115-
rescue => e
115+
rescue StandardError => e
116116
puts "Error: exception: #{e}"
117117
critical
118118
end

sensu-plugins-azurerm.gemspec

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
44
require 'date'
55
require './lib/sensu-plugins-azurerm.rb'
66

7-
Gem::Specification.new do |s|
7+
Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
88
s.authors = ['Tom Harvey']
99
s.date = Date.today.to_s
1010
s.description = 'This plugin provides checks for Microsoft Azure\'s Resource Manager service.'
1111
s.email = '<[email protected]>'
1212
s.executables = Dir.glob('bin/**/*.rb').map { |file| File.basename(file) }
13-
s.files = Dir.glob('{bin,lib}/**/*') + %w(LICENSE README.md CHANGELOG.md)
13+
s.files = Dir.glob('{bin,lib}/**/*') + %w[LICENSE README.md CHANGELOG.md]
1414
s.homepage = 'https://github.com/tombuildsstuff/sensu-plugins-azurerm'
1515
s.license = 'MIT'
1616
s.metadata = { 'maintainer' => 'Tom Harvey',
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
3131
s.add_runtime_dependency 'azure_mgmt_network', '0.8.0'
3232
s.add_runtime_dependency 'azure_mgmt_service_bus', '0.8.0'
3333
s.add_runtime_dependency 'ms_rest_azure', '~> 0.6.2'
34-
s.add_runtime_dependency 'sensu-plugin', '~> 1.3'
34+
s.add_runtime_dependency 'sensu-plugin', '~> 2.0'
3535

3636
s.add_development_dependency 'bundler', '~> 1.7'
3737
s.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
4444
s.add_development_dependency 'rake', '~> 10.5'
4545
s.add_development_dependency 'redcarpet', '~> 3.2'
4646
s.add_development_dependency 'rspec', '~> 3.4'
47-
s.add_development_dependency 'rubocop', '~> 0.40.0'
47+
s.add_development_dependency 'rubocop', '~> 0.51.0'
4848
s.add_development_dependency 'serverspec', '~> 2.36.1'
4949
s.add_development_dependency 'test-kitchen', '~> 1.6'
5050
s.add_development_dependency 'yard', '~> 0.8'

0 commit comments

Comments
 (0)