Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions terraform/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ resource "google_monitoring_alert_policy" "report_api_endpoint" {
(resource.type = "cloud_run_revision" AND resource.labels.service_name = "report-api-prod")
OR logName = "projects/httparchive/logs/requests"
severity >= WARNING
httpRequest.requestUrl =~ "https:\/\/cdn\.httparchive\.org"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly redundant.
The only IP-based hit happened before I added enforce_valid_host rule. Since then, IP requests get a 403 at the load balancer - denied_by_security_policy is already excluded.

Maybe add include_host = true to CDN cache key additionally, to avoid them hitting cache. Or should we move this policy to edge?

-httpRequest.status = (400 OR 404 OR 405)
-jsonPayload.statusDetails = ("denied_by_security_policy" OR "handled_by_cloud_armor" OR "response_from_cache" OR "backend_timeout")
-textPayload = "Truncated response body. Usually implies that the request timed out or the application exited before the response was finished."
-httpRequest.userAgent =~ "(?i)(bot|crawler|spider|slurp|archiver|scraper|research|baiduspider|googlebot|facebookexternalhit|meta-externalagent|mj12bot|petalbot|ccbot|censysinspect|worker|python)"
-protoPayload.userAgent =~ "(?i)(bot|crawler|spider|slurp|archiver|scraper|research|baiduspider|googlebot|facebookexternalhit|meta-externalagent|mj12bot|petalbot|ccbot|censysinspect|worker|python)"
-httpRequest.userAgent =~ "(?i)(curl|bot|crawler|spider|slurp|archiver|scraper|research|baiduspider|googlebot|facebookexternalhit|meta-externalagent|mj12bot|petalbot|ccbot|censysinspect|worker|python|http-|-http)"
-protoPayload.userAgent =~ "(?i)(curl|bot|crawler|spider|slurp|archiver|scraper|research|baiduspider|googlebot|facebookexternalhit|meta-externalagent|mj12bot|petalbot|ccbot|censysinspect|worker|python|http-|-http)"
Comment on lines +159 to +160

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hides real errors on /v1/technologies and /v1/cwv-distribution. I've reviewed user-agent list many times but it's still growing. I now think it's easier to fix server errors. Fixed in #156

EOF
label_extractors = {}
}
Expand Down
Loading