Created
October 30, 2024 14:27
-
-
Save Pelirrojo/1c1e9b3b07c52038864bb65c48b84235 to your computer and use it in GitHub Desktop.
Phase 1: Immediate Response | Deploy Emergency WAF Rules (Rate based rules)
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
# 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