sensu-plugins-aws 11.1.0 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -2
- data/bin/check-s3-bucket-visibility.rb +17 -0
- data/lib/sensu-plugins-aws/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 95656236ef931e5742bd4ebc17069882270b5ef59680175ebeaa12b12b468ac5
|
|
4
|
+
data.tar.gz: 838795f8732303b1dcc52b754a911cfb85d018cd8d26a4740dfa635ffcad40dc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
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)
|
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.
|
|
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-
|
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sensu-plugin
|