# Cloud Armor returns 403 Forbidden: request blocked by a security policy rule

**Code:** `Cloud Armor` · **Category:** Google Cloud / Firebase · **Seen on:** Google Cloud, HTTP

A Cloud Armor policy on the load balancer denied the request (IP, geo, preconfigured WAF rule or rate limit).

## Meaning

Find the matching rule in the load balancer's request logs (`enforcedSecurityPolicy`), then tune the rule: add an allow rule with lower priority number for trusted IPs, switch a WAF rule to preview mode, exclude false-positive signatures, or adjust rate limits.

## Common causes

- Preconfigured WAF rule false positive (SQLi/XSS)
- Geo/IP deny rule
- Rate-based ban
- Rule priority order wrong
- Missing allow rule for health checks/partners

## Quick fix

1. Check `enforcedSecurityPolicy.name` and `outcome` in logs
2. Put allow rules at a lower priority number
3. Use preview mode and exclusions for WAF rules

## Detailed fix by platform

### Shell

1. `gcloud logging read 'resource.type="http_load_balancer" AND jsonPayload.enforcedSecurityPolicy.outcome="DENY"' --limit=5`

## How to diagnose

1. **Rule** — Which matched?
2. **Priority** — Correct?
3. **Mode** — Preview first?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/gcp/cloud-armor-403-rule-blocked)
