Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Pelirrojo/1c1e9b3b07c52038864bb65c48b84235 to your computer and use it in GitHub Desktop.
Save Pelirrojo/1c1e9b3b07c52038864bb65c48b84235 to your computer and use it in GitHub Desktop.
Phase 1: Immediate Response | Deploy Emergency WAF Rules (Rate based rules)
# A vantablack friday: How to be prepared to stop DDoS Attacks after Halloween
# https://blog.evereven.tech
# Create a WebACL Group Rule
aws wafv2 create-rule-group \
--name "emergency-ddos-rules" \
--scope REGIONAL \
--capacity 1000 \
--visibility-config \
MetricName=DDOSRuleMetric,SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true \
--rules '[
{
"Name": "RateBasedRule",
"Priority": 1,
"VisibilityConfig": {
"SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true,
"MetricName": "RateBasedRuleMetric"
},
"Statement": {
"RateBasedStatement": {
"Limit": 2000,
"AggregateKeyType": "IP"
}
},
"Action": {
"Block": {}
}
}
]'
# Check at:
# https://us-east-1.console.aws.amazon.com/wafv2/homev2/rule-groups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment