alphagov / consent-api

Service for sharing user consent to cookies across multiple domains
https://consent-api-bgzqvpmbyq-nw.a.run.app
MIT License
8 stars 0 forks source link

infra: rate limiting policy #210

Closed guilhem-fry closed 10 months ago

guilhem-fry commented 10 months ago

This PR introduces rate limiting on the backend services sitting behind the load balancers.

The policy implements the following behaviour:

The infra change consists in:

  1. Creating security rules
  2. Creating a security policy that includes these rules
  3. Attaching the security policy to the backend service

The default_rule is necessary: GCP requires all security policies to have a "default tule" at the highest priority.

image image
guilhem-fry commented 10 months ago

We can see the rate limiting ban coming into action with 403s with this small script I ran from my machine against staging:

image image image