fix: flag inverted TrafficProtectionPolicy paranoia levels via status condition#252
Draft
ecv wants to merge 1 commit into
Draft
fix: flag inverted TrafficProtectionPolicy paranoia levels via status condition#252ecv wants to merge 1 commit into
ecv wants to merge 1 commit into
Conversation
A TrafficProtectionPolicy whose OWASP CRS detection paranoia level is below its blocking paranoia level is an illegal configuration: CRS rule 901500 fails closed and denies every request at phase 1 with HTTP 500 before any attack evaluation. Such a policy silently 500s 100% of traffic to the protected route with no signal to the tenant about why. Reject the policy during reconciliation: set Accepted=False with reason Invalid on the affected ancestor and skip attachment so the broken directives are never emitted to the data plane. This also surfaces already-persisted policies that carry the inverted configuration. Key changes: - add paranoiaLevelsResolveError guard in the TPP reconciler - set Accepted=False/Invalid and skip attach for HTTPRoute and Gateway targets when detection < blocking - add unit coverage for the guard and both process paths
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.
Summary
Addresses #250 via option 3 (controller status condition, defense-in-depth) from the issue's root-cause comment.
A
TrafficProtectionPolicywhose OWASP CRS detection paranoia level is below its blocking paranoia level is illegal: CRS rule 901500 fails closed and denies every request at phase 1 with HTTP 500 before any attack evaluation. Such a policy silently 500s 100% of traffic with no signal to the tenant about why.Change
Reject the policy during reconciliation:
Accepted=Falsewith reasonInvalidon the affected ancestor.Test
TestParanoiaLevelsResolveError— guard, 4 cases (equal / higher detection / inverted / defaulted inverted).TestProcessTrafficProtectionPolicyForHTTPRouteandTestProcessTrafficProtectionPolicyForGateway, assertingAccepted=False/Invalidand no attachment.Companion PR
Companion to #251, which implements option 1 (CEL admission validation, the preferred fail-closed fix). CEL only validates on write; this guard catches policies already stored with the bad config and gives tenants an actionable
Accepted=Falsereason. The two are complementary and can merge independently.