cfn-guardian 0.7.9 → 0.7.13

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: 87b0a72c2cf978be553f83a589a2d45643358ce43434ebd4fd6d3cf8974eee27
4
- data.tar.gz: c69af701ac2d137887d935c6afc6ea0503e9529c2aa685f86c0f134bc5e0905a
3
+ metadata.gz: 4a230076e5d4d93c1a41be549943f3dbb745662a8faaf04afc176a1b75d3cc8f
4
+ data.tar.gz: 036a95941c4c8e50641d4ee7e0bfdb4e2f842b125756898599af3055843ca8f0
5
5
  SHA512:
6
- metadata.gz: 11e0c2f2ef8d6b665fde021c661a4ad0c49201bc33281feab09c37ca07d9beebb64e7b2085bbd5076b89f64b2ab2e20a68f98d30c265427e25f22dfe60fc2c8e
7
- data.tar.gz: fca7427abb12c5616e4162fbf0ce3a7b9e33cafc6929c301ab3084f59f642eedad0a4c68130499f3a0e5afbf3889b7af7409951b601550f2fc61deefaf633252
6
+ metadata.gz: d54543ea87af6922725b6d5955b0f473d037be50de85eca77e6925f5534307ed37648085befc64a3f6753ccd0224ef00f65b666e1109324925596858c2cdd85b
7
+ data.tar.gz: bc5d74d51b7559bb5d3ddcabfc8ef9a0cac3b4e1f679e1267d41149a3f6ebc2108962cbd19e4eda8eb1b96c4e574711ee7fc63e8a955495e54796f33ecd217b9
data/Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
1
  FROM ruby:2.7-alpine
2
2
 
3
- ARG GUARDIAN_VERSION="0.7.7"
3
+ ARG GUARDIAN_VERSION="0.7.11"
4
4
 
5
5
  COPY . /src
6
6
 
data/README.md CHANGED
@@ -29,6 +29,7 @@ CfnGuardian is a AWS monitoring tool with a few capabilities:
29
29
  - Network TargetGroups
30
30
  - AutoScalingGroups
31
31
  - CloudFront Distributions
32
+ - DocumentDB Clusters
32
33
  - DynamoDB Tables
33
34
  - EC2 Instances
34
35
  - ECS Clusters
@@ -10,14 +10,14 @@ As with the default alarms in Guardian, there are default events for some resour
10
10
 
11
11
  ## Overriding Defaults
12
12
 
13
- Default properites of the events can be overridden through the config YAML using the `EventsSubscription` top level key.
13
+ Default properties of the events can be overridden through the config YAML using the `EventsSubscriptions` top level key.
14
14
  For example here we are changing the topic the event is being send to.
15
15
 
16
16
  ```yaml
17
17
  Topics:
18
18
  CustomEvents: arn:aws:sns....
19
19
 
20
- EventSubscription:
20
+ EventSubscriptions:
21
21
  Ec2Instance:
22
22
  InstanceTerminated:
23
23
  Topic: CustomEvents
@@ -28,12 +28,24 @@ EventSubscription:
28
28
  Default events can be disabled, the same way default alarms can be disabled through the config YAML.
29
29
 
30
30
  ```yaml
31
- EventSubscription:
31
+ EventSubscriptions:
32
32
  Ec2Instance:
33
33
  # set the instance terminated event to false to disable the event
34
34
  InstanceTerminated: false
35
35
  ```
36
36
 
37
+ ## Enabling Default Events
38
+
39
+ Some templates may have events that are disabled by default, they can be enabled using a slightly different syntax to disabling.
40
+
41
+ ```yaml
42
+ EventSubscriptions:
43
+ RDSInstance:
44
+ # set the replication failure event to true to enable the event
45
+ ReplicationFailure:
46
+ Enabled: true
47
+ ```
48
+
37
49
  ## Creating Custom Events
38
50
 
39
51
  Custom events can be created if there are not defaults for that event. They can be inherited from a default event or from the base event model.
@@ -44,7 +56,7 @@ This is useful if you want to create a new event and a default event already has
44
56
  The following example inherits the `MasterPasswordReset` RDS event and creates a new event that captures the security group add to an rds instance event.
45
57
 
46
58
  ```yaml
