refactor(proxy): distinguish CONNECT_L7 from CONNECT in policy logs#365
Merged
johntmyers merged 1 commit intomainfrom Mar 16, 2026
Merged
Conversation
Closes #362 Split the CONNECT log emission in the proxy so denied connections log immediately as CONNECT while allowed connections defer logging until after the L7 config check. When L7 inspection follows, emit CONNECT_L7 instead of CONNECT so log consumers can distinguish standalone L4 policy decisions from tunnel lifecycle events.
pimlock
approved these changes
Mar 16, 2026
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
Split the CONNECT log emission so log consumers can distinguish standalone L4 policy decisions (
CONNECT) from tunnel lifecycle events that precede L7 inspection (CONNECT_L7). Previously, L7-configured endpoints emitted aCONNECT action=allowthat looked like an independent policy decision when it was really just context for theL7_REQUESTentries that follow.Related Issue
Closes #362
Changes
crates/openshell-sandbox/src/proxy.rs: Split the CONNECT log into two sites — denied connections log immediately asCONNECT, allowed connections defer logging until afterquery_l7_config()and emitCONNECT(L4-only) orCONNECT_L7(L7 inspection follows). Removed unusedaction_strvariable.crates/openshell-tui/src/ui/sandbox_logs.rs: Added clarifying comment onstarts_with("CONNECT")match that covers both message types. Addedplain_format_connect_l7_field_orderunit test.Deviations from Plan
None — implemented as planned.
Testing
cargo fmt --all -- --checkpassescargo clippy --workspace --all-targetspasses (no new warnings)cargo test --workspacepassesTests added:
plain_format_connect_l7_field_orderincrates/openshell-tui/src/ui/sandbox_logs.rs— verifiesCONNECT_L7messages use the same field ordering asCONNECTe2e/Checklist
Note: This is a minor breaking change to log format. Any external tooling that filters on
message == "CONNECT"will need to also match"CONNECT_L7"to capture all connections.