demo-app-last-minute-rq-count-per-origin = floor(increase(demo_app_metric[1m]))
- Demo application is deployed on node
kube-worker-0
- Simple flask app is running on
kube-worker-0
with properly changedtarget_url
(demo-app svc ClusterIP) - Add security group rule that allows inbound http from your device (preferably with /16 mask)
In order to protect against DDOS attacks, we want to change security rules on our running instance
to disable income traffic from potential attacker.
To achieve this goal, we have to monitor requests per origin
in given time period - that is why demo-app-metric
was created.
- Check if requests per origin is high (more than 90 requests in last minute)
- Create security rules without subnet
<origin_ip>.0/24
- Delete current security rule that included origin IP
- After given time, go back to previous configuration