-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3353 from alphagov/ris-shield-cloudwatch
AWS Shield CloudWatch metrics and alertmanager alerts
- Loading branch information
Showing
6 changed files
with
163 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
# Source: paas-metrics | ||
# Source: yet-another-cloudwatch-exporter | ||
--- | ||
|
||
- type: replace | ||
path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/custom_rules?/- | ||
value: | ||
name: ShieldOngoingAttacks | ||
name: ShieldAttacks | ||
rules: | ||
- alert: ShieldAnyOngoingAttacks | ||
expr: paas_aws_shield_ongoing_attacks > 0 | ||
labels: | ||
severity: warning | ||
service: elb | ||
annotations: | ||
summary: "AWS Shield reporting an ongoing attack" | ||
description: "An ongoing attack being reported by AWS Shield could be indicative of a large traffic spike. Is a tenant load testing?" | ||
|
||
- alert: DDoSDetected | ||
# weird metric name comes from yet-another-cloudwatch-exporter's | ||
# capitalization-based auto-snake-case-conversion | ||
expr: aws_ddosprotection_ddo_sdetected_maximum{dimension_ResourceArn=~".*/((metrics_environment))-cf-rtr-.*"} > 0 | ||
labels: | ||
severity: warning | ||
service: elb | ||
annotations: | ||
summary: "AWS has detected a DDoS attack" | ||
description: "AWS has detected a DDoS attack affecting {{$labels.dimension_ResourceArn}}" | ||
|
||
- alert: DDoSBeingMitigated | ||
expr: aws_ddosprotection_volume_packets_per_second_average{dimension_ResourceArn=~".*/((metrics_environment))-cf-rtr-.*", dimension_MitigationAction="Drop"} > 0 | ||
labels: | ||
severity: critical | ||
service: elb | ||
annotations: | ||
summary: "AWS is mitigating a DDoS attack" | ||
description: "AWS is mitigating a DDoS attack affecting {{$labels.dimension_ResourceArn}} - you should probably check it isn't preventing genuine traffic getting through." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
rule_files: | ||
# See alerts_validation_spec.rb for details of how stdin gets set: | ||
- fixtures/rules.yml | ||
|
||
evaluation_interval: 1m | ||
|
||
tests: | ||
- interval: 5m | ||
input_series: | ||
- series: 'paas_aws_shield_ongoing_attacks' | ||
values: 1 | ||
|
||
alert_rule_test: | ||
- alertname: ShieldAnyOngoingAttacks | ||
eval_time: 5m | ||
exp_alerts: | ||
- exp_annotations: | ||
summary: "AWS Shield reporting an ongoing attack" | ||
description: "An ongoing attack being reported by AWS Shield could be indicative of a large traffic spike. Is a tenant load testing?" | ||
exp_labels: | ||
severity: warning | ||
service: elb | ||
|
||
- interval: 5m | ||
input_series: | ||
- series: 'aws_ddosprotection_ddo_sdetected_maximum{dimension_ResourceArn="arn:aws:elasticloadbalancing:eu-west-1:999999999999:loadbalancer/app/test-cf-rtr-sys/fefefefefefefefe"}' | ||
values: 123 | ||
|
||
alert_rule_test: | ||
- alertname: DDoSDetected | ||
eval_time: 5m | ||
exp_alerts: | ||
- exp_annotations: | ||
summary: "AWS has detected a DDoS attack" | ||
description: "AWS has detected a DDoS attack affecting arn:aws:elasticloadbalancing:eu-west-1:999999999999:loadbalancer/app/test-cf-rtr-sys/fefefefefefefefe" | ||
exp_labels: | ||
severity: warning | ||
service: elb | ||
dimension_ResourceArn: "arn:aws:elasticloadbalancing:eu-west-1:999999999999:loadbalancer/app/test-cf-rtr-sys/fefefefefefefefe" | ||
|
||
- interval: 5m | ||
input_series: | ||
- series: 'aws_ddosprotection_volume_packets_per_second_average{dimension_ResourceArn="arn:aws:elasticloadbalancing:eu-west-1:999999999999:loadbalancer/app/test-cf-rtr-sys/fefefefefefefefe", dimension_MitigationAction="Drop"}' | ||
values: 123 | ||
|
||
alert_rule_test: | ||
- alertname: DDoSBeingMitigated | ||
eval_time: 5m | ||
exp_alerts: | ||
- exp_annotations: | ||
summary: "AWS is mitigating a DDoS attack" | ||
description: "AWS is mitigating a DDoS attack affecting arn:aws:elasticloadbalancing:eu-west-1:999999999999:loadbalancer/app/test-cf-rtr-sys/fefefefefefefefe - you should probably check it isn't preventing genuine traffic getting through." | ||
exp_labels: | ||
severity: critical | ||
service: elb | ||
dimension_ResourceArn: "arn:aws:elasticloadbalancing:eu-west-1:999999999999:loadbalancer/app/test-cf-rtr-sys/fefefefefefefefe" | ||
dimension_MitigationAction: "Drop" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters