Repository navigation
Record the Cloud Armor rules that refuse requests without a credential - #4322
Merged
Merged
Conversation
Adds the exported snapshots of pol-api-lb from 2026-11-17: after rules 770-772 and log-only rule 800 were added, and after rule 800 was enforced. Rule 800 answers 403 at the load balancer to requests with no Authorization header, or a blank one, outside the Public API's public routes, which rules 770-772 allow first. These are requests the Public API refuses with 401 since PUBLIC_API_SERVER_CREDENTIAL_REQUIRED=1. The runbook gets a section on these rules: what callers through api.policyengine.org now see (Google's 403 page, not the Public API's 401), keeping rules 770-772 matched to the Public API's public routes, using rule 800 only while enforcement is on, preflights leaving the per-address limits, the accepted blank-header pattern, the 2-hour preview, and how to check and roll it back. It also corrects the summary table, where the calculate throttle (rule 1100) has been enforced since the 2026-11-10 snapshot, and updates the rule 900 notes that described the Public API serving requests without a credential. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runbook's summary table said rule 1100 (the calculate throttle) stays in preview; it was enforced on 2026-11-09 at 15:01 UTC, after the partner API fallback that kept it in preview was removed in July 2026. The note on preview validation said throttle rules in preview only log CONFORM; rule 1100's preview logged RATE_LIMIT_THRESHOLD_EXCEED for 29,037 of 162,011 matching requests in the 30 days before it was enforced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4322 +/- ##
=======================================
Coverage 93.67% 93.67%
=======================================
Files 397 397
Lines 22831 22885 +54
Branches 3589 3633 +44
=======================================
+ Hits 21387 21438 +51
- Misses 840 845 +5
+ Partials 604 602 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was previously deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4323
Fixes #4231
Summary
Records the Cloud Armor change of 2026-11-17 on
pol-api-lb, the policy on api.policyengine.org's load balancer. Documentation and snapshots only: the policy was changed withgcloud, as the runbook describes, and this pull request changes no code or deployment.GETandHEAD /health,GET /v2/openapi.json, and CORS preflights (OPTIONSwithOriginandAccess-Control-Request-Method). These are the Public API's public routes (PUBLIC_ROUTESandis_public_requestinpolicyengine_api/request_caller.py).deny(403)): requests with noAuthorizationheader, or one of only spaces and tabs. The Public API already refuses these with 401 sincePUBLIC_API_SERVER_CREDENTIAL_REQUIRED=1; the load balancer now refuses them before they reach Cloud Run.Changes
docs/migration/armor/20261117T105602Z-pol-api-lb-edge-refusal-preview.yaml: the policy after rules 770–772 and log-only rule 800 were added.docs/migration/armor/20261117T130329Z-pol-api-lb-edge-refusal-enforced.yaml: the policy after rule 800 was enforced (the current state).docs/migration/lb-cloud-armor-runbook.md:WWW-Authenticate: Bearer), keeping rules 770–772 matched to the Public API's public routes, using rule 800 only while enforcement is on, CORS preflights no longer counting toward the per-address limits, the blank-header pattern Cloud Armor accepts, the 2-hour preview, and how to check and roll back;CONFORM; rule 1100's preview loggedRATE_LIMIT_THRESHOLD_EXCEEDfor 29,037 of 162,011 matching requests (Record that Cloud Armor now enforces the /calculate rate limit #4231). The 2026-11-10 snapshot already shows rule 1100 enforced, so Record that Cloud Armor now enforces the /calculate rate limit #4231 needs no new snapshot;changelog.d/cloud-armor-edge-refusal.changed.md.Behavior change for callers
Through api.policyengine.org, a request without a credential outside the public routes now gets
403with Google's HTML page, not the Public API's401JSON. Requests to the*.run.appURLs skip the load balancer and still get the Public API's 401. Requests with any non-blankAuthorizationheader pass the load balancer, and the Public API validates them as before.Verification
/,/no-such-path,/us/metadata,POST /us/calculate,/v2/model-catalog,/deploymentand/v2/megot 403;GETandHEAD /health,/v2/openapi.jsonand a CORS preflight got 200.Authorization: Bearer made-upgot the Public API's 401, and a blank header got 403. The same checks against the*.run.appURL got the Public API's 401.enforcedSecurityPolicy.priority=800with outcomeDENYonly for requests without a credential./us/calculateand/us/metadata, 200).🤖 Generated with Claude Code