47
- EventSubscription:
59
+ EventSubscriptions:
48
60
  RDSInstance:
49
61
  # Create a new event name
50
62
  DBNewSecurityGroup:
@@ -59,7 +71,7 @@ EventSubscription:
59
71
  If there are no default events that match the format you require you can create an event of the base event subscription model.
60
72
 
61
73
  ```yaml
62
- EventSubscription:
74
+ EventSubscriptions:
63
75
  ECSCluster:
64
76
  ContainerInstanceStateChange:
65
77
  Source: aws.ecs
data/docs/overview.md CHANGED
@@ -6,7 +6,7 @@
6
6
  3. [Alarm Templates](alarm_templates.md)
7
7
  4. Custom Checks
8
8
  1. [HTTP](custom_checks/http.md)
9
- 2. [Domain Expirey](custom_checks/domain_expirey.md)
9
+ 2. [Domain Expiry](custom_checks/domain_expiry.md)
10
10
  3. [LogGroup Metric Filters](custom_checks/log_group_metric_filters.md)
11
11
  4. [NRPE](custom_checks/nrpe.md)
12
12
  5. [Port](custom_checks/port.md)
data/docs/resources.md CHANGED
@@ -39,6 +39,7 @@ Resources:
39
39
  | ApiGateway | Id |
40
40
  | AmazonMQBroker | Id |
41
41
  | AutoScalingGroup | Id |
42
+ | DocumentDBCluster | Id |
42
43
  | DynamoDBTable | Id |
43
44
  | ElastiCacheReplicationGroup | Id |
44
45
  | ElasticFileSystem | Id |
@@ -55,6 +56,8 @@ Resources:
55
56
  | CloudFrontDistribution | Id |
56
57
  | SQSQueue | Id |
57
58
  | ElasticSearch | Id, Domain |
59
+ | DMSCluster | Id |
60
+ | DMSTask | Id, Instance |
58
61
 
59
62
 
60
63
  ## Custom Resource Groups
@@ -12,6 +12,9 @@ require 'cfnguardian/resources/autoscaling_group'
12
12
  require 'cfnguardian/resources/cloudfront_distribution'
13
13
  require 'cfnguardian/resources/autoscaling_group'
14
14
  require 'cfnguardian/resources/domain_expiry'
15
+ require 'cfnguardian/resources/dms_task'
16
+ require 'cfnguardian/resources/dms_cluster'
17
+ require 'cfnguardian/resources/documentdb_cluster'
15
18
  require 'cfnguardian/resources/dynamodb_table'
16
19
  require 'cfnguardian/resources/ec2_instance'
17
20
  require 'cfnguardian/resources/ecs_cluster'
@@ -19,6 +19,8 @@ Resources:
19
19
  - Id: Default
20
20
  CloudFrontDistribution:
21
21
  - Id: Default
22
+ DocumentDBCluster:
23
+ - Id: Default
22
24
  DomainExpiry:
23
25
  - Id: Default
24
26
  DynamoDBTable:
@@ -153,6 +153,38 @@ module CfnGuardian
153
153
  @dimensions = { AutoScalingGroupName: resource['Id'] }
154
154
  end
155
155
  end
156
+
157
+ class DMSTaskAlarm < BaseAlarm
158
+ def initialize(resource)
159
+ super(resource)
160
+ @group = 'DMSTask'
161
+ @namespace = 'AWS/DMS'
162
+ @dimensions = {
163
+ ReplicationTaskIdentifier: resource['Id'],
164
+ ReplicationInstanceIdentifier: resource['Instance']
165
+ }
166
+ end
167
+ end
168
+
169
+ class DMSClusterAlarm < BaseAlarm
170
+ def initialize(resource)
171
+ super(resource)
172
+ @group = 'DMSCluster'
173
+ @namespace = 'AWS/DMS'
174
+ @dimensions = {
175
+ ReplicationInstanceIdentifier: resource['Id']
176
+ }
177
+ end
178
+ end
179
+
180
+ class DocumentDBClusterAlarm < BaseAlarm
181
+ def initialize(resource)
182
+ super(resource)
183
+ @group = 'DocumentDBCluster'
184
+ @namespace = 'AWS/DocDB'
185
+ @dimensions = { DBClusterIdentifier: resource['Id'] }
186
+ end
187
+ end
156
188
 
157
189
  class DomainExpiryAlarm < BaseAlarm
158
190
  def initialize(resource)
@@ -0,0 +1,40 @@
1
+ module CfnGuardian::Resource
2
+ class DMSCluster < Base
3
+
4
+ def default_alarms
5
+ alarm = CfnGuardian::Models::DMSClusterAlarm.new(@resource)
6
+ alarm.name = 'CPUUtilizationHighSpike'
7
+ alarm.metric_name = 'CPUUtilization'
8
+ alarm.threshold = 90
9
+ alarm.statistic = 'Minimum'
10
+ alarm.evaluation_periods = 10
11
+ @alarms.push(alarm)
12
+
13
+ alarm = CfnGuardian::Models::DMSClusterAlarm.new(@resource)
14
+ alarm.name = 'CPUUtilizationHighBase'
15
+ alarm.metric_name = 'CPUUtilization'
16
+ alarm.threshold = 95
17
+ alarm.evaluation_periods = 2
18
+ alarm.statistic = 'Maximum'
19
+ alarm.alarm_action = 'Warning'
20
+ @alarms.push(alarm)
21
+
22
+ alarm = CfnGuardian::Models::DMSClusterAlarm.new(@resource)
23
+ alarm.name = 'FreeStorageSpaceCrit'
24
+ alarm.metric_name = 'FreeStorageSpace'
25
+ alarm.statistic = 'Minimum'
26
+ alarm.threshold = 10000000000
27
+ alarm.evaluation_periods = 1
28
+ @alarms.push(alarm)
29
+
30
+ alarm = CfnGuardian::Models::DMSClusterAlarm.new(@resource)
31
+ alarm.name = 'FreeStorageSpaceWarn'
32
+ alarm.metric_name = 'FreeStorageSpace'
33
+ alarm.statistic = 'Minimum'
34
+ alarm.threshold = 20000000000
35
+ alarm.evaluation_periods = 1
36
+ alarm.alarm_action = 'Warning'
37
+ @alarms.push(alarm)
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,42 @@
1
+ module CfnGuardian::Resource
2
+ class DMSTask < Base
3
+
4
+ def default_alarms
5
+ alarm = CfnGuardian::Models::DMSTaskAlarm.new(@resource)
6
+ alarm.name = 'CDCLatencySourceCritical'
7
+ alarm.metric_name = 'CDCLatencySource'
8
+ alarm.statistic = 'Minimum'
9
+ alarm.threshold = 30
10
+ alarm.evaluation_periods = 10
11
+ alarm.enabled = false
12
+ @alarms.push(alarm)
13
+
14
+ alarm = CfnGuardian::Models::DMSTaskAlarm.new(@resource)
15
+ alarm.name = 'CDCLatencySourceWarn'
16
+ alarm.metric_name = 'CDCLatencySource'
17
+ alarm.statistic = 'Minimum'
18
+ alarm.threshold = 30
19
+ alarm.evaluation_periods = 1
20
+ alarm.enabled = false
21
+ @alarms.push(alarm)
22
+
23
+ alarm = CfnGuardian::Models::DMSTaskAlarm.new(@resource)
24
+ alarm.name = 'CDCLatencyTargetCritical'
25
+ alarm.metric_name = 'CDCLatencyTarget'
26
+ alarm.statistic = 'Minimum'
27
+ alarm.threshold = 30
28
+ alarm.evaluation_periods = 10
29
+ alarm.enabled = false
30
+ @alarms.push(alarm)
31
+
32
+ alarm = CfnGuardian::Models::DMSTaskAlarm.new(@resource)
33
+ alarm.name = 'CDCLatencyTargetWarn'
34
+ alarm.metric_name = 'CDCLatencyTarget'
35
+ alarm.statistic = 'Minimum'
36
+ alarm.threshold = 30
37
+ alarm.evaluation_periods = 1
38
+ alarm.enabled = false
39
+ @alarms.push(alarm)
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,40 @@
1
+ module CfnGuardian::Resource
2
+ class DocumentDBCluster < Base
3
+
4
+ def default_alarms
5
+ alarm = CfnGuardian::Models::DocumentDBClusterAlarm.new(@resource)
6
+ alarm.name = 'CPUUtilizationHighBase'
7
+ alarm.metric_name = 'CPUUtilization'
8
+ alarm.threshold = 75
9
+ alarm.evaluation_periods = 60
10
+ alarm.alarm_action = 'Warning'
11
+ @alarms.push(alarm)
12
+
13
+ alarm = CfnGuardian::Models::DocumentDBClusterAlarm.new(@resource)
14
+ alarm.name = 'CPUUtilizationHighSpike'
15
+ alarm.metric_name = 'CPUUtilization'
16
+ alarm.threshold = 95
17
+ alarm.evaluation_periods = 10
18
+ @alarms.push(alarm)
19
+
20
+ alarm = CfnGuardian::Models::DocumentDBClusterAlarm.new(@resource)
21
+ alarm.name = 'DatabaseConnections'
22
+ alarm.metric_name = 'DatabaseConnections'
23
+ alarm.statistic = 'Minimum'
24
+ alarm.threshold = 50
25
+ alarm.evaluation_periods = 10
26
+ @alarms.push(alarm)
27
+
28
+ alarm = CfnGuardian::Models::DocumentDBClusterAlarm.new(@resource)
29
+ alarm.name = 'FreeableMemory'
30
+ alarm.metric_name = 'FreeableMemory'
31
+ alarm.threshold = 1000000000
32
+ alarm.evaluation_periods = 3
33
+ alarm.comparison_operator = 'LessThanThreshold'
34
+ @alarms.push(alarm)
35
+ end
36
+
37
+ end
38
+ end
39
+
40
+
@@ -14,8 +14,9 @@ module CfnGuardian
14
14
  alarm = CfnGuardian::Models::Ec2InstanceAlarm.new(@resource)
15
15
  alarm.name = 'StatusCheckFailed'
16
16
  alarm.metric_name = 'StatusCheckFailed'
17
- alarm.threshold = 90
18
- alarm.evaluation_periods = 10
17
+ alarm.threshold = 0
18
+ alarm.evaluation_periods = 1
19
+ alarm.comparison_operator = 'GreaterThanThreshold'
19
20
  @alarms.push(alarm)
20
21
 
21
22
  alarm = CfnGuardian::Models::Ec2InstanceAlarm.new(@resource)
@@ -1,4 +1,4 @@
1
1
  module CfnGuardian
2
- VERSION = "0.7.9"
2
+ VERSION = "0.7.13"
3
3
  CHANGE_SET_VERSION = VERSION.gsub('.', '-').freeze
4
4
  end
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.7.9
4
+ version: 0.7.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guslington
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-13 00:00:00.000000000 Z
11
+ date: 2022-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -280,6 +280,9 @@ files:
280
280
  - lib/cfnguardian/resources/base.rb
281
281
  - lib/cfnguardian/resources/batch.rb
282
282
  - lib/cfnguardian/resources/cloudfront_distribution.rb
283
+ - lib/cfnguardian/resources/dms_cluster.rb
284
+ - lib/cfnguardian/resources/dms_task.rb
285
+ - lib/cfnguardian/resources/documentdb_cluster.rb
283
286
  - lib/cfnguardian/resources/domain_expiry.rb
284
287
  - lib/cfnguardian/resources/dynamodb_table.rb
285
288
  - lib/cfnguardian/resources/ec2_instance.rb