cfn-guardian 0.3.3 → 0.3.4
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/README.md +2 -2
- data/lib/cfnguardian/models/alarm.rb +24 -0
- data/lib/cfnguardian/resources/internal_http.rb +8 -8
- data/lib/cfnguardian/resources/internal_port.rb +4 -4
- data/lib/cfnguardian/resources/internal_sftp.rb +8 -8
- data/lib/cfnguardian/resources/log_group.rb +2 -2
- data/lib/cfnguardian/resources/sftp.rb +1 -1
- data/lib/cfnguardian/resources/sql.rb +2 -2
- data/lib/cfnguardian/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d581e6ce59e93bd98f1b542df4c5a9fb40d701b6d9d63db76388ab31c173a6c5
|
4
|
+
data.tar.gz: ae4f1428fb07d69a9005c62dbebad1e426a73f5025f916d3374218e6f2bf84c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7bd308a2c4c7a8c8b44b88ceaad2c19a0f98911935eec52017987f0130e4299bf6dccf8b89d772d2797b7a610a696ed3bbf8ab7f79eb9a6782f8ee85f5d4dba
|
7
|
+
data.tar.gz: 0d69278f70848411b4e1baf8d495fa56bf858d67923f25888257bb12b9a806e13bcf5c2dc2cd23401c2df2435b4cee9b6416161e400c281c025c41c6efdf4d6c
|
data/README.md
CHANGED
@@ -496,7 +496,7 @@ Resources:
|
|
496
496
|
# optionally set a file to check its existence and test the time it takes to get the file
|
497
497
|
File: file.txt
|
498
498
|
# optionally check for a regex match pattern in the body of the file
|
499
|
-
|
499
|
+
FileBodyMatch: ok
|
500
500
|
```
|
501
501
|
|
502
502
|
#### InternalSFTP
|
@@ -525,7 +525,7 @@ Resources:
|
|
525
525
|
PrivateKey: /ssm/path/privatekey
|
526
526
|
PrivateKeyPass: /ssm/path/privatekey/password
|
527
527
|
File: file.txt
|
528
|
-
|
528
|
+
FileBodyMatch: ok
|
529
529
|
```
|
530
530
|
|
531
531
|
#### TLS
|
@@ -207,6 +207,12 @@ module CfnGuardian
|
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
|
+
class InternalHttpAlarm < HttpAlarm
|
211
|
+
def initialize(resource)
|
212
|
+
super(resource)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
210
216
|
class PortAlarm < Alarm
|
211
217
|
def initialize(resource)
|
212
218
|
super(resource)
|
@@ -218,6 +224,12 @@ module CfnGuardian
|
|
218
224
|
@evaluation_periods = 2
|
219
225
|
end
|
220
226
|
end
|
227
|
+
|
228
|
+
class InternalPortAlarm < PortAlarm
|
229
|
+
def initialize(resource)
|
230
|
+
super(resource)
|
231
|
+
end
|
232
|
+
end
|
221
233
|
|
222
234
|
class SslAlarm < Alarm
|
223
235
|
def initialize(resource)
|
@@ -228,6 +240,12 @@ module CfnGuardian
|
|
228
240
|
@comparison_operator = 'LessThanThreshold'
|
229
241
|
end
|
230
242
|
end
|
243
|
+
|
244
|
+
class InternalSslAlarm < SslAlarm
|
245
|
+
def initialize(resource)
|
246
|
+
super(resource)
|
247
|
+
end
|
248
|
+
end
|
231
249
|
|
232
250
|
class NrpeAlarm < Alarm
|
233
251
|
def initialize(resource,environment)
|
@@ -335,6 +353,12 @@ module CfnGuardian
|
|
335
353
|
@dimensions = { Host: resource['Id'], User: resource['User'] }
|
336
354
|
end
|
337
355
|
end
|
356
|
+
|
357
|
+
class InternalSFTPAlarm < SFTPAlarm
|
358
|
+
def initialize(resource)
|
359
|
+
super(resource)
|
360
|
+
end
|
361
|
+
end
|
338
362
|
|
339
363
|
class TLSAlarm < Alarm
|
340
364
|
def initialize(resource)
|
@@ -3,25 +3,25 @@ require 'digest/md5'
|
|
3
3
|
module CfnGuardian::Resource
|
4
4
|
class InternalHttp < Base
|
5
5
|
|
6
|
-
def initialize(resource)
|
7
|
-
super(resource)
|
6
|
+
def initialize(resource, override_group = nil)
|
7
|
+
super(resource, override_group)
|
8
8
|
@resource_list = resource['Hosts']
|
9
9
|
@environment = resource['Environment']
|
10
10
|
end
|
11
11
|
|
12
12
|
def default_alarms
|
13
13
|
@resource_list.each do |host|
|
14
|
-
alarm = CfnGuardian::Models::
|
14
|
+
alarm = CfnGuardian::Models::InternalHttpAlarm.new(host)
|
15
15
|
alarm.name = 'EndpointAvailable'
|
16
16
|
alarm.metric_name = 'Available'
|
17
17
|
@alarms.push(alarm)
|
18
18
|
|
19
|
-
alarm = CfnGuardian::Models::
|
19
|
+
alarm = CfnGuardian::Models::InternalHttpAlarm.new(host)
|
20
20
|
alarm.name = 'EndpointStatusCodeMatch'
|
21
21
|
alarm.metric_name = 'StatusCodeMatch'
|
22
22
|
@alarms.push(alarm)
|
23
23
|
|
24
|
-
alarm = CfnGuardian::Models::
|
24
|
+
alarm = CfnGuardian::Models::InternalHttpAlarm.new(host)
|
25
25
|
alarm.name = 'EndpointTimeTaken'
|
26
26
|
alarm.comparison_operator = 'GreaterThanThreshold'
|
27
27
|
alarm.metric_name = 'TimeTaken'
|
@@ -32,20 +32,20 @@ module CfnGuardian::Resource
|
|
32
32
|
@alarms.push(alarm)
|
33
33
|
|
34
34
|
if host.has_key?('BodyRegex')
|
35
|
-
alarm = CfnGuardian::Models::
|
35
|
+
alarm = CfnGuardian::Models::InternalHttpAlarm.new(host)
|
36
36
|
alarm.name = 'EndpointBodyRegexMatch'
|
37
37
|
alarm.metric_name = 'ResponseBodyRegexMatch'
|
38
38
|
@alarms.push(alarm)
|
39
39
|
end
|
40
40
|
|
41
41
|
if host.has_key?('Ssl') && host['Ssl']
|
42
|
-
alarm = CfnGuardian::Models::
|
42
|
+
alarm = CfnGuardian::Models::InternalSslAlarm.new(host)
|
43
43
|
alarm.name = 'ExpiresInDaysCritical'
|
44
44
|
alarm.metric_name = 'ExpiresInDays'
|
45
45
|
alarm.threshold = 5
|
46
46
|
@alarms.push(alarm)
|
47
47
|
|
48
|
-
alarm = CfnGuardian::Models::
|
48
|
+
alarm = CfnGuardian::Models::InternalSslAlarm.new(host)
|
49
49
|
alarm.name = 'ExpiresInDaysTask'
|
50
50
|
alarm.metric_name = 'ExpiresInDays'
|
51
51
|
alarm.threshold = 30
|
@@ -1,20 +1,20 @@
|
|
1
1
|
module CfnGuardian::Resource
|
2
2
|
class InternalPort < Base
|
3
3
|
|
4
|
-
def initialize(resource)
|
5
|
-
super(resource)
|
4
|
+
def initialize(resource, override_group = nil)
|
5
|
+
super(resource, override_group)
|
6
6
|
@resource_list = resource['Hosts']
|
7
7
|
@environment = resource['Environment']
|
8
8
|
end
|
9
9
|
|
10
10
|
def default_alarms
|
11
11
|
@resource_list.each do |host|
|
12
|
-
alarm = CfnGuardian::Models::
|
12
|
+
alarm = CfnGuardian::Models::InternalPortAlarm.new(host)
|
13
13
|
alarm.name = 'EndpointAvailable'
|
14
14
|
alarm.metric_name = 'Available'
|
15
15
|
@alarms.push(alarm)
|
16
16
|
|
17
|
-
alarm = CfnGuardian::Models::
|
17
|
+
alarm = CfnGuardian::Models::InternalPortAlarm.new(host)
|
18
18
|
alarm.name = 'EndpointTimeTaken'
|
19
19
|
alarm.metric_name = 'TimeTaken'
|
20
20
|
@alarms.push(alarm)
|
@@ -1,20 +1,20 @@
|
|
1
1
|
module CfnGuardian::Resource
|
2
2
|
class InternalSFTP < Base
|
3
3
|
|
4
|
-
def initialize(resource)
|
5
|
-
super(resource)
|
4
|
+
def initialize(resource, override_group = nil)
|
5
|
+
super(resource, override_group)
|
6
6
|
@resource_list = resource['Hosts']
|
7
7
|
@environment = resource['Environment']
|
8
8
|
end
|
9
9
|
|
10
10
|
def default_alarms
|
11
11
|
@resource_list.each do |host|
|
12
|
-
alarm = CfnGuardian::Models::
|
12
|
+
alarm = CfnGuardian::Models::InternalSFTPAlarm.new(host)
|
13
13
|
alarm.name = 'Available'
|
14
14
|
alarm.metric_name = 'Available'
|
15
15
|
@alarms.push(alarm)
|
16
16
|
|
17
|
-
alarm = CfnGuardian::Models::
|
17
|
+
alarm = CfnGuardian::Models::InternalSFTPAlarm.new(host)
|
18
18
|
alarm.name = 'ConnectionTime'
|
19
19
|
alarm.metric_name = 'ConnectionTime'
|
20
20
|
alarm.comparison_operator = 'GreaterThanThreshold'
|
@@ -23,12 +23,12 @@ module CfnGuardian::Resource
|
|
23
23
|
@alarms.push(alarm)
|
24
24
|
|
25
25
|
if host.has_key?('File')
|
26
|
-
alarm = CfnGuardian::Models::
|
26
|
+
alarm = CfnGuardian::Models::InternalSFTPAlarm.new(host)
|
27
27
|
alarm.name = 'FileExists'
|
28
28
|
alarm.metric_name = 'FileExists'
|
29
29
|
@alarms.push(alarm)
|
30
30
|
|
31
|
-
alarm = CfnGuardian::Models::
|
31
|
+
alarm = CfnGuardian::Models::InternalSFTPAlarm.new(host)
|
32
32
|
alarm.name = 'FileGetTime'
|
33
33
|
alarm.metric_name = 'FileGetTime'
|
34
34
|
alarm.comparison_operator = 'GreaterThanThreshold'
|
@@ -36,8 +36,8 @@ module CfnGuardian::Resource
|
|
36
36
|
alarm.threshold = 1000
|
37
37
|
@alarms.push(alarm)
|
38
38
|
|
39
|
-
if host.has_key?('
|
40
|
-
alarm = CfnGuardian::Models::
|
39
|
+
if host.has_key?('FileBodyMatch')
|
40
|
+
alarm = CfnGuardian::Models::InternalSFTPAlarm.new(host)
|
41
41
|
alarm.name = 'FileBodyMatch'
|
42
42
|
alarm.metric_name = 'FileBodyMatch'
|
43
43
|
@alarms.push(alarm)
|
@@ -29,7 +29,7 @@ module CfnGuardian::Resource
|
|
29
29
|
alarm.threshold = 1000
|
30
30
|
@alarms.push(alarm)
|
31
31
|
|
32
|
-
if @resource.has_key?('
|
32
|
+
if @resource.has_key?('FileBodyMatch')
|
33
33
|
alarm = CfnGuardian::Models::SFTPAlarm.new(@resource)
|
34
34
|
alarm.name = 'FileBodyMatch'
|
35
35
|
alarm.metric_name = 'FileBodyMatch'
|
@@ -4,8 +4,8 @@ require 'cfnguardian/string'
|
|
4
4
|
module CfnGuardian::Resource
|
5
5
|
class Sql < Base
|
6
6
|
|
7
|
-
def initialize(resource)
|
8
|
-
super(resource)
|
7
|
+
def initialize(resource, override_group = nil)
|
8
|
+
super(resource, override_group)
|
9
9
|
@resource_list = resource['Hosts']
|
10
10
|
@environment = resource['Environment']
|
11
11
|
end
|
data/lib/cfnguardian/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfn-guardian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guslington
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -289,7 +289,7 @@ metadata:
|
|
289
289
|
homepage_uri: https://github.com/base2Services/cfn-guardian
|
290
290
|
source_code_uri: https://github.com/base2Services/cfn-guardian
|
291
291
|
changelog_uri: https://github.com/base2Services/cfn-guardian
|
292
|
-
post_install_message:
|
292
|
+
post_install_message:
|
293
293
|
rdoc_options: []
|
294
294
|
require_paths:
|
295
295
|
- lib
|
@@ -304,9 +304,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
304
304
|
- !ruby/object:Gem::Version
|
305
305
|
version: '0'
|
306
306
|
requirements: []
|
307
|
-
rubyforge_project:
|
307
|
+
rubyforge_project:
|
308
308
|
rubygems_version: 2.7.6
|
309
|
-
signing_key:
|
309
|
+
signing_key:
|
310
310
|
specification_version: 4
|
311
311
|
summary: Manages AWS cloudwatch alarms with default templates using cloudformation
|
312
312
|
test_files: []
|