fix(proxy): add L7 inspection to forward proxy path#666
Open
latenighthackathon wants to merge 2 commits intoNVIDIA:mainfrom
Open
fix(proxy): add L7 inspection to forward proxy path#666latenighthackathon wants to merge 2 commits intoNVIDIA:mainfrom
latenighthackathon wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Make evaluate_l7_request() public so the forward proxy path can evaluate individual requests against L7 policy without going through the full relay_with_inspection() loop. Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
The forward proxy previously rejected all requests to endpoints with L7 rules (blanket 403), forcing clients through the CONNECT tunnel. This meant policies like read-only (allow GET, block POST) had no effect on plain http:// requests through the forward proxy. Replace the blanket rejection with actual L7 evaluation: - Query L7 config for the endpoint (same as before) - Clone the OPA engine and evaluate the request method/path - Allow if L7 policy permits, deny with 403 if enforcement is enforce - Audit mode: log but allow (matching CONNECT path behavior) - Fail-closed: deny on evaluation errors The forward proxy uses Connection: close (one request per connection), so a single evaluation suffices — no relay loop needed. Update e2e tests to validate the new behavior: - GET /allowed → 200 (L7 policy allows) - POST /allowed → 403 (L7 policy denies, enforcement: enforce) Update security-policy.md to reflect the new forward proxy L7 behavior. Closes NVIDIA#643 Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
Contributor
Author
|
I have read the DCO document and I hereby sign the DCO. |
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
The forward proxy previously rejected all requests to endpoints with L7 rules (blanket 403), forcing clients through the CONNECT tunnel. This meant policies like
access: read-only(allow GET, block POST) had no effect on plainhttp://requests via the forward proxy.This PR replaces the blanket rejection with actual L7 evaluation:
evaluate_l7_request()public for cross-module useenforcement: enforceand policy deniesarchitecture/security-policy.mdV1 simplifications noteSecurity posture change
Endpoints that previously received a blanket 403 on the forward proxy path will now be evaluated against their L7 policy. If
enforcement: audit(the default), traffic that was previously blocked will now flow through with audit logging. Ifenforcement: enforce, only policy-permitted requests will be forwarded.The forward proxy uses
Connection: close(one request per connection), so a single L7 evaluation suffices — no relay loop needed. The implementation mirrors the CONNECT path's patterns for OPA engine cloning,L7EvalContextconstruction, and enforcement handling.Test plan
cargo testpassesforward_proxy_allows_l7_permitted_request: GET /allowed → 200forward_proxy_denies_l7_blocked_request: POST /allowed → 403Closes #643
I have read the DCO document and I hereby sign the DCO.