sensu-plugins-aws 11.1.0 → 11.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52c7355c7f130cafcc95d18c1156cac80d9792cb241098c61f9068443c3a11fd
4
- data.tar.gz: b6e0d9e624ccf1e0069df968c1a75d6a328f7f92e3163957c92f01189124e7c0
3
+ metadata.gz: 95656236ef931e5742bd4ebc17069882270b5ef59680175ebeaa12b12b468ac5
4
+ data.tar.gz: 838795f8732303b1dcc52b754a911cfb85d018cd8d26a4740dfa635ffcad40dc
5
5
  SHA512:
6
- metadata.gz: 580a14d2aa95d515887acff5bd11bd22db1b5af2aa26afcd335cfb04509e48fd3c83c5596f83b718319370a56f2ef39f9f314f811a7d58a6d8c81a9e1f3a6a58
7
- data.tar.gz: e680f5379849fcba56dd0864bb8bac02f0c29d6eae2723315cbb246ee4e4fc8553162c5d86916cb9bf5d2d29c7a2a971a88e5326a56d714c16e25acec0522ed6
6
+ metadata.gz: a3e808d291336ea960be67dd9712b27dd9b688a9a16ebb85fd04b35e45455a0080704d8c95b6744e92e32d13ed7e2f5241587f1565540a8b62c63cde3458b696
7
+ data.tar.gz: fbf8e8d6b32217d8ba03d319830488482c8f9d0cc53118b2cf27f235ae7bc4abfa4a49bc37c0103e435929767b11236d00394362e7f6c6d240b091b2d44165b1
data/CHANGELOG.md CHANGED
@@ -5,7 +5,14 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
- ## [11.0.0] - 2018-11-21
8
+ ## [11.1.0] - 2018-11-22
9
+ ### Added
10
+ - check-s3-bucket-visibility.rb: option `--exclude-regex-filter` to allow using regex to filter out undesired buckets from the results (@majormoses)
11
+
12
+ ### Fixed
13
+ - check-s3-bucket-visibility.rb: fixed `nilClass` error when `--exlcuded-buckets` was not provided by returning false if its nil (@majormoses)
14
+
15
+ ## [11.1.0] - 2018-11-21
9
16
  ### Added
10
17
  - check-s3-bucket-visibility.rb: added option `--all-buckets` to check for all buckets in the region specified for insecure buckets (@majormoses)
11
18
  - check-s3-bucket-visibility.rb: added option `--excluded-buckets` to ignore specific buckets that are expected to be loose such as s3 buckets for static website hosting (@majormoses)
@@ -444,7 +451,8 @@ WARNING: This release contains major breaking changes that will impact all user
444
451
  ### Added
445
452
  - initial release
446
453
 
447
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.1.0...HEAD
454
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.2.0...HEAD
455
+ [11.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.1.0...11.2.0
448
456
  [11.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.0.0...11.1.0
449
457
  [11.0.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/10.2.0...11.0.0
450
458
  [10.2.0]:https://github.com/sensu-plugins/sensu-plugins-aws/compare/10.1.2...10.2.0
@@ -60,6 +60,10 @@ class CheckS3Bucket < Sensu::Plugin::Check::CLI
60
60
  description: 'A comma seperated list of buckets to ignore that are expected to have loose permissions',
61
61
  proc: proc { |b| b.split(',') }
62
62
 
63
+ option :exclude_regex_filter,
64
+ long: '--exclude-regex-filter MY_REGEX',
65
+ description: 'A regex to filter out bucket names'
66
+
63
67
  option :critical_on_missing,
64
68
  short: '-m ',
65
69
  long: '--critical-on-missing',
@@ -91,9 +95,19 @@ class CheckS3Bucket < Sensu::Plugin::Check::CLI
91
95
  end
92
96
 
93
97
  def excluded_bucket?(bucket_name)
98
+ return false if config[:exclude_buckets].nil?
94
99
  config[:exclude_buckets].include?(bucket_name)
95
100
  end
96
101
 
102
+ def excluded_bucket_regex?(bucket_name)
103
+ return false if config[:exclude_regex_filter].nil?
104
+ if bucket_name.match(Regexp.new(Regexp.escape(config[:exclude_regex_filter])))
105
+ true
106
+ else
107
+ false
108
+ end
109
+ end
110
+
97
111
  def website_configuration?(bucket_name)
98
112
  s3_client.get_bucket_website(bucket: bucket_name)
99
113
  true
@@ -134,6 +148,9 @@ class CheckS3Bucket < Sensu::Plugin::Check::CLI
134
148
  if excluded_bucket?(bucket_name)
135
149
  p "bucket_name: #{bucket_name} was ignored as it matched excluded_buckets"
136
150
  next
151
+ elsif excluded_bucket_regex?(bucket_name)
152
+ p "bucket_name: #{bucket_name} was ignored as it matched exclude_regex_filter: #{Regexp.new(Regexp.escape(config[:exclude_regex_filter]))}"
153
+ next
137
154
  end
138
155
  begin
139
156
  if website_configuration?(bucket_name)
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 11
4
- MINOR = 1
4
+ MINOR = 2
5
5
  PATCH = 0
6
6
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.1.0
4
+ version: 11.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-21 00:00:00.000000000 Z
11
+ date: 2018-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin