Skip to content

Commit

Permalink
[CVE-2017-8418] - updating rubocop dependency.
Browse files Browse the repository at this point in the history
Breaking Changes:
- updatd `sensu-plugin` deps for 2.x

Signed-off-by: Ben Abrams <me@benabrams.it>
  • Loading branch information
majormoses committed Dec 11, 2017
1 parent 0c7f19a commit 92408c5
Show file tree
Hide file tree
Showing 24 changed files with 39 additions and 51 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ This CHANGELOG follows the format located [here](https://github.com/sensu-plugin

## [Unreleased]

### Security
- updated rubocop dependency to `~> 0.51.0` per: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418. (@majormoses)

### Breaking Changes
- 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)


## [1.0.0] - 2017-12-10
### Changed
- changelog gudelines location (@majormoses)
Expand Down
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ require 'English'
require 'kitchen/rake_tasks'

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

RuboCop::RakeTask.new
Expand Down Expand Up @@ -45,5 +45,5 @@ Kitchen::RakeTasks.new
desc 'Alias for kitchen:all'
task integration: 'kitchen:all'

task default: %i(spec make_bin_executable yard rubocop check_binstubs integration)
task quick: %i(make_bin_executable yard rubocop check_binstubs)
task default: %i[spec make_bin_executable yard rubocop check_binstubs integration]
task quick: %i[make_bin_executable yard rubocop check_binstubs]
3 changes: 1 addition & 2 deletions bin/check-azurerm-core-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-cores-d-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-cores-ds-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-cores-dsv2-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-cores-dv2-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-cores-f-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-cores-fs-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-load-balancers-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-network-interfaces-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-network-security-groups-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-public-ip-addresses-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-route-tables-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-service-bus-subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ def run
else
ok "Subscription '#{config[:subscription_name]}' was found in topic '#{config[:topic_name]}'"
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-service-bus-topic-size.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-static-public-ip-addresses-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-virtual-machines-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
5 changes: 2 additions & 3 deletions bin/check-azurerm-virtual-network-gateway-connected.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,12 @@ def run
inbound = result.ingress_bytes_transferred
outbound = result.egress_bytes_transferred
message = "State is '#{connection_state}'. Usage is #{inbound} in / #{outbound} out"
if result.connection_status.casecmp('connected') == 0
if result.connection_status.casecmp('connected').zero?
ok message
else
critical message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ def run
message = "Primary: State is '#{primary_connection_state}'. Usage is #{primary_inbound} in / #{primary_outbound} out.\n"
message += "Secondary: State is '#{secondary_connection_state}'. Usage is #{secondary_inbound} in / #{secondary_outbound} out."

if primary_result.connection_status.casecmp('connected') == 0 ||
secondary_result.connection_status.casecmp('connected') == 0
if primary_result.connection_status.casecmp('connected').zero? ||
secondary_result.connection_status.casecmp('connected').zero?
ok message
else
critical message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
3 changes: 1 addition & 2 deletions bin/check-azurerm-virtual-networks-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def run
else
ok message
end

rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def run

output metric_name, count, timestamp
ok
rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
2 changes: 1 addition & 1 deletion bin/metric-azurerm-virtual-network-gateway-usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def run
output inbound_name, inbound, timestamp
output outbound_name, outbound, timestamp
ok
rescue => e
rescue StandardError => e
puts "Error: exception: #{e}"
critical
end
Expand Down
8 changes: 4 additions & 4 deletions sensu-plugins-azurerm.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'date'
require './lib/sensu-plugins-azurerm.rb'

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

s.add_development_dependency 'bundler', '~> 1.7'
s.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
Expand All @@ -44,7 +44,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rake', '~> 10.5'
s.add_development_dependency 'redcarpet', '~> 3.2'
s.add_development_dependency 'rspec', '~> 3.4'
s.add_development_dependency 'rubocop', '~> 0.40.0'
s.add_development_dependency 'rubocop', '~> 0.51.0'
s.add_development_dependency 'serverspec', '~> 2.36.1'
s.add_development_dependency 'test-kitchen', '~> 1.6'
s.add_development_dependency 'yard', '~> 0.8'
Expand Down

0 comments on commit 92408c5

Please sign in to comment.